Sfoglia il codice sorgente

新增动态菜单

chenweida 8 anni fa
parent
commit
447f49f487
14 ha cambiato i file con 653 aggiunte e 111 eliminazioni
  1. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/MvcConfig.java
  2. 9 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/doctor/profile/Doctor.java
  3. 185 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionInfo.java
  4. 8 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionReviewed.java
  5. 173 13
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java
  6. 20 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  7. 33 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/express/SFExpressService.java
  8. 73 26
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java
  9. 4 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/httplog/LogService.java
  10. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SFUtils.java
  11. 100 34
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java
  12. 15 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java
  13. 2 20
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/express/SFExpressApiController.java
  14. 25 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/express/SFExpressController.java

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/MvcConfig.java

@ -31,9 +31,9 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
        // 多个拦截器组成一个拦截器链
        // addPathPatterns 用于添加拦截规则
        // excludePathPatterns 用户排除拦截
//        registry.addInterceptor(doctorInterceptor).addPathPatterns("/doctor/**","/statistics/province/**","/statistics/**");
//        registry.addInterceptor(patientInterceptor).addPathPatterns("/patient/**");
//        registry.addInterceptor(userInterceptor).addPathPatterns("/user/**");
        registry.addInterceptor(doctorInterceptor).addPathPatterns("/doctor/**","/statistics/province/**","/statistics/**");
        registry.addInterceptor(patientInterceptor).addPathPatterns("/patient/**");
        registry.addInterceptor(userInterceptor).addPathPatterns("/user/**");
        super.addInterceptors(registry);
    }

+ 9 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/doctor/profile/Doctor.java

@ -67,6 +67,7 @@ public class Doctor extends IdEntity {
    private Double evaluateScore;//评分
    private String checkPassword;   //审方密码
    private String checkSalt;       //审方密码的盐
    private Date certifiedOvertime; //CA证书过期时间
    public Double getEvaluateScore() {
        return evaluateScore;
@ -414,4 +415,12 @@ public class Doctor extends IdEntity {
    public void setCheckSalt(String checkSalt) {
        this.checkSalt = checkSalt;
    }
    public Date getCertifiedOvertime() {
        return certifiedOvertime;
    }
    public void setCertifiedOvertime(Date certifiedOvertime) {
        this.certifiedOvertime = certifiedOvertime;
    }
}

+ 185 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionInfo.java

@ -1,12 +1,10 @@
package com.yihu.wlyy.entity.patient.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Administrator on 2017/7/21.
@ -25,8 +23,28 @@ public class PrescriptionInfo extends IdEntity{
    private Integer num;                    //药品数目
    private Integer isRefrigerate;         //是否冷藏 1是 0否
    private String direction;               //药品用法
    private Double price;                    //药品价格
    private Double price;                    //药品单价
    private Integer del;               //1可用 0删除 不填数据库默认是1
    private String jwSubCode;//智业子处方号
    private String drugNumUnit;//数量单位编码
    private String drugNumUnitName;//数量单位名称
    private Double cost;//金额
    private String charge;//自付
    private String bindFlag;//成组标志, 0.非成组,1.成组
    private Integer dayCount;//用药天数
    private String drugUsage;//用药方法编码
    private String usageName;//用药方法名称
    private String physicDose;//用药剂量
    private String physicDoseUnit;//剂量单位编码
    private String physicDoseUnitName;//剂量单位名称
    private String physicAmount;//用药总量
    private String physicAmountUnit;//总量单位编码
    private String physicAmountUnitName;//总量单位名称
    private String physicInjectPlace;//注射地点编码
    private String physicInjectPlaceName;//注射地点名称
    private String physicSkinTest;//注射地点名称
    private String physicSkinTestName;//皮试类型名称
    private String remark;//备注
    @Column(name = "code",unique = true , nullable=false)
    public String getCode() {
@ -119,4 +137,168 @@ public class PrescriptionInfo extends IdEntity{
    public void setDel(Integer del) {
        this.del = del;
    }
    public String getJwSubCode() {
        return jwSubCode;
    }
    public void setJwSubCode(String jwSubCode) {
        this.jwSubCode = jwSubCode;
    }
    public String getDrugNumUnit() {
        return drugNumUnit;
    }
    public void setDrugNumUnit(String drugNumUnit) {
        this.drugNumUnit = drugNumUnit;
    }
    public String getDrugNumUnitName() {
        return drugNumUnitName;
    }
    public void setDrugNumUnitName(String drugNumUnitName) {
        this.drugNumUnitName = drugNumUnitName;
    }
    public Double getCost() {
        return cost;
    }
    public void setCost(Double cost) {
        this.cost = cost;
    }
    public String getCharge() {
        return charge;
    }
    public void setCharge(String charge) {
        this.charge = charge;
    }
    @Column(name = "bind_flag")
    public String getBindFlag() {
        return bindFlag;
    }
    public void setBindFlag(String bindFlag) {
        this.bindFlag = bindFlag;
    }
    @Column(name = "day_count")
    public Integer getDayCount() {
        return dayCount;
    }
    public void setDayCount(Integer dayCount) {
        this.dayCount = dayCount;
    }
    public String getDrugUsage() {
        return drugUsage;
    }
    public void setDrugUsage(String drugUsage) {
        this.drugUsage = drugUsage;
    }
    @Column(name = "usage_name")
    public String getUsageName() {
        return usageName;
    }
    public void setUsageName(String usageName) {
        this.usageName = usageName;
    }
    @Column(name = "physic_dose")
    public String getPhysicDose() {
        return physicDose;
    }
    public void setPhysicDose(String physicDose) {
        this.physicDose = physicDose;
    }
    public String getPhysicDoseUnit() {
        return physicDoseUnit;
    }
    public void setPhysicDoseUnit(String physicDoseUnit) {
        this.physicDoseUnit = physicDoseUnit;
    }
    public String getPhysicDoseUnitName() {
        return physicDoseUnitName;
    }
    public void setPhysicDoseUnitName(String physicDoseUnitName) {
        this.physicDoseUnitName = physicDoseUnitName;
    }
    public String getPhysicAmount() {
        return physicAmount;
    }
    public void setPhysicAmount(String physicAmount) {
        this.physicAmount = physicAmount;
    }
    public String getPhysicAmountUnit() {
        return physicAmountUnit;
    }
    public void setPhysicAmountUnit(String physicAmountUnit) {
        this.physicAmountUnit = physicAmountUnit;
    }
    public String getPhysicAmountUnitName() {
        return physicAmountUnitName;
    }
    public void setPhysicAmountUnitName(String physicAmountUnitName) {
        this.physicAmountUnitName = physicAmountUnitName;
    }
    public String getPhysicInjectPlace() {
        return physicInjectPlace;
    }
    public void setPhysicInjectPlace(String physicInjectPlace) {
        this.physicInjectPlace = physicInjectPlace;
    }
    public String getPhysicInjectPlaceName() {
        return physicInjectPlaceName;
    }
    public void setPhysicInjectPlaceName(String physicInjectPlaceName) {
        this.physicInjectPlaceName = physicInjectPlaceName;
    }
    public String getPhysicSkinTest() {
        return physicSkinTest;
    }
    public void setPhysicSkinTest(String physicSkinTest) {
        this.physicSkinTest = physicSkinTest;
    }
    public String getPhysicSkinTestName() {
        return physicSkinTestName;
    }
    public void setPhysicSkinTestName(String physicSkinTestName) {
        this.physicSkinTestName = physicSkinTestName;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
}

+ 8 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionReviewed.java

@ -61,7 +61,15 @@ public class PrescriptionReviewed extends IdEntity {
    private Integer status;               //  1审核通过1 0待审核  -1  审核通过   -2无效审核
    private String reason;                  //审核不通过原因
    private String remark;                  //备注
    private Date reviewedTime;           //审核时间
    public Date getReviewedTime() {
        return reviewedTime;
    }
    public void setReviewedTime(Date reviewedTime) {
        this.reviewedTime = reviewedTime;
    }
    public String getCode() {
        return code;

+ 173 - 13
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.service.app.account;
import com.alibaba.fastjson.JSON;
import com.yihu.wlyy.entity.address.City;
import com.yihu.wlyy.entity.address.Province;
import com.yihu.wlyy.entity.address.Town;
@ -28,17 +29,18 @@ import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
import com.yihu.wlyy.service.app.talk.TalkGroupService;
import com.yihu.wlyy.service.common.SMSService;
import com.yihu.wlyy.service.third.httplog.LogService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.EncodesUtil;
import com.yihu.wlyy.util.ImUtill;
import com.yihu.wlyy.util.MD5;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
@ -54,6 +56,7 @@ import org.springside.modules.persistence.SearchFilter.Operator;
import org.springside.modules.security.utils.Digests;
import org.springside.modules.utils.Encodes;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -113,6 +116,16 @@ public class DoctorInfoService extends BaseService {
    @Autowired
    private PushMsgTask pushMsgTask;
    //基卫服务地址
    @Value("${sign.check_upload}")
    private String jwUrl;
    @Autowired
    private HttpClientUtil HttpClientUtil;
    @Autowired
    private LogService logService;
    /**
     * 获取医生的签约病人
     *
@ -1268,17 +1281,164 @@ public class DoctorInfoService extends BaseService {
        }
    }
//    /**
//     * 审方密码设置
//     * @param passwoed
//     * @return
//     */
//    @Transactional
//    public void setCheckPassword(Doctor doctor,String passwoed){
//
//        byte[] salt = Digests.generateSalt(8);
//        doctor.setCheckSalt(Encodes.encodeHex(salt));
//        byte[] hashPassword = Digests.sha1(passwoed.getBytes(), salt, 1024);
//        doctor.setCheckPassword(Encodes.encodeHex(hashPassword));
//    }
    /**
     * 审方密码设置
     * @param passwoed
     * @return
     * 获取CA证书过期时间
     */
    @Transactional
    public void setCheckPassword(Doctor doctor,String passwoed){
    public JSONObject getCAPastDue(String strUserIdcardNum)  throws Exception{
        Boolean isSuccess = true;
        String url = jwUrl+"/third/prescription/GetRealNameSoftCertExpiredDatetime";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("strUserIdcardNum",strUserIdcardNum));
        String response = HttpClientUtil.post(url, params, "UTF-8");
        if (!StringUtils.isEmpty(response)){
            JSONObject responseObject = new JSONObject(response);
            int status = responseObject.getInt("status");
            String msg = responseObject.getString("msg");
            if (status == 200) {
                String data = responseObject.getString("data");
                if (!StringUtils.isEmpty(data) && data.startsWith("error")) {
                    throw new Exception(data);
                } else {
//                    JSONObject jsonData = new JSONObject(data);
//                    JSONArray jsonArray = jsonData.getJSONArray("EventList");
//                    re = jsonArray.toString();
                    JSONObject jsonObject = new JSONObject();
                    //1、有证书,并有效,2、有证书,已过期,3、无证书
                    if(StringUtils.isNotEmpty(data)){
                        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                        long times = simpleDateFormat.parse(data).getTime();
                        if(System.currentTimeMillis()<=times){
                            jsonObject.put("type",1);
                        }else{
                            jsonObject.put("type",2);
                        }
                    }else{
                        jsonObject.put("type",3);
                    }
                    jsonObject.put("time",data);
                    return jsonObject;
                }
            } else {
                throw new Exception(responseObject.getString("msg"));
            }
        }else {
            throw new Exception("null response.");
        }
    }
        byte[] salt = Digests.generateSalt(8);
        doctor.setCheckSalt(Encodes.encodeHex(salt));
        byte[] hashPassword = Digests.sha1(passwoed.getBytes(), salt, 1024);
        doctor.setCheckPassword(Encodes.encodeHex(hashPassword));
    /**
     * 修改实名软证书调用保护口令
     */
    public boolean updateAuthenticationPassword(String strUserIdcardNum,String strOldCalledPasswd,String strNewCalledPasswd) throws Exception{
        String url = jwUrl+"/third/prescription/ModifyRealNameSoftCertCalledPasswd";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("strUserIdcardNum",strUserIdcardNum));
        params.add(new BasicNameValuePair("strOldCalledPasswd",strOldCalledPasswd));
        params.add(new BasicNameValuePair("strNewCalledPasswd",strNewCalledPasswd));
        String response = HttpClientUtil.post(url, params, "UTF-8");
        if (!StringUtils.isEmpty(response)){
            JSONObject responseObject = new JSONObject(response);
            int status = responseObject.getInt("status");
            String msg = responseObject.getString("msg");
            if (status == 200) {
                String data = responseObject.getString("data");
                if (!StringUtils.isEmpty(data) && data.startsWith("error")) {
                    throw new Exception(data);
                }else{
                    if("0".equals(data)){
                        return true;
                    }
                }
            }else{
                throw new Exception(responseObject.getString("msg"));
            }
        }else{
            throw new Exception("null response.");
        }
        return false;
    }
    public boolean requestRealNameSoftCertAndSign(String strUserIdcardNum,String strRealNameSoftCertCalledPasswd,String strOriginalData, String srcBusinessStreamNO) throws Exception{
        String url = jwUrl+"/third/prescription/RequestRealNameSoftCertAndSign";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("strUserIdcardNum",strUserIdcardNum));
        params.add(new BasicNameValuePair("strRealNameSoftCertCalledPasswd",strRealNameSoftCertCalledPasswd));
        params.add(new BasicNameValuePair("strOriginalData",strOriginalData));
        params.add(new BasicNameValuePair("srcBusinessStreamNO",srcBusinessStreamNO));
        String response = HttpClientUtil.post(url, params, "UTF-8");
        if (!StringUtils.isEmpty(response)){
            JSONObject responseObject = new JSONObject(response);
            int status = responseObject.getInt("status");
            String msg = responseObject.getString("msg");
            if (status == 200) {
                String data = responseObject.getString("data");
                if (!StringUtils.isEmpty(data) && data.startsWith("error")) {
                    throw new Exception(data);
                }else{
                    String[] str = data.split("||");
//                    String strSignData = str[0];
//                    String strCertData = str[1];
//                    JSONObject jsonObject = new JSONObject();
//                    jsonObject.put("strSignData",str[0]);
//                    jsonObject.put("strCertData",str[1]);
                    return verifySignOnMultiServer(str[0],str[1],strOriginalData);
//                    return jsonObject;
                }
            }else{
                throw new Exception(responseObject.getString("msg"));
            }
        }else{
            throw new Exception("null response.");
        }
    }
    //验证签名( ( 带多服务器负载均衡) )
    public boolean verifySignOnMultiServer(String strSignData,String strCertData,String strOriginalData) throws Exception{
        String url = jwUrl+"/third/prescription/VerifySignOnMultiServer";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("strSignData",strSignData));
        params.add(new BasicNameValuePair("strCertData",strCertData));
        params.add(new BasicNameValuePair("strOriginalData",strOriginalData));
        String response = HttpClientUtil.post(url, params, "UTF-8");
        if (!StringUtils.isEmpty(response)){
            JSONObject responseObject = new JSONObject(response);
            int status = responseObject.getInt("status");
            String msg = responseObject.getString("msg");
            if (status == 200) {
                String data = responseObject.getString("data");
                if (!StringUtils.isEmpty(data) && data.startsWith("error")) {
                    throw new Exception(data);
                }else{
                    if("0".equals(data)){
                        return true;
                    }
                }
            }else{
                throw new Exception(responseObject.getString("msg"));
            }
        }else{
            throw new Exception("null response.");
        }
        return false;
    }
}

+ 20 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -1041,6 +1041,26 @@ public class ConsultTeamService extends ConsultService {
        prescriptionInfo.setDrugFormat("2.5mg*80片/盒");//药品规格
        prescriptionInfo.setNum(10);//药品数目
        prescriptionInfo.setIsRefrigerate(0);//是否冷藏 1是 0否
        prescriptionInfo.setJwSubCode("");//智业子处方号
        prescriptionInfo.setDrugNumUnit("");//数量单位编码
        prescriptionInfo.setDrugNumUnitName("");//数量单位名称
        prescriptionInfo.setCost(1.00d);//金额
        prescriptionInfo.setCharge("");//自付
        prescriptionInfo.setBindFlag("0");//成组标志, 0.非成组,1.成组
        prescriptionInfo.setDayCount(2);//用药天数
        prescriptionInfo.setDrugUsage("");//用药方法编码
        prescriptionInfo.setUsageName("");//用药方法名称
        prescriptionInfo.setPhysicDose("");//用药剂量
        prescriptionInfo.setPhysicDoseUnit("");//剂量单位编码
        prescriptionInfo.setPhysicDoseUnitName("");//剂量单位名称
        prescriptionInfo.setPhysicAmount("");//用药总量
        prescriptionInfo.setPhysicAmountUnit("");//总量单位编码
        prescriptionInfo.setPhysicAmountUnitName("");//总量单位名称
        prescriptionInfo.setPhysicInjectPlace("");//注射地点编码
        prescriptionInfo.setPhysicInjectPlaceName("");//注射地点名称
        prescriptionInfo.setPhysicSkinTest("");//注射地点名称
        prescriptionInfo.setPhysicSkinTestName("");//皮试类型名称
        prescriptionInfo.setRemark("");//备注
        prescriptionInfoDao.save(prescriptionInfo);
        PrescriptionDiagnosis diagnosis = new PrescriptionDiagnosis();

+ 33 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/express/SFExpressService.java

@ -1,9 +1,11 @@
package com.yihu.wlyy.service.app.express;
import com.yihu.wlyy.entity.dict.DmExpressagePriceEntity;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressage;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressageLog;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
import com.yihu.wlyy.repository.dict.DmExpressagePriceDao;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.repository.prescription.PrescriptionExpressageDao;
import com.yihu.wlyy.repository.prescription.PrescriptionExpressageLogDao;
@ -59,6 +61,9 @@ public class SFExpressService extends BaseService {
    @Autowired
    private SFUtils SFUtils;
    @Autowired
    private JpaTransactionManager transactionManager;
    @Autowired
    private PrescriptionLogDao prescriptionLogDao;
@ -66,7 +71,7 @@ public class SFExpressService extends BaseService {
    private PrescriptionDao prescriptionDao;
    @Autowired
    private JpaTransactionManager transactionManager;
    private DmExpressagePriceDao dmExpressagePriceDao;
    @Autowired
    private PrescriptionExpressageLogDao prescriptionExpressageLogDao;
@ -391,13 +396,13 @@ public class SFExpressService extends BaseService {
        //根据快递单号获取处方配送详细信息
        PrescriptionExpressage sfexpress = prescriptionExpressageDao.findByPrescriptionExpressMailno(mailno);
        //根据快递单号获取本地的路由信息
        List<PrescriptionExpressageLog> localroutinfos = prescriptionExpressageLogDao.findByPrescriptionCode(sfexpress.getPrescriptionCode());
        //需要增量更新到本地的路由信息集合
        List<PrescriptionExpressageLog> newroutinfolist = new ArrayList<>();
        DefaultTransactionDefinition def = new DefaultTransactionDefinition();
        def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW); // 事物隔离级别,开启新事务
        def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW); // 事务隔离级别,开启新事务
        TransactionStatus status = transactionManager.getTransaction(def); // 获得事务状态
        try {
@ -412,6 +417,7 @@ public class SFExpressService extends BaseService {
            for (PrescriptionExpressageLog pushlog: pushSFLogs) {
                //判断是否有已收件的路由节点
                if("已收件".equals(pushlog.getAcceptRemark())){
                    isContainEndRoutInfo = true;
                }
@ -429,7 +435,7 @@ public class SFExpressService extends BaseService {
                prescriptionExpressageLogDao.save(newroutinfolist);
            }
            //如果路由信息节点包含了"已收件"节点,这修改处方派送状态为完成,增加物流派送日志为完成
            //如果路由信息节点包含了"已收件"节点,则修改处方状态为完成,增加物流派送日志为完成
            if(isContainEndRoutInfo){
                //修改处方状态为完成
                prescriptionDao.updateStatus(sfexpress.getPrescriptionCode(), PrescriptionLog.PrescriptionLogStatus.finish.getValue());
@ -453,4 +459,26 @@ public class SFExpressService extends BaseService {
    }
    /**
     * 根据收寄地址获取快递费用
     * @param d_province 省份名称
     * @param d_city     城市名称
     * @return
     */
    public DmExpressagePriceEntity getSFExpressPrice(String d_province, String d_city) {
        String end_address_name = "";
        if("厦门市".equals(d_city)){
            end_address_name = "同城";
        }else{
            if("福建省".equals(d_province)){
                end_address_name = "省内";
            }else{
                end_address_name = d_city;
            }
        }
        DmExpressagePriceEntity sfprice =  dmExpressagePriceDao.getExprePriceEntityByCodeAndEndAdressName("shunfeng",end_address_name);
        return sfprice;
    }
}

+ 73 - 26
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -5,17 +5,11 @@ import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionAdjust;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
import com.yihu.wlyy.entity.patient.prescription.*;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.prescription.PrescriptionAdjustDao;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.repository.prescription.PrescriptionInfoDao;
import com.yihu.wlyy.repository.prescription.PrescriptionLogDao;
import com.yihu.wlyy.repository.prescription.*;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.ImUtill;
@ -54,6 +48,8 @@ public class PrescriptionInfoService extends BaseService {
    @Autowired
    private PrescriptionAdjustDao prescriptionAdjustDao;
    @Autowired
    private PrescriptionReviewedDao prescriptionReviewedDao;
    @Autowired
    private ImUtill imUtill;
    /**
@ -74,10 +70,10 @@ public class PrescriptionInfoService extends BaseService {
        List<Map<String,Object>> diseases = new ArrayList<>();
        Map<String,Object> dis1 = new HashMap<>();
        dis1.put("code","1");
        dis1.put("name","糖尿病");
        dis1.put("name","高血压");
        Map<String,Object> dis2 = new HashMap<>();
        dis2.put("code","2");
        dis2.put("name","高血压");
        dis2.put("name","糖尿病");
        diseases.add(dis1);
        diseases.add(dis2);
        rs.put("diseases",diseases);
@ -112,6 +108,7 @@ public class PrescriptionInfoService extends BaseService {
                    sqlBuffer.append(" AND p.create_time <= ?");
                    params.add(endDate+" 23:59:59");
                }
                sqlBuffer.append(" ORDER BY p.create_time DESC ");
                if(page!=null&&page>0&&size!=null&&size>0){
                    sqlBuffer.append(" LIMIT "+(page-1)*size+","+size);
                }
@ -137,13 +134,23 @@ public class PrescriptionInfoService extends BaseService {
    public JSONObject getContinuedPrescription(String code){
        Prescription prescription = prescriptionDao.findByCode(code);
        List<PrescriptionInfo> prescriptionInfos = prescriptionInfoDao.findByPrescriptionCode(code);
        PrescriptionReviewed reviewed =  prescriptionReviewedDao.findByPrescriptionCode(code);
        JSONObject rs = new JSONObject();
        rs.put("prescription",prescription);
        rs.put("prescriptionInfos",prescriptionInfos);
        rs.put("reviewed",reviewed);
        if(prescription!=null&&StringUtils.isNotBlank(prescription.getDoctor())){
            rs.put("doctor",doctorDao.findByCode(prescription.getDoctor()));
            Doctor doctor = doctorDao.findByCode(prescription.getDoctor());
            if(doctor.getCertifiedOvertime()!=null &&(new Date().before(doctor.getCertifiedOvertime()))){
                rs.put("isCertified",true);
                rs.put("doctorName",doctor.getName());
            }else{
                rs.put("isCertified",false);
                rs.put("doctorName",doctor.getName());
            }
        }else{
            rs.put("doctor","");
            rs.put("isCertified",false);
            rs.put("doctorName","");
        }
        return rs;
    }
@ -160,6 +167,7 @@ public class PrescriptionInfoService extends BaseService {
    public JSONObject  getPrescriptionProcess(String code){
        Prescription prescription = prescriptionDao.findByCode(code);
        List<PrescriptionInfo> prescriptionInfos = prescriptionInfoDao.findByPrescriptionCode(code);
        PrescriptionReviewed reviewed =  prescriptionReviewedDao.findByPrescriptionCode(code);
        JSONObject rs = new JSONObject();
        if(prescription!=null&&StringUtils.isNotBlank(prescription.getPatient())){
            Patient p = patientDao.findByCode(prescription.getPatient());
@ -167,16 +175,18 @@ public class PrescriptionInfoService extends BaseService {
        }else{
            rs.put("patient","");
        }
        if(prescription.getStatus()==10){
            Long s = (prescription.getCreateTime().getTime()-new Date().getTime())/1000;
            rs.put("time",s);
            if(s>172800){
                prescription.setStatus(-3);
                prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.pay_outtime.getValue());
                prescriptionDao.save(prescription);
            }
        }else{
            rs.put("time","");
        }
        rs.put("reviewed",reviewed);
        rs.put("prescription",prescription);
        rs.put("prescriptionInfos",prescriptionInfos);
        return rs;
@ -189,12 +199,12 @@ public class PrescriptionInfoService extends BaseService {
     */
    public int cancelPrescriotion(String code){
        Prescription p = prescriptionDao.findByCode(code);
        p.setStatus(-2);
        p.setStatus(PrescriptionLog.PrescriptionLogStatus.patient_canel.getValue());
        prescriptionDao.save(p);
        //患者操作日志
        PrescriptionLog log = new PrescriptionLog();
        log.setCode(getCode());
        log.setStatus(-2);
        log.setStatus(PrescriptionLog.PrescriptionLogStatus.patient_canel.getValue());
        log.setType(-1);
        log.setCreateTime(new Date());
        log.setPrescriptionCode(p.getCode());
@ -217,7 +227,7 @@ public class PrescriptionInfoService extends BaseService {
    }
    public JSONArray getDoctorPrescription(Integer teamCode,String state,String diseases,String startDate,String endDate,String nameKeyword,Integer page,Integer size){
    public JSONArray getDoctorPrescription(Integer teamCode,String state,String diseases,String startDate,String endDate,String nameKeyword,String patient,Integer page,Integer size){
        StringBuffer pre_sql = new StringBuffer("SELECT " +
                " p.`name`, " +
                " TIMESTAMPDIFF(YEAR,p.birthday,SYSDATE()) age, " +
@ -239,12 +249,12 @@ public class PrescriptionInfoService extends BaseService {
                    " AND pr.admin_team_id =? AND s.code = ?");
            params.add(teamCode);
            params.add(diseases);
            setSQL(pre_sql,params,state,startDate,endDate,nameKeyword,page,size);
            setSQL(pre_sql,params,state,startDate,endDate,nameKeyword,patient,page,size);
        }else{
            //查询所有疾病类型表
            pre_sql.append(" WHERE pr.admin_team_id =?");
            params.add(teamCode);
            setSQL(pre_sql,params,state,startDate,endDate,nameKeyword,page,size);
            setSQL(pre_sql,params,state,startDate,endDate,nameKeyword,patient,page,size);
        }
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(pre_sql.toString(),params.toArray());
@ -257,23 +267,26 @@ public class PrescriptionInfoService extends BaseService {
        return new JSONArray(rs);
    }
    public void setSQL(StringBuffer pre_sql,List<Object> params,String state,String startDate,String endDate,String nameKeyword,Integer page,Integer size){
    public void setSQL(StringBuffer pre_sql,List<Object> params,String state,String startDate,String endDate,String nameKeyword,String patient,Integer page,Integer size){
        if(StringUtils.isNotBlank(state)){
            pre_sql.append(" AND pr.status = ?");
            params.add(state);
            pre_sql.append(" AND pr.status IN ("+state+") ");
        }
        if(StringUtils.isNotBlank(startDate)){
            pre_sql.append(" AND pr.create_time >= ?");
            pre_sql.append(" AND pr.create_time >= ? ");
            params.add(startDate);
        }
        if(StringUtils.isNotBlank(endDate)){
            pre_sql.append(" AND pr.create_time <= ?");
            pre_sql.append(" AND pr.create_time <= ? ");
            params.add(endDate);
        }
        if(StringUtils.isNotBlank(nameKeyword)){
            pre_sql.append(" AND pr.patient_name like ?");
            pre_sql.append(" AND pr.patient_name like ? ");
            params.add("%"+nameKeyword+"%");
        }
        if(StringUtils.isNotBlank(patient)){
            pre_sql.append(" AND pr.patient = ?");
            params.add(patient);
        }
        pre_sql.append(" GROUP BY pr.code ORDER BY pr.create_time DESC");
        if(page!=null&&page>0&&size!=null&&size>0){
            pre_sql.append(" LIMIT "+(page-1)*size+","+size);
@ -288,29 +301,56 @@ public class PrescriptionInfoService extends BaseService {
    public JSONObject getContinuedPrescriptionAsDoctor(String code){
        Prescription prescription = prescriptionDao.findByCode(code);
        List<PrescriptionInfo> prescriptionInfos = prescriptionInfoDao.findByPrescriptionCode(code);
        PrescriptionReviewed reviewed  = prescriptionReviewedDao.findByPrescriptionCode(code);
        JSONObject rs = new JSONObject();
        rs.put("prescription",prescription);
        rs.put("prescriptionInfos",prescriptionInfos);
        rs.put("reviewed",reviewed);
        if(prescription!=null&&StringUtils.isNotBlank(prescription.getDoctor())){
            rs.put("doctor",doctorDao.findByCode(prescription.getDoctor()));
        }else{
            rs.put("doctor","");
        }
        if(prescription!=null&&StringUtils.isNotBlank(prescription.getPatient())){
            rs.put("patient",patientDao.findByCode(prescription.getPatient()));
        }else{
            rs.put("patient","");
        }
        return rs;
    }
    public int reviewPrescription(String code ,String reason,String state){
        if(StringUtils.isNotBlank(state)){
            Prescription p = prescriptionDao.findByCode(code);
           //更新审核记录
            PrescriptionReviewed reviewed = prescriptionReviewedDao.findByPrescriptionCode(code);
//            PrescriptionReviewed reviewed = new PrescriptionReviewed();
//            reviewed.setCode(getCode());
//            reviewed.setPrescriptionCode(code);
//            reviewed.setCreateTime(new Date());
//            reviewed.setRemark("医生审核");
//            reviewed.setDoctor(p.getDoctor());
//            reviewed.setDoctorName(p.getDoctorName());
//            reviewed.setHospital(p.getHospital());
//            reviewed.setHospitalName(p.getHospitalName());
//            reviewed.setDept(p.getDept());
//            reviewed.setDeptName(p.getDeptName());
            if("1".equals(state)){
                //审核通过
                p.setStatus(10);
                p.setStatus(PrescriptionLog.PrescriptionLogStatus.reviewed_success.getValue());
                p.setReviewedTime(new Date());
                reviewed.setReviewedTime(new Date());
                reviewed.setStatus(PrescriptionReviewed.PrescriptionReviewedStatus.reviewed_success.getValue());
            }else{
                //审核不通过
                p.setStatus(-1);
                p.setStatus(PrescriptionLog.PrescriptionLogStatus.no_reviewed.getValue());
                p.setReviewedTime(new Date());
                reviewed.setReason(reason);
                reviewed.setReviewedTime(new Date());
                reviewed.setStatus(PrescriptionReviewed.PrescriptionReviewedStatus.del.getValue());
            }
            prescriptionReviewedDao.save(reviewed);
            prescriptionDao.save(p);
            //医生操作日志
@ -409,4 +449,11 @@ public class PrescriptionInfoService extends BaseService {
    public String upload(){
     return null;
    }
    public JSONArray getDrugTimes(){
        List<SystemDict> list = systemDictDao.findByLikeName("%PRES_DRUG_TIME_%");
        return new JSONArray(list);
    }
}

+ 4 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/httplog/LogService.java

@ -22,9 +22,10 @@ public class LogService {
    private SystemDictService systemDictService;
    public String openApiType = "0";
    public String signType = "1";
    public String archiveType = "2";
    public String onepayType = "3";
    public String signType = "1";   //签约
    public String archiveType = "2";    //档案
    public String onepayType = "3"; //医保支付
    public String caType = "4";     //CA认证

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SFUtils.java

@ -66,7 +66,7 @@ public class SFUtils {
    public String getSFOrderFilterXml(String d_address,String sf_code,String orderid,String j_tel,String j_address,String d_tel){
        //head 传入接口接入码
        StringBuilder xml = new StringBuilder("<Request service='OrderFilterService' lang='zh-cn'> <Head>"+sf_code+"</Head><Body>");
        StringBuilder xml = new StringBuilder("<Request service='OrderFilterService' lang='zh-cn'><Head>"+sf_code+"</Head><Body>");
        xml.append("<OrderFilter filter_type='1' ");
        //订单号
@ -113,7 +113,7 @@ public class SFUtils {
     */
    public String postSFOrderService(PrescriptionExpressage sfexpress_obj,String sf_code) {
        //head 传入接口接入码
        StringBuilder xml = new StringBuilder("<Request service='OrderService' lang='zh-cn'> <Head>"+sf_code+"</Head><Body>");
        StringBuilder xml = new StringBuilder("<Request service='OrderService' lang='zh-cn'><Head>"+sf_code+"</Head><Body>");
        xml.append("<Order ");
        //订单号(快递业务号作为订单号"SF开头的为顺丰快递")
        xml.append("orderid='"+sfexpress_obj.getCode()+"' ");
@ -192,7 +192,7 @@ public class SFUtils {
     */
    public String getRoutInfos(PrescriptionExpressage sfexpress_obj, String sf_code) {
        //head 传入接口接入码
        StringBuilder xml = new StringBuilder("<Request service='RouteService' lang='zh-cn'> <Head>"+sf_code+"</Head><Body>");
        StringBuilder xml = new StringBuilder("<Request service='RouteService' lang='zh-cn'><Head>"+sf_code+"</Head><Body>");
        xml.append("<RouteRequest tracking_type='1' method_type='1' ").append("tracking_number='"+sfexpress_obj.getMailno()+"' />");
        xml.append("</Body></Request>");
        return xml.toString();

+ 100 - 34
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -26,9 +26,12 @@ import com.yihu.wlyy.util.*;
import io.swagger.annotations.Api;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.MediaType;
@ -95,6 +98,7 @@ public class DoctorController extends BaseController {
    @Autowired
    private CommonUtil CommonUtil;
    /**
     * 社区医院下医生列表查询接口 没分页
     *
@ -1888,57 +1892,119 @@ public class DoctorController extends BaseController {
        }
    }
    /**
     * 设置审方密码
     * @param password
     * @return
     */
    @RequestMapping(value = "/setCheckPassword", method = RequestMethod.POST)
    @ResponseBody
//    /**
//     * 设置审方密码
//     * @param password
//     * @return
//     */
//    @RequestMapping(value = "/setCheckPassword", method = RequestMethod.POST)
//    @ResponseBody
//    @ObserverRequired
//    public String setCheckPassword(@RequestParam String password){
//
//        try {
//
//            Doctor doctor = doctorInfoService.findDoctorByCode(getUID());
//            if (doctor == null) {
//                return error(-1, "密码设置失败!");
//            }
////            doctorInfoService.setCheckPassword(doctor,password);
//            return write(200, "密码设置成功");
//        }catch (Exception e){
//            error(e);
//            return invalidUserException(e, -1, "密码设置失败");
//        }
//    }
//    /**
//     * 修改审方密码
//     * @param oldPassword
//     * @param newPassword
//     * @return
//     */
//    @ObserverRequired
//    @ResponseBody
//    @RequestMapping(value = "/updateCheckPassword", method = RequestMethod.POST)
//    public String updateCheckPassword(@RequestParam String oldPassword,@RequestParam String newPassword){
//
//        try {
//            Doctor doctor = doctorInfoService.findDoctorByCode(getUID());
//            if (doctor == null) {
//                return error(-1, "修改审方密码失败!");
//            } else {
//                String encodePWD = EncodesUtil.entryptPassword(Encodes.decodeHex(doctor.getCheckSalt()), oldPassword);
//                if (StringUtils.equals(doctor.getCheckPassword(), encodePWD)) {
////                    doctorInfoService.setCheckPassword(doctor,newPassword);
//                    return write(200, "密码设置成功");
//                } else {
//                    return error(-1, "修改失败:审方旧密码错误!");
//                }
//            }
//        } catch (Exception e) {
//            error(e);
//            return invalidUserException(e, -1, "修改失败!");
//        }
//    }
    //获取实名软证书的过期时间
    @ObserverRequired
    public String setCheckPassword(@RequestParam String password){
    @ResponseBody
    @RequestMapping(value = "/getAuthenticationCA", method = RequestMethod.GET)
    public String getAuthenticationCA(){
        try {
            Doctor doctor = doctorInfoService.findDoctorByCode(getRepUID());
            JSONObject data = doctorInfoService.getCAPastDue(doctor.getIdcard());
            return write(200, "获取信息成功!", "data", data);
        }catch (Exception e) {
            error(e);
            return error(-1, "获取信息失败!");
        }
            Doctor doctor = doctorInfoService.findDoctorByCode(getUID());
            if (doctor == null) {
                return error(-1, "密码设置失败!");
    }
    //修改实名软证书调用保护口令
    @ObserverRequired
    @ResponseBody
    @RequestMapping(value = "/updateAuthenticationPassword", method = RequestMethod.POST)
    public String updateAuthenticationPassword(
            @RequestParam(value = "strOldCalledPasswd",required = true) String strOldCalledPasswd,
            @RequestParam(value = "strNewCalledPasswd",required = true) String strNewCalledPasswd){
        try {
            Doctor doctor = doctorInfoService.findDoctorByCode(getRepUID());
            boolean b = doctorInfoService.updateAuthenticationPassword(doctor.getIdcard(),strOldCalledPasswd,strNewCalledPasswd);
            if(b){
                return write(200, "修改密码成功!", "data", b);
            }
            doctorInfoService.setCheckPassword(doctor,password);
            return write(200, "密码设置成功");
        }catch (Exception e){
            return error(-1, "修改密码失败!");
        }catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "密码设置失败");
            return error(-1, "修改密码失败!");
        }
    }
    /**
     * 修改审方密码
     * @param oldPassword
     * @param newPassword
     * @return
     * 请求实名软证书并进行数字签名
     */
    @ObserverRequired
    @ResponseBody
    @RequestMapping(value = "/updateCheckPassword", method = RequestMethod.POST)
    public String updateCheckPassword(@RequestParam String oldPassword,@RequestParam String newPassword){
    @RequestMapping(value = "/requestRealNameSoftCertAndSign", method = RequestMethod.POST)
    public String requestRealNameSoftCertAndSign(
            @RequestParam(value = "strRealNameSoftCertCalledPasswd",required = true) String strRealNameSoftCertCalledPasswd,
            @RequestParam(value = "strOriginalData",required = true) String strOriginalData,
            @RequestParam(value = "srcBusinessStreamNO",required = true) String srcBusinessStreamNO){
        try {
            Doctor doctor = doctorInfoService.findDoctorByCode(getUID());
            if (doctor == null) {
                return error(-1, "修改审方密码失败!");
            } else {
                String encodePWD = EncodesUtil.entryptPassword(Encodes.decodeHex(doctor.getCheckSalt()), oldPassword);
                if (StringUtils.equals(doctor.getCheckPassword(), encodePWD)) {
                    doctorInfoService.setCheckPassword(doctor,newPassword);
                    return write(200, "密码设置成功");
                } else {
                    return error(-1, "修改失败:审方旧密码错误!");
                }
            Doctor doctor = doctorInfoService.findDoctorByCode(getRepUID());
//            JSONObject obj = doctorInfoService.requestRealNameSoftCertAndSign(doctor.getIdcard(),strRealNameSoftCertCalledPasswd,strOriginalData,srcBusinessStreamNO);
            boolean b = doctorInfoService.requestRealNameSoftCertAndSign(doctor.getIdcard(),strRealNameSoftCertCalledPasswd,strOriginalData,srcBusinessStreamNO);
            if(b){
                return write(200, "认证成功!", "data", b);
            }
        } catch (Exception e) {
            return error(-1, "认证失败!");
        }catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "修改失败!");
            return error(-1, "认证失败!");
        }
    }
}

+ 15 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -58,10 +58,11 @@ public class PrescriptionInfoController extends BaseController{
                                        @RequestParam(required = false)@ApiParam(name="startDate",value="开始时间")String startDate,
                                        @RequestParam(required = false)@ApiParam(name="endDate",value="结束时间")String endDate,
                                        @RequestParam(required = false)@ApiParam(name="nameKeyword",value="患者姓名模糊匹配")String nameKeyword,
                                        @RequestParam(required = false)@ApiParam(name="nameKeyword",value="患者姓名模糊匹配")String patient,
                                        @RequestParam(required = false)@ApiParam(name="page",value="起始页")Integer page,
                                        @RequestParam(required = false)@ApiParam(name="size",value="每页条数")Integer size){
        try {
            return write(200, "查询成功!", "data",prescriptionInfoService.getDoctorPrescription(teamCode,state,diseases,startDate,endDate,nameKeyword,page,size));
            return write(200, "查询成功!", "data",prescriptionInfoService.getDoctorPrescription(teamCode,state,diseases,startDate,endDate,nameKeyword,patient,page,size));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -166,7 +167,20 @@ public class PrescriptionInfoController extends BaseController{
            return write(200, "查询成功", "data", jo);
        } catch (Exception e) {
            error(e);
            return error(-1, "获取失败");
        }
    }
    @RequestMapping(value = "/getDrugTimes", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "药品品使用频次字典")
    public String getDrugTimes(){
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getDrugTimes());
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
}

+ 2 - 20
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/express/SFExpressApiController.java

@ -27,14 +27,7 @@ public class SFExpressApiController extends BaseController {
    @Autowired
    private SFExpressService sfexpressService;
    private String successxml = "<Response service=”RoutePushService”><Head>OK</Head></Response>";
    private String errorxml = "<Response service=”RoutePushService”>\n" +
            "\n" +
            "<Head>ERR</Head>\n" +
            "\n" +
            "<ERROR code=\"4001\">系统发生数据错误或运行时异常</ERROR>\n" +
            "\n" +
            "</Response>";
    private String successxml = "<Response service='RoutePushService'><Head>OK</Head></Response>";
    @RequestMapping(value="/routepushservice",method = RequestMethod.POST)
    @ResponseBody
@ -42,26 +35,15 @@ public class SFExpressApiController extends BaseController {
    @ObserverRequired
    public String SFRoutePushService (
            @ApiParam(name="xml", value="入参报文") @RequestParam(value = "xml",required = true) String xml){
        try {
            xml = URLDecoder.decode(xml,"utf-8");
            sfexpressService.SFRoutePushService(xml);
            return successxml;
        }catch (Exception e){
            //日志文件中记录异常信息
            error(e);
            //返回接口异常信息处理结果
            return "<Response service=”RoutePushService”>\n" +
                    "\n" +
                    "<Head>ERR</Head>\n" +
                    "\n" +
                    "<ERROR code=\"-1\">系统发生数据错误或运行时异常</ERROR>\n" +
                    "\n" +
                    "</Response>";
            return "<Response service='RoutePushService'><Head>ERR</Head><ERROR code='-1'>系统发生数据错误或运行时异常</ERROR></Response>";
        }
    }
}

+ 25 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/express/SFExpressController.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.web.patient.express;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.dict.DmExpressagePriceEntity;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressage;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressageLog;
@ -172,4 +173,28 @@ public class SFExpressController extends BaseController {
        }
    }
    @RequestMapping(value = "/getsfexpressprice", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("根据收寄地址获取快递费用")
    public String SFExpressPrice(
//            @ApiParam(name = "j_city", value = "寄方地址(城市),默认为厦门", defaultValue = "厦门")
//            @RequestParam(value = "j_city", required = false) String j_city,
            @ApiParam(name = "d_province", value = "收方地址(省份)")
            @RequestParam(value = "d_province", required = false) String d_province,
            @ApiParam(name = "d_city", value = "收方地址(城市)")
            @RequestParam(value = "d_city", required = false) String d_city){
        try {
            DmExpressagePriceEntity expreprice = sfexpressService.getSFExpressPrice(d_province,d_city);
            return write(200, "查询成功","data",expreprice);
        }catch (Exception e){
            //日志文件中记录异常信息
            error(e);
            //返回接口异常信息处理结果
            return error(-1, "查询失败,"+e.getMessage());
        }
    }
}