Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

yeshijie 4 years ago
parent
commit
56b8e961ea
22 changed files with 1087 additions and 120 deletions
  1. 11 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OauthCaConfigDao.java
  2. 98 13
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  3. 231 15
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/XzyyPrescriptionService.java
  4. 253 44
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java
  5. 17 15
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java
  6. 12 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java
  7. 18 0
      common/common-entity/src/main/java/com/yihu/jw/entity/ca/OauthCaConfigDO.java
  8. 13 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionDO.java
  9. 4 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  10. 4 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/dao/doctor/BaseDoctorDao.java
  11. 46 8
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  12. 3 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthCaConfigSerivce.java
  13. 161 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/XzzxService.java
  14. 26 1
      server/svr-authentication/src/main/resources/application.yml
  15. 79 1
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/XzzxCotroller.java
  16. 21 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  17. 28 4
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  18. 12 8
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationManageController.java
  19. 10 2
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationPlanController.java
  20. 4 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationDetailDao.java
  21. 32 6
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java
  22. 4 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationPlanService.java

+ 11 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OauthCaConfigDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.ca.OauthCaConfigDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2019/12/25.
 */
public interface OauthCaConfigDao extends PagingAndSortingRepository<OauthCaConfigDO, String>, JpaSpecificationExecutor<OauthCaConfigDO> {
}

+ 98 - 13
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -118,6 +118,7 @@ import java.math.BigDecimal;
import java.net.URL;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -140,8 +141,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    @Autowired
    private PrescriptionDao prescriptionDao;
    @Autowired
    private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
    @Autowired
    private PrescriptionExpressageDao prescriptionExpressageDao;
    @Autowired
    private PrescriptionInfoDao prescriptionInfoDao;
@ -258,6 +257,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private PrescriptionSignDao prescriptionSignDao;
    @Autowired
    private EnterpriseService enterpriseService;
    @Autowired
    private PrescriptionDiagnosisDao  prescriptionDiagnosisDao;
    @Autowired
    private XzyyPrescriptionService xzyyPrescriptionService;
@ -1257,10 +1260,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " d.job_title_name AS \"jobTitleName\"," +
                " d.charge_type AS \"chargeType\"," +
                " d.outpatient_type AS \"outpatientType\"," +
                " d.consult_status AS \"consultStatus\"" +
                " d.consult_status AS \"consultStatus\"," +
                " h.dept_code AS \"deptCode\","+
                " h.dept_name AS \"deptName\","+
                " h.org_code AS \"orgCode\","+
                " h.org_name AS \"orgName\","+
                " t.photo AS \"hosptialphoto\""+
                " FROM " +
                " base_doctor d " +
                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
                " left join base_org t on t.id = h.org_code" +
                " WHERE  " +
                " 1=1 and d.del=1 ";
        Map<String, Object> params = new HashedMap();
@ -2172,7 +2181,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param diagnosisJson
     * @return
     */
    public Map<String, Object> makeDiagnosis(String outPatientId,String prescriptionId, String advice, String type, String infoJsons, String diagnosisJson, String inspectionJson, String emrJson) throws Exception {
    public Map<String, Object> makeDiagnosis(String outPatientId,String prescriptionId, String advice, String type, String infoJsons, String diagnosisJson, String inspectionJson, String emrJson,String hisId) throws Exception {
        Map<String, Object> result = new HashedMap();
@ -2190,6 +2199,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            wlyyPrescriptionDO1 = prescriptionDao.findById(prescriptionId);
            prescriptionDO =wlyyPrescriptionDO1.get(0);
        }else{
            if (StringUtils.isNotBlank(hisId)){
                prescriptionDO.setHisId(hisId);
            }
            prescriptionDO.setOutpatientId(outPatientId);
            prescriptionDO.setType(1);
            prescriptionDO.setDept(outpatientDO.getDept());
@ -4292,7 +4304,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        return times;
    }
    /**
     * 医生可接单列表(图文复诊、视频复诊、协同门诊)
     *
@ -4302,7 +4313,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @query_status 0:图文复诊候诊 1:图文复诊抢单列表
     * @dept 部门
     */
    public List<Map<String, Object>> findWaitingRoomOutpatientByDoctor(String doctor, Integer type, Integer query_status, String dept) {
    public List<Map<String, Object>> findWaitingRoomOutpatientByDoctor(String doctor, Integer type, Integer query_status, String dept,String sex,String keyword,String ageGroup) {
        String sql = "SELECT " +
                "room.outpatient_id AS \"id\"," +
@ -4318,6 +4329,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "outpatient.consumer_name as \"consumerName\"," +
                "outpatient.consumer_mobile as \"consumerMobile\", ";
        if ("xm_ykyy_wx".equals(wechatId)) {
            flag =true;
            if(flag){
                sql += "date_format(room.reservation_time ,'yyyy-MM-dd hh24:mi:ss' ) AS \"timedate_format\",";
            }else {
@ -4365,6 +4377,31 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if (StringUtils.isNoneBlank(dept)) {
            sql += " AND outpatient.dept='" + dept + "' ";
        }
        if(StringUtils.isNoneBlank(sex)){
            sql += " AND patient.sex=" + sex + " ";
        }if(StringUtils.isNoneBlank(keyword)){
            sql += " AND patient.name like '%" + keyword + "%' ";
        }
        if(StringUtils.isNoneBlank(ageGroup)){
            String[] age = ageGroup.split(",");
            Calendar nowBegin = Calendar.getInstance();
            Calendar nowEnd = Calendar.getInstance();
            nowBegin.add(Calendar.YEAR,-Integer.parseInt(age[0]));
            nowEnd.add(Calendar.YEAR,-Integer.parseInt(age[1]));
            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
            String beginAge =  sf.format(nowBegin.getTime());
            String endAge =  sf.format(nowEnd.getTime());
            if("xm_ykyy_wx".equals(wechatId)){
                if (flag){
                    sql+=" and patient.birthday > '" + endAge + "' and patient.birthday<'" + beginAge + "'";
                }else {
                    sql+=" and patient.birthday > to_date('" + endAge + "', 'yyyy-mm-dd') and patient.birthday < to_date('" + beginAge + "','yyyy-mm-dd')";
                }
            }else{
                sql+=" and patient.birthday > '" + endAge + "' and patient.birthday<'" + beginAge + "'";
            }
        }
        logger.info("接口名称:findWaitingRoomOutpatientByDoctor-->sql="+sql);
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
@ -7362,6 +7399,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(outpatientDO.getDoctor(), outpatientDO.getHospital());
            List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId, 1);
            List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(prescriptionId, 1);
            List<WlyyPrescriptionDiagnosisDO> prescriptionDiagnosisDOS = prescriptionDiagnosisDao.findByPrescriptionId(prescriptionId,1);
            List<WlyyPrescriptionExpressageDO> expressageDOS = prescriptionExpressageDao.findByOutpatientId(outpatientDO.getId());
            if (wxId.equalsIgnoreCase("xm_zsyy_wx")) {
@ -7452,18 +7490,45 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }else if (wxId.equalsIgnoreCase("xm_xzzx_wx")){
                try {
                    if (prescriptionDiagnosisDOS!=null&&prescriptionDiagnosisDOS.size()!=0){
                        String diagnosisName = prescriptionDiagnosisDOS.get(0).getName();
                        String diagnosisCode = prescriptionDiagnosisDOS.get(0).getCode();
                        //同步诊断
                        com.alibaba.fastjson.JSONObject jsonObject2 = xzzxEntranceService.saveDiagnosisToEntrance(outpatientDO.getRegisterNo(),diagnosisName,diagnosisCode);
                        logger.info("上传诊断返回参数"+jsonObject2);
                        //{"msg":"交易成功","code":"0","data":{"PresDetail":{"PresNo":"16151365"}},"success":"True"}
                        if (jsonObject2!=null){
                            if (jsonObject2.getString("code").equalsIgnoreCase("0")){
                                com.alibaba.fastjson.JSONObject jsonObject = jsonObject2.getJSONObject("data");
                                logger.info("上传诊断成功"+jsonObject2);
                            }
                        }
                    }
                    //同步处方
                    String applyDoctor = doctorMappingDO.getDoctorName()+"/"+doctorMappingDO.getMappingCode();
                    com.alibaba.fastjson.JSONObject object = xzzxEntranceService.savePrescriptionToEntrance("0",outpatientDO.getCardNo(),outpatientDO.getRegisterNo(),outpatientDO.getDept(),applyDoctor,"50100",infoDOS);
                    logger.info("成功上传处方"+object);
                    //{"msg":"交易成功","code":"0","data":{"PresDetail":{"PresNo":"16151365"}},"success":"True"}
                    if (object.getString("code").equalsIgnoreCase("0")){
                        com.alibaba.fastjson.JSONObject jsonObject = object.getJSONObject("data");
                        com.alibaba.fastjson.JSONObject jsonObject1 = jsonObject.getJSONObject("PresDetail");
                        String realOrder = jsonObject1.getString("PresNo");
                        wlyyPrescriptionDO.setAdmNo(outpatientDO.getAdmNo());
                        wlyyPrescriptionDO.setSerialNo(outpatientDO.getAdmNo());
                        wlyyPrescriptionDO.setRealOrder(realOrder);
                    if (object!=null){
                        if (object.getString("code").equalsIgnoreCase("0")){
                            com.alibaba.fastjson.JSONObject jsonObject = object.getJSONObject("data");
                            com.alibaba.fastjson.JSONObject jsonObject1 = jsonObject.getJSONObject("PresDetail");
                            String realOrder = jsonObject1.getString("PresNo");
                            wlyyPrescriptionDO.setAdmNo(outpatientDO.getAdmNo());
                            wlyyPrescriptionDO.setSerialNo(outpatientDO.getAdmNo());
                            wlyyPrescriptionDO.setRealOrder(realOrder);
                        }
                    }
                    logger.info("进入处方签名");
                    //处方签名
                    xzyyPrescriptionService.SOF_SignDataWithExtraInfo(wlyyPrescriptionDO);
                    //同步电子病历
                    WlyyPrescriptionEmrDO prescriptionEmrDO = prescriptionEmrDao.findEmrByPrescriptionId(prescriptionId);
                    if (prescriptionEmrDO != null) {
                        logger.info("电子病历签名");
                        xzyyPrescriptionService.SOF_SignDataWithExtraInfoEmr(wlyyPrescriptionDO);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
@ -8591,4 +8656,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public void updateHisStatusByOutpatientId(String outpatientId){
        outpatientDao.updateHisStatusById(outpatientId,1);
    }
    //更新患者的诊断记录
    public Envelop updatePatientDiagnosis(String outpatiendId,String icd10,String icd10Name){
       WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(outpatiendId);
        Envelop envelop = new Envelop();
       if (null!=wlyyOutpatientDO){
           if(StringUtils.isNotBlank(icd10)){
               wlyyOutpatientDO.setIcd10(icd10);
           }
           if(StringUtils.isNotBlank(icd10Name)){
               wlyyOutpatientDO.setIcd10Name(icd10Name);
           }
           outpatientDao.save(wlyyOutpatientDO);
           envelop.setMessage("添加成功");
           envelop.setStatus(200);
       }else {
           envelop.setMessage("无该患者门诊记录");
           envelop.setStatus(-1);
       }
       return envelop;
    }
}

+ 231 - 15
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/XzyyPrescriptionService.java

@ -4,22 +4,21 @@ package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.ca.OauthCaConfigDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPatientRegisterDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionExpressageDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PatientRegisterDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionExpressageDao;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -58,6 +57,21 @@ public class XzyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    @Autowired
    private PrescriptionExpressageDao prescriptionExpressageDao;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private OauthCaConfigDao oauthCaConfigDao;
    @Autowired
    private PrescriptionInfoDao infoDao;
    @Autowired
    private PrescriptionDiagnosisDao diagnosisDao;
    @Autowired
    private BasePatientDao patientDao;
    @Autowired
    private BaseDoctorDao doctorDao;
    @Autowired
    private PrescriptionEmrDao prescriptionEmrDao;
    /**
     * 挂号接口
@ -112,17 +126,25 @@ public class XzyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        JSONObject res =  xzzxEntranceService.registeredOperate(doctorFlag,outpatientDO.getDept(),patientMappingDO.getMappingCode(),doctorDO.getChargeType(),courierflag);
        JSONObject result = new JSONObject();
        logger.info("挂号结果 res: " + res.toString());
        JSONObject object = res.getJSONObject("returnContents");
        String rsCode = "";
        if (object!=null){
            result.put("@RESULT", "0");
            result.put("@MSG","挂号成功!");
            rsCode = object.getString("registerNo");
        String serialNo = "";
        if (res!=null){
            JSONObject object = res.getJSONObject("returnContents");
            serialNo = object.getString("registerNo");
            if (object!=null){
                result.put("@RESULT", "0");
                result.put("@MSG","挂号成功!");
                rsCode = object.getString("registerNo");
            }
        }else {
            result.put("@RESULT", "-1");
            result.put("@MSG","挂号失败");
        }
        if (StringUtils.isNoneBlank(rsCode)) {
            //存储挂号号
            String serialNo = object.getString("registerNo");
            outpatientDO.setRegisterNo(serialNo);
            outpatientDO.setAdmDate(new Date());
            outpatientDO.setAdmNo(serialNo);
@ -148,7 +170,6 @@ public class XzyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        } else if ("-2".equals(rsCode)) {
            String serialNo = (String) res.get("registerNo");
            outpatientDO.setRegisterNo(serialNo);
            outpatientDO.setAdmDate(new Date());
            outpatientDO.setAdmNo(serialNo);
@ -186,4 +207,199 @@ public class XzyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        wlyyHttpLogDao.save(log);
        return result;
    }
    public JSONObject refundRegisterNo(String outpatientId) throws Exception {
        JSONObject object = new JSONObject();
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
        if(outpatientDO!=null){
            DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(outpatientDO.getDoctor());
            if (StringUtils.isNoneBlank(outpatientDO.getRegisterNo())){
                object = xzzxEntranceService.refundConsultationToEntrance(outpatientDO.getRegisterNo(), outpatientDO.getCardNo());
                logger.info("退号结果 res: " + object.toString());
                if (object!=null&&object.getString("code").equalsIgnoreCase("0")){
                    WlyyPatientRegisterDO wlyyPatientRegisterDO = patientRegisterDao.findByRegisterNo(outpatientDO.getRegisterNo());
                    wlyyPatientRegisterDO.setDel(0);
                    patientRegisterDao.save(wlyyPatientRegisterDO);
                    outpatientDO.setHisStatus(-1);
                    outpatientDao.save(outpatientDO);
                }
                //保存日志
                WlyyHttpLogDO log = new WlyyHttpLogDO();
                log.setCode("refundregisterOutPatient");
                log.setName("退号");
                log.setPatient(outpatientDO.getPatient());
                log.setDoctor(outpatientDO.getDoctor());
                log.setResponse(object.toString());
                log.setRequest("outPatientId=" + outpatientId + "&doctor=" + outpatientDO.getDoctor());
                log.setStatus(object.getString("code"));
                log.setCreateTime(new Date());
                wlyyHttpLogDao.save(log);
            }
        }
        return  object;
    }
    /**
     * 处方签名
     * @param prescriptionDO
     * @throws Exception
     */
    public void SOF_SignDataWithExtraInfo(WlyyPrescriptionDO prescriptionDO) throws Exception {
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
        List<WlyyPrescriptionInfoDO> infoDOS = infoDao.findByPrescriptionId(prescriptionDO.getId(), 1);
        List<WlyyPrescriptionDiagnosisDO> diagnosisDOS = diagnosisDao.findByPrescriptionId(prescriptionDO.getId(),1);
        JSONObject object = new JSONObject();
        object.put("infos",infoDOS);
        object.put("registerSn",outpatientDO.getRegisterNo());
        object.put("diagnosiss",diagnosisDOS);
        JSONObject jsonObject = computeDigestForAlg(object.toJSONString());
        String hashValue = null;
        String hashType = null;
        if (jsonObject.getString("status").equalsIgnoreCase("0")){
            JSONObject data = jsonObject.getJSONObject("data");
            hashValue= data.getString("hashValue");
            hashType = data.getString("hashType");
        }
        BasePatientDO patientDO = patientDao.findById(outpatientDO.getPatient());
        BaseDoctorDO doctorDO = doctorDao.findById(outpatientDO.getDoctor());
        if (patientDO!=null&&doctorDO!=null){
            String patientName = patientDO.getName();
            Integer patientAge = IdCardUtil.getAgeForIdcard(patientDO.getIdcard());
            String patientSex = IdCardUtil.getSexForIdcard(patientDO.getIdcard());
            String recipeTime = DateUtil.dateToStrLong(prescriptionDO.getCreateTime());
            String openId = doctorDO.getOpenid();
            String idcard = patientDO.getIdcard();
            if (hashType!=null&&hashValue!=null){
                JSONObject object1 = synRecipeInfo("hash_004",getCode(),patientName,patientAge.toString(),patientSex,"SF",recipeTime,hashValue,hashType,openId,idcard);
                if (object1.getString("status").equalsIgnoreCase("0")){
                    logger.info("西药处方签名成功"+object1);
                }
            }
        }
    }
    /**
     * 处方签名
     * @param prescriptionDO
     * @throws Exception
     */
    public void SOF_SignDataWithExtraInfoEmr(WlyyPrescriptionDO prescriptionDO) throws Exception {
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
        WlyyPrescriptionEmrDO prescriptionEmrDO = prescriptionEmrDao.findEmrByPrescriptionId(prescriptionDO.getId());
        JSONObject object = new JSONObject();
        object.put("emr",prescriptionEmrDO);
        object.put("registerSn",outpatientDO.getRegisterNo());
        object.put("doctorName",outpatientDO.getDoctorName());
        object.put("patientName",outpatientDO.getPatientName());
        JSONObject jsonObject = computeDigestForAlg(object.toJSONString());
        String hashValue = null;
        String hashType = null;
        if (jsonObject.getString("status").equalsIgnoreCase("0")){
            JSONObject data = jsonObject.getJSONObject("data");
            hashValue= data.getString("hashValue");
            hashType = data.getString("hashType");
        }
        BasePatientDO patientDO = patientDao.findById(outpatientDO.getPatient());
        BaseDoctorDO doctorDO = doctorDao.findById(outpatientDO.getDoctor());
        if (patientDO!=null&&doctorDO!=null){
            String patientName = patientDO.getName();
            Integer patientAge = IdCardUtil.getAgeForIdcard(patientDO.getIdcard());
            String patientSex = IdCardUtil.getSexForIdcard(patientDO.getIdcard());
            String recipeTime = DateUtil.dateToStrLong(prescriptionDO.getCreateTime());
            String openId = doctorDO.getOpenid();
            String idcard = patientDO.getIdcard();
            if (hashType!=null&&hashValue!=null){
                JSONObject object1 = synRecipeInfo("hash_002",getCode(),patientName,patientAge.toString(),patientSex,"SF",recipeTime,hashValue,hashType,openId,idcard);
                if (object1.getString("status").equalsIgnoreCase("0")){
                    logger.info("门诊病历签名成功"+object1);
                }
            }
        }
    }
    /**
     * 数据哈希计算接口
     * @param content
     * @return
     */
    public JSONObject computeDigestForAlg(String content){
        try {
            OauthCaConfigDO oauthCaConfigDO = oauthCaConfigDao.findOne("oauth_ca_config");
            String url = "";
            if (oauthCaConfigDO!=null){
                url=oauthCaConfigDO.getUrl()+"/gateway/common/computeDigestForAlg";
            }
            JSONObject object = new JSONObject();
            object.put("originData",content);
            String response = httpClientUtil.sendPost(url,object.toJSONString());
            logger.info("数据哈希计算接口 :"+response);
            return JSONObject.parseObject(response);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
    /***
     * 数据签名接口
     * @param templateId 模板ID签名数据摘要数据类型
     * @param urId 签名流水ID
     * @param patientName 患者姓名
     * @param patientAge 患者年龄
     * @param patientSex 患者性别
     * @param patientCardType  证件类型
     * @param recipeTime 开具时间
     * @param hashValue Hash原文(从签名指纹接口结果中得到的)
     * @param hashType Hash算法(从签名指纹接口结果中得到的)
     * @return
     */
    public JSONObject synRecipeInfo(String templateId,String urId,String patientName,String patientAge,String patientSex,String patientCardType,String recipeTime,String hashValue,String hashType,String openId,String patientCard){
        try {
            OauthCaConfigDO oauthCaConfigDO = oauthCaConfigDao.findOne("oauth_ca_config");
            String url = "";
            String clientId= "";
            String clientSecret = "";
            if (oauthCaConfigDO!=null){
                url=oauthCaConfigDO.getUrl()+"/gateway/recipe/synRecipeInfo";
                clientId=oauthCaConfigDO.getClientId();
                clientSecret=oauthCaConfigDO.getClientSecret();
            }
            JSONObject object = new JSONObject();
            JSONObject msg = new JSONObject();
            JSONObject head = new JSONObject();
            head.put("clientId",clientId);
            head.put("templateId",templateId);
            head.put("clientSecret",clientSecret);
            head.put("selfSign",true);
            msg.put("head",head);
            JSONObject body = new JSONObject();
            body.put("urId",urId);
            body.put("patientName",patientName);
            body.put("patientAge",patientAge);
            body.put("patientSex",patientSex);
            body.put("patientCardType",patientCardType);
            body.put("recipeTime",recipeTime);
            body.put("hashValue",hashValue);
            body.put("hashType",hashType);
            body.put("patientCard",patientCard);
            body.put("openId",openId);
            msg.put("body",body);
            object.put("msg",msg);
            object.put("signType",0);
            logger.info("请求参数:"+object);
            String response = httpClientUtil.sendPost(url,object.toJSONString());
            logger.info("数据签名接口 :"+response);
            return JSONObject.parseObject(response);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}

+ 253 - 44
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java

@ -113,7 +113,7 @@ public class XzzxEntranceService{
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private PrescriptionCheckDao prescriptionCheckDao;
    private BaseDoctorHospitalDao baseDoctorHospitalDao;
@ -1258,7 +1258,7 @@ public class XzzxEntranceService{
            condition1 += "<DayCount>"+prescriptionInfoDO.getDays()+"</DayCount>";
            condition1 += "<Usage>"+prescriptionInfoDO.getSupplyCode()+"</Usage>";
            condition1 += "<TotalDoseage>"+prescriptionInfoDO.getQuantity()+"</TotalDoseage>";
            condition1 += "<TotalUnit>"+prescriptionInfoDO.getPackQuantity()+prescriptionInfoDO.getUnitName()+"/"+prescriptionInfoDO.getPackUnit()+"</TotalUnit>";
            condition1 += "<TotalUnit>"+prescriptionInfoDO.getPackUnit()+"</TotalUnit>";
            condition1 += "<PrescribeMemo>"+"</PrescribeMemo>";
            condition1 += "<FryMode>"+"</FryMode>";
            condition1 += "<HerbalTakeMethodClass>"+"</HerbalTakeMethodClass>";
@ -1281,6 +1281,152 @@ public class XzzxEntranceService{
        return json;
    }
    /**
     * 互联网医院删除处方信息更新到his
     * @param IoFlag  门诊住院标志
     * @param PayCardNo 就诊卡号
     * @param NullahNumber 挂号流水号
     * @param ApplyDept 执行科室
     * @param ApplyDoctor 开单医生
     * @param ExecuteDept 执行科室(药房)
     * @param PresNo 必填,医嘱号
     * @return
     * @throws Exception
     */
    public String delHisPrescriptionByHisNo(String IoFlag,String PayCardNo,String NullahNumber,
                                             String ApplyDept,String ApplyDoctor,String ExecuteDept,String PresNo)throws Exception{
        String api = "delHisPrescriptionByHisNo";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (!StringUtils.isEmpty(IoFlag)){
            condition += "<IoFlag>"+IoFlag+"</IoFlag>";
        }
        if (!StringUtils.isEmpty(PayCardNo)){
            condition += "<PayCardNo>"+PayCardNo+"</PayCardNo>";
        }
        if (!StringUtils.isEmpty(NullahNumber)){
            condition += "<NullahNumber>"+NullahNumber+"</NullahNumber>";
        }
        if (!StringUtils.isEmpty(ApplyDept)){
            condition += "<ApplyDept>"+ApplyDept+"</ApplyDept>";
        }
        if (!StringUtils.isEmpty(ApplyDoctor)){
            condition += "<ApplyDoctor>"+ApplyDoctor+"</ApplyDoctor>";
        }
        if (!StringUtils.isEmpty(ExecuteDept)){
            condition += "<ExecuteDept>"+ExecuteDept+"</ExecuteDept>";
        }
        if (!StringUtils.isEmpty(PresNo)){
            condition += "<PresNo>"+PresNo+"</PresNo>";
        }
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("delHisPrescriptionByHisNo params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("delHisPrescriptionByHisNo json:"+json);
        return json;
    }
    /**
     * 保存入门诊断信息到his
     * @param ApplyNo
     * @param DiagnosisName
     * @param DiagnosisCode
     * @param ChnSymPtomsCode
     * @param ChnSymPtomsName
     * @param ChnDiagnosisCode
     * @param ChnDiagnosisName
     * @return
     * @throws Exception
     */
    public String saveDiagnosis(String ApplyNo,String DiagnosisName,String DiagnosisCode,
                                             String ChnSymPtomsCode,String ChnSymPtomsName,String ChnDiagnosisCode,String ChnDiagnosisName)throws Exception{
        String api = "saveDiagnosis";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (!StringUtils.isEmpty(ApplyNo)){
            condition += "<ApplyNo>"+ApplyNo+"</ApplyNo>";
        }
        if (!StringUtils.isEmpty(DiagnosisName)){
            condition += "<DiagnosisName>"+DiagnosisName+"</DiagnosisName>";
        }
        if (!StringUtils.isEmpty(DiagnosisCode)){
            condition += "<DiagnosisCode>"+DiagnosisCode+"</DiagnosisCode>";
        }
        condition+="<ChnSymPtomsCode>"+"</ChnSymPtomsCode>";
        condition+="<ChnSymPtomsName>"+"</ChnSymPtomsName>";
        condition+="<ChnDiagnosisCode>"+"</ChnDiagnosisCode>";
        condition+="<ChnDiagnosisName>"+"</ChnDiagnosisName>";
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("saveDiagnosis params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info(" saveDiagnosis json:"+json);
        return json;
    }
    /**
     * 发送退号信息到his
     * @param ApplyNo
     * @return
     * @throws Exception
     */
    public String refundConsultation(String ApplyNo,String PayCardNo)throws Exception{
        String api = "refundConsultation";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (!StringUtils.isEmpty(ApplyNo)){
            condition += "<ApplyNo>"+ApplyNo+"</ApplyNo>";
        }
        if (!StringUtils.isEmpty(PayCardNo)){
            condition += "<PayCardNo>"+PayCardNo+"</PayCardNo>";
        }
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("refundConsultation params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("refundConsultation json:"+json);
        return json;
    }
    /**
     * 组装检查检验项目参数
@ -1362,13 +1508,12 @@ public class XzzxEntranceService{
            for (WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO:infos){
                int i = 1;
                stringBuffer.append("<Advice REPEAT=\"1\" DRUG_LO_NAME=\""+wlyyPrescriptionInfoDO.getDrugName()+
                        "\" DRUG_LO_ID=\""+wlyyPrescriptionInfoDO.getHisCode()+
                        "\" ADMINISTRATION=\""+wlyyPrescriptionInfoDO.getSupplyName()+
                        "\" DRUG_LO_ID=\""+wlyyPrescriptionInfoDO.getHisCode()+"\" ADMINISTRATION=\""+wlyyPrescriptionInfoDO.getSupplyName()+
                        "\" DOSAGE=\""+wlyyPrescriptionInfoDO.getDosage()+
                        "\" DOSAGE_UNIT=\""+wlyyPrescriptionInfoDO.getUnitName()+
                        "\" FREQ_COUNT=\""+wlyyPrescriptionInfoDO.getUsageCode()+
                        "\" FREQ_INTERVAL=\"\" FREQ_INTERVAL_UNIT=\"\" START_DAY=\""+patientAndDoctor.getString("CREATE_DATE")+"\" END_DAY=\"\" DEPT_CODE=\""+patientAndDoctor.getString("DEPT_CODE")+
                        "\" DOCTOR_NAME=\""+patientAndDoctor.getString("DOCTOR_NAME")+
                        "\" FREQ_INTERVAL=\"\" FREQ_INTERVAL_UNIT=\"\" START_DAY=\""+patientAndDoctor.getString("CREATE_DATE")+"\" END_DAY=\"\"" +
                        " DEPT_CODE=\""+patientAndDoctor.getString("DEPT_CODE")+"\" DOCTOR_NAME=\""+patientAndDoctor.getString("DOCTOR_NAME")+
                        "\" ORDER_NO=\""+i+
                        "\" ORDER_SUB_NO=\""+1+"\" AUTHORITY_LEVELS=\"\" ALERT_LEVELS=\"\" TITLE=\""+patientAndDoctor.getString("POSITION") +
                        "\" GROUP_ID=\""+wlyyPrescriptionInfoDO.getFrequency()+"\" USER_ID=\""+patientAndDoctor.getString("doctorId")+
@ -2716,7 +2861,7 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
    /**
     *
     * 保存处方到entrance
     * @param ioFlag 门诊住院标志
     * @param payCardNo 就诊卡号
     * @param nullahNumber 挂号流水号
@ -2754,6 +2899,94 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
        return jsonObject;
    }
    /**
     * 保存诊断到entrance
     * @param applyNo 必填,流水号
     * @param diagnosisName 必填,诊断名称
     * @param diagnosisCode 诊断代码
     * @return
     * @throws Exception
     */
    public JSONObject saveDiagnosisToEntrance(String applyNo,String diagnosisName,String diagnosisCode) throws Exception {
        JSONObject jsonObject = new JSONObject();
        String response = "";
        String url = entranceUrl+"saveDiagnosis";
        ObjectMapper mapper = new ObjectMapper();
        Map<String,String> params = new HashedMap();
        params.put("ApplyNo",applyNo);
        params.put("DiagnosisName",diagnosisName);
        params.put("DiagnosisCode",diagnosisCode);
        logger.info("params"+params.toString());
        response = httpClientUtil.httpPost(url,params);
        logger.info("诊断同步"+response);
        JSONObject object = JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
            jsonObject = object.getJSONObject("obj");
        }
        return jsonObject;
    }
    /**
     * 发送退号信息到entrance
     * @param applyNo 必填,流水号
     * @param payCardNo 必填,卡号
     * @return
     * @throws Exception
     */
    public JSONObject refundConsultationToEntrance(String applyNo,String payCardNo) throws Exception {
        JSONObject jsonObject = new JSONObject();
        String response = "";
        String url = entranceUrl+"refundConsultation";
        ObjectMapper mapper = new ObjectMapper();
        Map<String,String> params = new HashedMap();
        params.put("ApplyNo",applyNo);
        params.put("PayCardNo",payCardNo);
        logger.info("params"+params.toString());
        response = httpClientUtil.httpPost(url,params);
        logger.info("诊断同步"+response);
        JSONObject object = JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
            jsonObject = object.getJSONObject("obj");
        }
        return jsonObject;
    }
    /**
     * 删除处方信息
     * @param realOrder his处方号
     * @return
     * @throws Exception
     */
    public JSONObject deletePrescriptionToEntrance(String realOrder) throws Exception {
        Map<String,String> params = new HashedMap();
        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findByRealOrder(realOrder);
        if (null!=wlyyPrescriptionDO){
            params.put("IoFlag","0");
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
            if (null!=wlyyOutpatientDO){
                params.put("PayCardNo",wlyyOutpatientDO.getCardNo());
                params.put("NullahNumber",wlyyOutpatientDO.getRegisterNo());
                params.put("ApplyDept",wlyyOutpatientDO.getDept());
            }
            DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(wlyyPrescriptionDO.getDoctor());
            if (null!=doctorMappingDO){
                params.put("ApplyDoctor",doctorMappingDO.getMappingCode());
            }
            params.put("ExecuteDept","50100");
            params.put("PresNo",realOrder);
        }
        JSONObject jsonObject = new JSONObject();
        String response = "";
        String url = entranceUrl+"delHisPrescriptionByHisNo";
        logger.info("params"+params.toString());
        response = httpClientUtil.httpPost(url,params);
        logger.info("删除处方信息"+response);
        JSONObject object = JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
            jsonObject = object.getJSONObject("obj");
        }
        return jsonObject;
    }
//=====================hospital应用调用entrance应用============end=================
@ -2947,26 +3180,16 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
        return map;
    }
    //组装审药参数并发送到entrance
    public String checkInputInfo(String prescriptionId,String payType,String doctor,String patient,List<WlyyPrescriptionDiagnosisDO> diagnosisDOS,List<WlyyPrescriptionInfoDO> infos) throws Exception{
    public String checkInputInfo(String hisId,String payType,String doctor,String patient,List<WlyyPrescriptionDiagnosisDO> diagnosisDOS,List<WlyyPrescriptionInfoDO> infos) throws Exception{
        JSONObject jsonObject = initEntranceParam(payType,doctor,patient,diagnosisDOS);
        String tjPrescriptionId = "";
        WlyyPrescriptionCheckDO wlyyPrescriptionCheckDO;
        //如果重新审核药品 一定要把返回的orderNo的值拿到赋值到prescriptionId里
        if (StringUtils.isNotEmpty(prescriptionId)){
            tjPrescriptionId = prescriptionId;
            jsonObject.put("PATIENT_PRES_ID",tjPrescriptionId);
            wlyyPrescriptionCheckDO = prescriptionCheckDao.findOne(tjPrescriptionId);
        if (StringUtils.isNotEmpty(hisId)){
            jsonObject.put("PATIENT_PRES_ID",hisId);
        }else {
            wlyyPrescriptionCheckDO = new WlyyPrescriptionCheckDO();
            tjPrescriptionId = UUID.randomUUID().toString();
            wlyyPrescriptionCheckDO.setId(tjPrescriptionId);
            jsonObject.put("PATIENT_PRES_ID",tjPrescriptionId);
            hisId = UUID.randomUUID().toString();
            jsonObject.put("PATIENT_PRES_ID",hisId);
        }
        wlyyPrescriptionCheckDO.setCreateUser(doctor);
        wlyyPrescriptionCheckDO.setCreateUserName(null==jsonObject.get("DOCTOR_NAME")?"":jsonObject.get("DOCTOR_NAME").toString());
        wlyyPrescriptionCheckDO.setDept(null==jsonObject.get("DEPT_CODE")?"":jsonObject.get("DEPT_CODE").toString());
        wlyyPrescriptionCheckDO.setDeptName(null==jsonObject.get("DEPT_NAME")?"":jsonObject.get("DEPT_NAME").toString());
        if (null!=infos&&infos.size()>0) {
            String response = "";
            String returnJson = "";
@ -2990,10 +3213,9 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
                if (StringUtils.isNotBlank(obj)) {
                    List<Map<String,Object>> returnList = transXmlCommen(obj);
                    Map<String,Object> checkIdMap = new HashMap<>();
                    checkIdMap.put("prescriptionOnly",tjPrescriptionId);
                    checkIdMap.put("prescriptionOnly",hisId);
                    returnList.add(checkIdMap);
                    returnJson = JSONArray.toJSONString(returnList);
                    wlyyPrescriptionCheckDO.setReason(returnJson);
                    logger.info("返回到互联网医院的解析后的结果:"+returnJson);
                    wlyyHttpLogDO.setDoctor(doctor);
                    wlyyHttpLogDO.setCreateTime(new Date());
@ -3002,7 +3224,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
                    wlyyHttpLogDO.setName("checkPrescription");
                } else {
                    returnJson = "审方返回接口为空请检查参数是否正确";
                    wlyyPrescriptionCheckDO.setStatus(1);
                    logger.info(returnJson);
                    wlyyHttpLogDO.setCode("error");
                    wlyyHttpLogDO.setDoctor(doctor);
@ -3013,7 +3234,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
                }
            } else {
                returnJson = "entranceUrl接口调用失败";
                wlyyPrescriptionCheckDO.setStatus(1);
                wlyyHttpLogDO.setCode("error");
                wlyyHttpLogDO.setDoctor(doctor);
                wlyyHttpLogDO.setCreateTime(new Date());
@ -3022,9 +3242,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
                wlyyHttpLogDO.setName("checkPrescription");
            }
            wlyyHttpLogDao.save(wlyyHttpLogDO);
            wlyyPrescriptionCheckDO.setStatus(1);
            prescriptionCheckDao.save(wlyyPrescriptionCheckDO);
            wlyyPrescriptionCheckDO.setReason(returnJson);
            return returnJson;
        }else {
            return "药品信息为空";
@ -3034,12 +3251,10 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
    public String saveCheckInputInfo(String prescriptionId,String payType,String doctor,String patient,List<WlyyPrescriptionDiagnosisDO> diagnosisDOS,List<WlyyPrescriptionInfoDO> infos) throws Exception{
        JSONObject jsonObject = initEntranceParam(payType,doctor,patient,diagnosisDOS);
        String tjPrescriptionId = "";
        WlyyPrescriptionCheckDO wlyyPrescriptionCheckDO = new WlyyPrescriptionCheckDO();
        //如果重新审核药品 一定要把返回的orderNo的值拿到赋值到prescriptionId里
        if (StringUtils.isNotEmpty(prescriptionId)) {
            tjPrescriptionId = prescriptionId;
            jsonObject.put("PATIENT_PRES_ID",tjPrescriptionId);
            wlyyPrescriptionCheckDO = prescriptionCheckDao.findOne(prescriptionId);
        }
        if (null!=infos&&infos.size()>0) {
            String response = "";
@ -3063,7 +3278,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
                System.out.println("obj:"+obj);
                if (StringUtils.isNotBlank(obj)) {
                    returnJson = obj;
                    wlyyPrescriptionCheckDO.setStatus(9);
                    logger.info("返回到互联网医院的解析后的结果:"+returnJson);
                    wlyyHttpLogDO.setDoctor(doctor);
                    wlyyHttpLogDO.setCreateTime(new Date());
@ -3071,10 +3285,9 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
                    wlyyHttpLogDO.setResponse(returnJson);
                    wlyyHttpLogDO.setName("saveCheckPrescription");
                } else {
                    returnJson = "保存成功";
                    wlyyPrescriptionCheckDO.setStatus(10);
                    returnJson = "保存失败";
                    logger.info(returnJson);
                    wlyyHttpLogDO.setCode("success");
                    wlyyHttpLogDO.setCode("failed");
                    wlyyHttpLogDO.setDoctor(doctor);
                    wlyyHttpLogDO.setCreateTime(new Date());
                    wlyyHttpLogDO.setRequest(infos + jsonObject.toString());
@ -3100,11 +3313,9 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
    public String deleteCheckInputInfo(String prescriptionId,String payType,String doctor,String patient,List<WlyyPrescriptionDiagnosisDO> diagnosisDOS) throws Exception{
        JSONObject jsonObject = initEntranceParam(payType,doctor,patient,diagnosisDOS);
        String tjPrescriptionId = "";
        WlyyPrescriptionCheckDO wlyyPrescriptionCheckDO = new WlyyPrescriptionCheckDO();
        //如果重新审核药品 一定要把返回的orderNo的值拿到赋值到prescriptionId里
        if (StringUtils.isNotEmpty(prescriptionId)){
            tjPrescriptionId = prescriptionId;
            wlyyPrescriptionCheckDO = prescriptionCheckDao.findOne(tjPrescriptionId);
            jsonObject.put("PATIENT_PRES_ID",tjPrescriptionId);
        }
        String response = "";
@ -3123,7 +3334,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
            String obj = object.getString("obj");
            System.out.println("obj:"+obj);
            if (StringUtils.isNotBlank(obj)) { ;
                wlyyPrescriptionCheckDO.setStatus(11);
                returnJson = obj;
                logger.info("返回到互联网医院的解析后的结果:"+returnJson);
                wlyyHttpLogDO.setDoctor(doctor);
@ -3134,7 +3344,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
            } else {
                returnJson = "删除成功";
                logger.info(returnJson);
                wlyyPrescriptionCheckDO.setStatus(12);
                wlyyHttpLogDO.setCode("删除成功");
                wlyyHttpLogDO.setDoctor(doctor);
                wlyyHttpLogDO.setCreateTime(new Date());
@ -3144,7 +3353,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
            }
        } else {
            returnJson = "entranceUrl接口调用失败";
            wlyyPrescriptionCheckDO.setStatus(11);
            wlyyHttpLogDO.setCode("error");
            wlyyHttpLogDO.setDoctor(doctor);
            wlyyHttpLogDO.setCreateTime(new Date());
@ -3153,8 +3361,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
            wlyyHttpLogDO.setName("deleteCheckPrescription");
        }
        wlyyHttpLogDao.save(wlyyHttpLogDO);
        prescriptionCheckDao.save(wlyyPrescriptionCheckDO);
        wlyyPrescriptionCheckDO.setReason(returnJson);
        return returnJson;
    }
@ -3163,13 +3369,16 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
        JSONObject jsonObject = new JSONObject();
        //先查询处方获得支付方式
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        List<BaseDoctorHospitalDO> baseDoctorHospitalDO = baseDoctorHospitalDao.findByDoctorCode(doctor);
        BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doctor);
        if (null != doctorMappingDO && null != baseDoctorDO) {
            jsonObject.put("DOCTOR_ID", doctorMappingDO.getMappingCode());
            jsonObject.put("POSITION", baseDoctorDO.getJobTitleName());
            jsonObject.put("DOCTOR_NAME", baseDoctorDO.getName());
            jsonObject.put("DEPT_CODE", baseDoctorDO.getVisitDept());
            jsonObject.put("DEPT_NAME", baseDoctorDO.getVisitDeptName());
            if (null!=baseDoctorHospitalDO&&baseDoctorHospitalDO.size()>0){
                jsonObject.put("DEPT_CODE", baseDoctorHospitalDO.get(0).getDeptCode());
                jsonObject.put("DEPT_NAME", baseDoctorHospitalDO.get(0).getDeptName());
            }
        }
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
        BasePatientDO basePatientDO = patientDao.findById(patient);

+ 17 - 15
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java

@ -641,7 +641,8 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                " a.patient_name AS \"patient_name\", " +
                " a.create_time AS \"create_time\", " +
                " e.content AS \"content\", " +
                " d.idcard AS \"docIdCard\" " +
                " d.idcard AS \"docIdCard\", " +
                " e.relation_code AS \"relationCode\" "+
                "FROM " +
                " base_evaluate_score a " +
                "JOIN base_evaluate e ON a.id = e.relation_code " +
@ -671,11 +672,9 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
            Map<String,Object> info =list.get(i);
            Boolean errorFlag = false;
            JSONObject jb = new JSONObject();
            String interId = "";
            try{
                String interId = "";
                String idCard = info.get("docIdCard") == null ? "0":info.get("docIdCard").toString();
                if( info.get("docIdCard") == null){
                    interId = "0";
@ -685,7 +684,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
//                String[] dept = depToSubject(info.get("dept_code").toString());
                jb.put("id",interId +"_"+ (String)info.get("id"));
                jb.put("id",interId +"_"+ (String)info.get("relationCode"));
                jb.put("id_doctor",interId == null ? "0":interId);
                jb.put("organ_code",orgCode);
                jb.put("organ_name", orgName);
@ -703,16 +702,19 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                logger.error(e.toString());
            }
            if(!errorFlag){
                JSONArray jsonArray = new JSONArray();
                jsonArray.add(jb);
                res = postToInter(token,api, jsonArray,url);
                JSONObject resJson = (JSONObject) JSONObject.parse(res);
                if("200".equals(resJson.get("msg").toString())){
                    success++;
                }else{
                    saveErrorLog(upid,"7",info.get("id").toString(),res,2);
                    error++;
                if (!interId.equalsIgnoreCase("0")&&!interId.equalsIgnoreCase("")){
                    JSONArray jsonArray = new JSONArray();
                    jsonArray.add(jb);
                    res = postToInter(token,api, jsonArray,url);
                    JSONObject resJson = (JSONObject) JSONObject.parse(res);
                    if("200".equals(resJson.get("msg").toString())){
                        success++;
                    }else{
                        saveErrorLog(upid,"7",info.get("id").toString(),res,2);
                        error++;
                    }
                }
            }
        }
        String resInfo = "此次共上传:" + total + "条数据,其中成功 :" + success + "条,上传失败 : " + error + "条。格式错误:"+dataError+"条。";

+ 12 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java

@ -244,6 +244,10 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
     * 上线下线状态
     */
    private String online;//1上线0下线
    /**
     * ca标识
     */
    private Integer caFlag;
    @Column(name = "popularity")
    public Integer getPopularity() {
@ -620,4 +624,12 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
        this.online = online;
    }
    @Column(name = "ca_flag")
    public Integer getCaFlag() {
        return caFlag;
    }
    public void setCaFlag(Integer caFlag) {
        this.caFlag = caFlag;
    }
}

+ 18 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/ca/OauthCaConfigDO.java

@ -14,6 +14,8 @@ public class OauthCaConfigDO extends UuidIdentityEntity {
    private String url;
    private String remark;
    private String clientId;
    private String clientSecret;
    public String getUrl() {
        return url;
@ -30,4 +32,20 @@ public class OauthCaConfigDO extends UuidIdentityEntity {
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getClientId() {
        return clientId;
    }
    public void setClientId(String clientId) {
        this.clientId = clientId;
    }
    public String getClientSecret() {
        return clientSecret;
    }
    public void setClientSecret(String clientSecret) {
        this.clientSecret = clientSecret;
    }
}

+ 13 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionDO.java

@ -273,6 +273,19 @@ public class WlyyPrescriptionDO extends UuidIdentityEntity {
     */
    private String voucherNo;
    /**
     * 处方审方唯一标识
     */
    private String hisId;
    @Column(name = "his_id")
    public String getHisId() {
        return hisId;
    }
    public void setHisId(String hisId) {
        this.hisId = hisId;
    }
    @Column(name = "outpatient_id")
    public String getOutpatientId() {
        return outpatientId;

+ 4 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -410,6 +410,10 @@ public class BaseHospitalRequestMapping {
        public static final String xzzxDeleteCheckInfo = "/xzzxDeleteCheckInfo";
        public static final String findDictByName = "/findDictByName";
        public static final String updatePatientDiagnosis = "/updatePatientDiagnosis";
        //删除his处方信息
        public static final String delHisPrescriptionByHisNo = "/delHisPrescriptionByHisNo";
        public static final String getJcmb="/getJcmb";
        public static final String getJymb="/getJymb";
        public static final String getTcxz="/getTcxz";

+ 4 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/dao/doctor/BaseDoctorDao.java

@ -2,6 +2,7 @@ package com.yihu.jw.security.dao.doctor;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
@ -27,4 +28,7 @@ public interface BaseDoctorDao extends PagingAndSortingRepository<BaseDoctorDO,
    List<BaseDoctorDO> findByMobile(String mobile);
    @Query("from BaseDoctorDO d where  d.del ='1'")
    List<BaseDoctorDO> findByDel();
}

+ 46 - 8
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.login.BaseLoginLogDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.restmodel.ResultStatus;
@ -35,6 +36,7 @@ import org.apache.commons.collections.map.HashedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.*;
import org.springframework.security.authentication.AuthenticationManager;
@ -136,6 +138,10 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    private BasePatientDao basePatientDao;
    @Autowired
    private BaseDoctorDao doctorDao;
    @Value("${wechat.id}")
    private String wechatId;
    @Autowired
    private XzzxService xzzxService;
    @PostConstruct
    private void init() {
@ -925,8 +931,16 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    @RequestMapping(value = "/oauth/getCaQRCode", method = RequestMethod.GET)
    public ObjEnvelop getCaQRCode(){
        logger.info("/oauth/getCaQRCode");
        String sys ="JKZLHLWYLJKGLPT";
        return ObjEnvelop.getSuccess("success", oauthCaConfigSerivce.getQRCode(sys));
        if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
            String sys ="JKZLHLWYLJKGLPT";
            return ObjEnvelop.getSuccess("success", oauthCaConfigSerivce.getQRCode(sys));
        }else if (wechatId.equalsIgnoreCase("xm_xzzx_wx")){
            String sys ="2017070411003376";
            return ObjEnvelop.getSuccess("success", xzzxService.getQRCode(sys));
        }else {
            return ObjEnvelop.getSuccess("success", null);
        }
    }
    /**
@ -942,18 +956,42 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        if (StringUtils.isEmpty(client_id)) {
            throw new InvalidRequestException("client_id is null");
        }
        String username = null;
        String openId= null;
        JSONObject rs = new JSONObject();
        if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
            rs = oauthCaConfigSerivce.getQueryQRCode(qrcode);
            JSONObject data = rs.getJSONObject("data");
            String qrCodeStatus = data.getString("qrCodeStatus");
            if(!"LoginQrCodeBeenScan".equals(qrCodeStatus)){
                return ObjEnvelop.getSuccess("error",rs);
            }
            username = data.getString("userIdCardNum");
        }else if (wechatId.equalsIgnoreCase("xm_xzzx_wx")){
            rs = xzzxService.getTokeninfo(qrcode);
            JSONObject jsonObject = rs.getJSONObject("data");
            logger.info("查询登录信息"+rs);
            String qrCodeStatus = rs.getString("status");
            if(!"0".equals(qrCodeStatus)){
                return ObjEnvelop.getSuccess("error",rs);
            }
            username = jsonObject.getString("userIdcardNum");
            openId = jsonObject.getString("uniqueid");
            jsonObject.put("qrCodeStatus","LoginQrCodeBeenScan");
            rs.put("code",1000);
        }
        JSONObject rs = oauthCaConfigSerivce.getQueryQRCode(qrcode);
        JSONObject data = rs.getJSONObject("data");
        String qrCodeStatus = data.getString("qrCodeStatus");
        if(!"LoginQrCodeBeenScan".equals(qrCodeStatus)){
            return ObjEnvelop.getSuccess("error",rs);
        if (org.apache.commons.lang.StringUtils.isNotBlank(username)){
            BaseDoctorDO doctorDO = doctorDao.findByIdcard(username);
            doctorDO.setOpenid(openId);
            doctorDO.setCaFlag(1);
            doctorDao.save(doctorDO);
        }
        ClientDetails authenticatedClient = clientDetailsService.loadClientByClientId(client_id);
        Map<String, String> parameters = new HashedMap();
        parameters.put("username",data.getString("userIdCardNum"));
        parameters.put("username",username);
        parameters.put("login_type","2");
        parameters.put("grant_type", "ihealthDcotor");

+ 3 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthCaConfigSerivce.java

@ -26,7 +26,8 @@ public class OauthCaConfigSerivce {
    private OauthCaConfigDao oauthCaConfigDao;
    /**
     * 生成二维码
     *
     * 中山生成二维码
     * @param sys
     * @return
     */
@ -44,6 +45,7 @@ public class OauthCaConfigSerivce {
        return null;
    }
    /**
     * 查询二维码授权结果
     * @param qrcode

+ 161 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/service/XzzxService.java

@ -0,0 +1,161 @@
package com.yihu.jw.security.service;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.ca.OauthCaConfigDO;
import com.yihu.jw.security.dao.OauthCaConfigDao;
import com.yihu.jw.security.dao.doctor.BaseDoctorDao;
import com.yihu.jw.security.dao.doctor.BaseDoctorHospitalDao;
import com.yihu.jw.util.http.HttpClientUtil;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * 心脏中心医院
 * Created by wangzhinan on 2020/10/20.
 *
 * @author yeshijie.
 */
@Service
public class XzzxService {
    private Logger logger = LoggerFactory.getLogger(XzzxService.class);
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private OauthCaConfigDao oauthCaConfigDao;
    @Autowired
    private BaseDoctorDao doctorDao;
    @Autowired
    private BaseDoctorHospitalDao doctorHospitalDao;
    /**
     * OAuth登陆-认证请求接口
     * @param sys
     * @return
     */
    public String getQRCode(String sys) {
        try {
            logger.info("生成二维码 getQRCode :"+sys);
            OauthCaConfigDO oauthCaConfigDO = oauthCaConfigDao.findOne("oauth_ca_config");
            String url = "";
            if (oauthCaConfigDO!=null){
                url=oauthCaConfigDO.getUrl()+"/gateway/oauth/authorize?responseType=code&clientId="+sys;
            }
            String response = httpClientUtil.get(url,"utf-8");
            JSONObject rs = new JSONObject();
            JSONObject data = new JSONObject();
            String res = "";
            if (StringUtils.isNotBlank(response)){
                JSONObject object = JSONObject.parseObject(response);
                String status = object.getString("status");
                if (status.equalsIgnoreCase("0")){
                    JSONObject jsonObject = object.getJSONObject("data");
                    String imgBase64 = jsonObject.getString("imgBase64");
                    data.put("resultCode",0);
                    data.put("resultMsg","Success");
                    data.put("qrCodeImg",imgBase64);
                    data.put("qrCode",jsonObject.getString("requestId"));
                    rs.put("code",1000);
                    rs.put("msg","成功");
                    rs.put("data",data);
                }else {
                    rs.put("code",-1);
                    rs.put("msg",object.getString("message"));
                }
            }
            return rs.toJSONString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    /**
     * OAuth登陆-获取用户信息
     * @param requestId
     * @return
     */
    public JSONObject getTokeninfo(String requestId){
        try {
            OauthCaConfigDO oauthCaConfigDO = oauthCaConfigDao.findOne("oauth_ca_config");
            String url = "";
            if (oauthCaConfigDO!=null){
                url=oauthCaConfigDO.getUrl()+"/gateway/oauth/tokeninfo?clientId="+oauthCaConfigDO.getClientId()+"&requestId="+requestId+"";
            }
            String response = httpClientUtil.get(url,"utf-8");
            logger.info("验证二维码 getQueryQRCode :"+response);
            return JSONObject.parseObject(response);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
    public String synDoctorToCa(String clientId,String requestId,String doctorId){
        try {
            OauthCaConfigDO oauthCaConfigDO = oauthCaConfigDao.findOne("oauth_ca_config");
            String url = "";
            if (oauthCaConfigDO!=null){
                url=oauthCaConfigDO.getUrl()+"/gateway/doctor/synDoctor";
            }
            if (StringUtils.isNotBlank(doctorId)){
                BaseDoctorDO doctorDO = doctorDao.findById(doctorId);
                List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(doctorId);
                JSONObject body = new JSONObject();
                JSONObject head = new JSONObject();
                head.put("clientId","2017070411003376");
                head.put("clientSecret","2017070411003360");
                body.put("head",head);
                JSONObject by= new JSONObject();
                by.put("uid",doctorDO.getIdcard());
                by.put("uidCardType","SF");
                by.put("doctorName",doctorDO.getName());
                by.put("phone",doctorDO.getMobile());
                if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
                    by.put("department",doctorHospitalDOS.get(0).getOrgName());
                    by.put("department",doctorHospitalDOS.get(0).getDeptName());
                }
                body.put("body",by);
                String response = httpClientUtil.sendPost(url,body.toJSONString());
                logger.info("同步医生信息"+response);
                return  response;
            }else {
                List<BaseDoctorDO> doctorDOList = doctorDao.findByDel();
                for (BaseDoctorDO doctorDO:doctorDOList){
                    List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(doctorDO.getId());
                    JSONObject body = new JSONObject();
                    JSONObject head = new JSONObject();
                    head.put("clientId","2017070411003376");
                    head.put("clientSecret","2017070411003360");
                    body.put("head",head);
                    JSONObject by= new JSONObject();
                    by.put("uid",doctorDO.getIdcard());
                    by.put("uidCardType","SF");
                    by.put("doctorName",doctorDO.getName());
                    by.put("phone",doctorDO.getMobile());
                    if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
                        by.put("orgName",doctorHospitalDOS.get(0).getOrgName());
                        by.put("department",doctorHospitalDOS.get(0).getDeptName());
                    }
                    body.put("body",by);
                    String response = httpClientUtil.sendPost(url,body.toJSONString());
                    logger.info("同步医生信息"+response);
                }
            }
            return null;
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}

+ 26 - 1
server/svr-authentication/src/main/resources/application.yml

@ -78,6 +78,9 @@ wlyy:
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wechat:
  id: xm_zsyy_wx  # base库中,wx_wechat 的id字段
---
spring:
  profiles: jwtest
@ -104,6 +107,9 @@ testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wechat:
  id: xm_zsyy_wx  # base库中,wx_wechat 的id字段
---
spring:
  profiles: jwOracleTest
@ -141,6 +147,9 @@ testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
---
spring:
  profiles: iottest
@ -167,6 +176,9 @@ testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wechat:
  id: xm_zsyy_wx  # base库中,wx_wechat 的id字段
---
spring:
  profiles: iotyanshi
@ -192,6 +204,8 @@ wlyy:
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wechat:
  id: xm_zsyy_wx  # base库中,wx_wechat 的id字段
---
spring:
  profiles: jwprod
@ -217,6 +231,8 @@ wlyy:
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wechat:
  id: xm_zsyy_wx  # base库中,wx_wechat 的id字段
---
## 心脏中心外网
spring:
@ -243,6 +259,8 @@ wlyy:
testPattern:
  sign: 2
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wechat:
  id: xm_xzzx_wx  # base库中,wx_wechat 的id字段
---
## 卫计委
spring:
@ -269,6 +287,8 @@ wlyy:
testPattern:
  sign: 1
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wechat:
  id: xm_ihealth_wx  # base库中,wx_wechat 的id字段
---
spring:
@ -294,6 +314,8 @@ wlyy:
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
---
@ -320,4 +342,7 @@ wlyy:
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段

+ 79 - 1
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/XzzxCotroller.java

@ -16,7 +16,6 @@ import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -424,6 +423,85 @@ public class XzzxCotroller extends EnvelopRestEndpoint {
        }
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.savePrescriptionToHospital(IoFlag,PayCardNo,NullahNumber,ApplyDept,ApplyDoctor,ExecuteDept,prescriptionInfoDOList));
    }
    /**
     * 删除处方信息
     *
     * @param IoFlag  门诊住院标志
     * @param PayCardNo 就诊卡号
     * @param NullahNumber 挂号流水号
     * @param ApplyDept 执行科室
     * @param ApplyDoctor 开单医生
     * @param ExecuteDept 执行科室(药房)
     */
    @PostMapping(value = "/delHisPrescriptionByHisNo")
    @ApiOperation(value = "删除处方信息", notes = "删除处方信息")
    public ObjEnvelop delHisPrescriptionByHisNo(@ApiParam(name = "IoFlag", value = "门诊住院标志", required = false)
                                                 @RequestParam(value = "IoFlag",required = false)String IoFlag,
                                                 @ApiParam(name = "PayCardNo", value = "就诊卡号", required = false)
                                                 @RequestParam(value = "PayCardNo",required = false)String PayCardNo,
                                                 @ApiParam(name = "NullahNumber", value = "挂号流水号", required = false)
                                                 @RequestParam(value = "NullahNumber",required = false)String NullahNumber,
                                                 @ApiParam(name = "ApplyDept", value = "执行科室", required = false)
                                                 @RequestParam(value = "ApplyDept",required = false)String ApplyDept,
                                                 @ApiParam(name = "ApplyDoctor", value = "开单医生", required = false)
                                                 @RequestParam(value = "ApplyDoctor",required = false)String ApplyDoctor,
                                                 @ApiParam(name = "ExecuteDept", value = "执行科室(药房)", required = false)
                                                 @RequestParam(value = "ExecuteDept",required = false)String ExecuteDept,
                                                 @ApiParam(name = "PresNo", value = "必填,医嘱号", required = false)
                                                 @RequestParam(value = "PresNo",required = false)String PresNo)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.delHisPrescriptionByHisNo(IoFlag,PayCardNo,NullahNumber,ApplyDept,ApplyDoctor,ExecuteDept,PresNo));
    }
    /**
     * 保存入门诊断信息到his
     * @param ApplyNo
     * @param DiagnosisName
     * @param DiagnosisCode
     * @param ChnSymPtomsCode
     * @param ChnSymPtomsName
     * @param ChnDiagnosisCode
     * @param ChnDiagnosisName
     * @return
     * @throws Exception
     */
    @PostMapping(value = "/saveDiagnosis")
    @ApiOperation(value = "保存入门诊断信息到his", notes = "保存入门诊断信息到his")
    public ObjEnvelop saveDiagnosis(@ApiParam(name = "ApplyNo", value = "必填,流水号", required = false)
                                                 @RequestParam(value = "ApplyNo",required = false)String ApplyNo,
                                                 @ApiParam(name = "DiagnosisName", value = "必填,诊断名称", required = false)
                                                 @RequestParam(value = "DiagnosisName",required = false)String DiagnosisName,
                                                 @ApiParam(name = "DiagnosisCode", value = "诊断代码", required = false)
                                                 @RequestParam(value = "DiagnosisCode",required = false)String DiagnosisCode,
                                                 @ApiParam(name = "ChnSymPtomsCode", value = "中医证型代码", required = false)
                                                 @RequestParam(value = "ChnSymPtomsCode",required = false)String ChnSymPtomsCode,
                                                 @ApiParam(name = "ChnSymPtomsName", value = "中医证型", required = false)
                                                 @RequestParam(value = "ChnSymPtomsName",required = false)String ChnSymPtomsName,
                                                 @ApiParam(name = "ChnDiagnosisCode", value = "中医诊断代码", required = false)
                                                 @RequestParam(value = "ChnDiagnosisCode",required = false)String ChnDiagnosisCode,
                                                 @ApiParam(name = "ChnDiagnosisName", value = "中医诊断名称", required = false)
                                                 @RequestParam(value = "ChnDiagnosisName",required = false)String ChnDiagnosisName)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.saveDiagnosis(ApplyNo,DiagnosisName,DiagnosisCode,ChnSymPtomsCode,ChnSymPtomsName,ChnDiagnosisCode,ChnDiagnosisName));
    }
    /**
     * 发送退号信息到his
     * @param ApplyNo
     * @return
     * @throws Exception
     */
    @PostMapping(value = "/refundConsultation")
    @ApiOperation(value = "发送退号信息到his", notes = "发送退号信息到his")
    public ObjEnvelop refundConsultation(@ApiParam(name = "ApplyNo", value = "必填,流水号", required = false)
                                    @RequestParam(value = "ApplyNo",required = false)String ApplyNo,
                                    @ApiParam(name = "PayCardNo", value = "必填,就诊卡号", required = false)
                                    @RequestParam(value = "PayCardNo",required = false)String PayCardNo)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.refundConsultation(ApplyNo,PayCardNo));
    }
    /**
     * 获取检验单据信息
     * @return

+ 21 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -129,8 +129,14 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "query_status", value = "0:图文复诊候诊 1:图文复诊抢单列表")
			@RequestParam(value = "",required = false) Integer query_status,
			@ApiParam(name = "dept", value = "部门")
			@RequestParam(value = "",required = false) String dept){
		return success("请求成功",prescriptionService.findWaitingRoomOutpatientByDoctor(doctor,type,query_status,dept));
			@RequestParam(value = "",required = false) String dept,
			@ApiParam(name = "sex", value = "性别1男2女")
			@RequestParam(value = "sex",required = false) String sex,
			@ApiParam(name = "keyWord", value = "姓名关键字")
			@RequestParam(value = "keyWord",required = false) String keyWord,
			@ApiParam(name = "ageGroup", value = "年龄段")
			@RequestParam(value = "ageGroup",required = false) String ageGroup){
		return success("请求成功",prescriptionService.findWaitingRoomOutpatientByDoctor(doctor,type,query_status,dept,sex,keyWord,ageGroup));
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.findWaitingRoomPatient)
@ -264,6 +270,19 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
				String rsCode = "";
				String mes = "";
				if("xm_xzzx_wx".equals(wxId)){ //心脏中心挂号
					if (demoFlag.equalsIgnoreCase("true")){
						rsCode="0";
						mes="已退号";
					}else {
						JSONObject res = xzyyPrescriptionService.refundRegisterNo(outpatientCode);
						if (res!=null&&res.getString("code").equalsIgnoreCase("0")){
							rsCode = "0";
							mes="已退号";
						}else {
							rsCode = "-1";
							mes=res.getString("msg");
						}
					}
				}else {
					if (demoFlag.equalsIgnoreCase("true")){

+ 28 - 4
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -463,12 +463,14 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                    @ApiParam(name = "emrJson", value = "电子病历")
                                        @RequestParam(value = "emrJson", required = false)String emrJson,
                                    @ApiParam(name = "prescriptionId", value = "处方id")
                                        @RequestParam(value = "prescriptionId", required = false)String prescriptionId)throws Exception {
        Map<String,Object> result = prescriptionService.makeDiagnosis(outPatientId,prescriptionId,advice,type,infoJsons,diagnosisJson,inspectionJson,emrJson);
                                        @RequestParam(value = "prescriptionId", required = false)String prescriptionId,
                                    @ApiParam(name = "hisId", value = "审方唯一标识")
                                        @RequestParam(value = "hisId", required = false)String hisId)throws Exception {
        Map<String,Object> result = prescriptionService.makeDiagnosis(outPatientId,prescriptionId,advice,type,infoJsons,diagnosisJson,inspectionJson,emrJson,hisId);
        try {
            
            com.alibaba.fastjson.JSONObject msgObj = new com.alibaba.fastjson.JSONObject();
            
            List<WlyyPrescriptionDiagnosisDO> diagnosisDOs = (List<WlyyPrescriptionDiagnosisDO>) com.alibaba.fastjson.JSONArray.parseArray(diagnosisJson, WlyyPrescriptionDiagnosisDO.class);
            String zd_str = "";
            String jl_str = advice;
@ -2168,4 +2170,26 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        }
        return success(xzzxEntranceService.deleteCheckInputInfo(prescriptionOnly,payType,doctor,patient,wlyyPrescriptionDiagnosisDOS));
    }
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.updatePatientDiagnosis)
    @ApiOperation(value = "更新患者诊断记录")
    public Envelop updatePatientDiagnosis(
            @ApiParam(name = "outpatientId", value = "outpatientId")
            @RequestParam(value = "outpatientId",defaultValue = "",required = true) String outpatientId,
            @ApiParam(name = "icd10", value = "诊断码")
            @RequestParam(value = "icd10",defaultValue = "") String icd10,
            @ApiParam(name = "icd10Name", value = "诊断名称")
            @RequestParam(value = "icd10Name",defaultValue = "") String icd10Name) throws Exception {
        return prescriptionService.updatePatientDiagnosis(outpatientId,icd10,icd10Name);
    }
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.delHisPrescriptionByHisNo)
    @ApiOperation(value = "删除his处方信息")
    public ObjEnvelop delHisPrescriptionByHisNo(
            @ApiParam(name = "realOrder", value = "realOrder")
            @RequestParam(value = "realOrder",defaultValue = "",required = true) String realOrder) throws Exception {
        ObjEnvelop objEnvelop = new ObjEnvelop();
        objEnvelop.setObj(xzzxEntranceService.deletePrescriptionToEntrance(realOrder));
        return objEnvelop;
    }
}

+ 12 - 8
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationManageController.java

@ -80,16 +80,18 @@ public class RehabilitationManageController {
                                          @RequestParam(value = "executeStartTime", required = false)String executeStartTime,
                                          @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)")
                                          @RequestParam(value = "executeEndTime", required = false)String executeEndTime,
                                          @ApiParam(name = "planId", value = "计划id", required = true)
                                          @ApiParam(name = "planId", value = "计划id,多个计划逗号隔开", required = true)
                                          @RequestParam(value = "planId", required = true)String planId,
                                          @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、健康教育,3、健康指导,4、随访,5、复诊)", required = false)
                                          @ApiParam(name = "searchTask", value = "快速查找任务:(1电话/短信关怀,2康复咨询,3健康监测,4上门服务,5康复指导,6康复随访,7康复复诊)", required = false)
                                          @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                          @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                          @RequestParam(value = "status", required = false)Integer status,
                                          @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)", required = false)
                                          @RequestParam(value = "doctorCode", required = false)String doctorCode){
                                          @RequestParam(value = "doctorCode", required = false)String doctorCode,
                                          @ApiParam(name="taskExecutor",value = "任务执行人:0全部;1我的任务:2他人任务",required = false)
                                          @RequestParam(value = "taskExecutor",required = false,defaultValue = "0")String taskExecutor){
        try {
            return rehabilitationManageService.calendarPlanDetail(executeStartTime,executeEndTime,planId,searchTask,status,doctorCode);
            return rehabilitationManageService.calendarPlanDetail(executeStartTime,executeEndTime,planId,searchTask,status,doctorCode,taskExecutor);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
@ -103,16 +105,18 @@ public class RehabilitationManageController {
                                         @RequestParam(value = "executeStartTime", required = false)String executeStartTime,
                                         @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)")
                                         @RequestParam(value = "executeEndTime", required = false)String executeEndTime,
                                         @ApiParam(name = "planId", value = "计划id", required = true)
                                         @ApiParam(name = "planId", value = "计划id,多个计划逗号隔开", required = true)
                                         @RequestParam(value = "planId", required = true)String planId,
                                         @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、健康教育,3、健康指导,4、随访,5、复诊)")
                                         @ApiParam(name = "searchTask", value = "快速查找任务:(1电话/短信关怀,2康复咨询,3健康监测,4上门服务,5康复指导,6康复随访,7康复复诊)")
                                         @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                         @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)")
                                         @RequestParam(value = "status", required = false)Integer status,
                                         @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)")
                                         @RequestParam(value = "doctorCode", required = false)String doctorCode){
                                         @RequestParam(value = "doctorCode", required = false)String doctorCode,
                                         @ApiParam(name="taskExecutor",value = "任务执行人:0全部;1我的任务:2他人任务",required = false)
                                         @RequestParam(value = "taskExecutor",required = false,defaultValue = "0")String taskExecutor){
        try {
            return rehabilitationManageService.calendarPlanDetailList(planId,searchTask,status,doctorCode,executeStartTime,executeEndTime);
            return rehabilitationManageService.calendarPlanDetailList(planId,searchTask,status,doctorCode,executeStartTime,executeEndTime,taskExecutor);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());

+ 10 - 2
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationPlanController.java

@ -17,6 +17,7 @@ import com.yihu.jw.util.date.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
@ -366,13 +367,20 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
    @PostMapping(value = SpecialistMapping.rehabilitation.updateRehabilitationPlan)
    @ApiOperation(value = "居民康复下转套餐编辑")
    public MixEnvelop updateRehabilitationPlan(@ApiParam(name = "rehabilitationPlan", value = "实体JSON")
                                                      @RequestParam(value = "rehabilitationPlan", required = true)String rehabilitationPlan){
                                               @RequestParam(value = "rehabilitationPlan", required = true)String rehabilitationPlan,
                                               @ApiParam(name = "updateStatus", value = "修改类型:0单个服务的修改(默认),1整个计划修改")
                                               @RequestParam(required = false,defaultValue = "0") String updateStatus){
        try {
            JSONObject json = new JSONObject(rehabilitationPlan);
            String planId = json.getString("planId");
            String hospitalServiceItemId = json.getString("hospitalServiceItemId");
            //删除该服务项目今日之后未完成的计划
            rehabilitationPlanService.deleteDetailByPlanIdAndHospitalServiceItemId(planId, hospitalServiceItemId, DateUtil.getDateShort(new Date()));
            if(StringUtils.isBlank(updateStatus)||updateStatus.equals("0")){//单个服务的修改
                rehabilitationPlanService.deleteDetailByPlanIdAndHospitalServiceItemId(planId, hospitalServiceItemId, DateUtil.getDateShort(new Date()));
            }
            else{
                rehabilitationPlanService.deleteDetailByPlanId(planId, DateUtil.getDateShort(new Date()));
            }
            JSONArray array = new JSONArray();
            for(Object planDetail : json.getJSONArray("detail")) {
                String expense="";

+ 4 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationDetailDao.java

@ -84,4 +84,8 @@ public interface RehabilitationDetailDao extends PagingAndSortingRepository<Reha
    @Modifying
    @Query("delete from RehabilitationDetailDO t where t.planId = ?1 and t.hospitalServiceItemId = ?2 and (t.executeTime > ?3 OR t.executeTime is null OR t.executeTime<>'')  and t.status <> 1 ")
    void deleteDetailByPlanIdAndHospitalServiceItemId(String planId, String hospitalServiceItemId, Date dateShort);
    @Modifying
    @Query("delete from RehabilitationDetailDO t where t.planId = ?1 and (t.executeTime > ?2 OR t.executeTime is null OR t.executeTime<>'')  and t.status <> 1 ")
    void deleteDetailByPlanId(String planId, Date dateShort);
}

+ 32 - 6
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

@ -346,11 +346,18 @@ public class RehabilitationManageService {
     * @param searchTask 快速查找任务(1、我的任务,2、随访,3、复诊,4、健康教育)
     * @param status 任务状态(0未完成,1已完成,2已预约)
     * @param doctorCode 登陆医生
     * @param taskExecutor 任务执行者 0全部;1我的任务 2他人任务
     */
    public ObjEnvelop calendarPlanDetail(String executeStartTime,String executeEndTime,String planId,Integer searchTask,Integer status,String doctorCode) throws Exception{
    public ObjEnvelop calendarPlanDetail(String executeStartTime,String executeEndTime,String planId,Integer searchTask,Integer status,String doctorCode,String taskExecutor) throws Exception{
        String[] planIdlist = planId.split(",");
        StringBuilder planCondition = new StringBuilder();
        planCondition .append("'"+planIdlist[0]+"'");
        for (int i=1;i<planIdlist.length;i++){
            planCondition .append(",'"+planIdlist[i]+"'");
        }
        String sql = " select d.* from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_rehabilitation_service_item i on i.code = d.hospital_service_item_id " +
                " where  d.plan_id='"+planId+"' " ;
                " where  d.plan_id in ("+planCondition+") " ;
        if(StringUtils.isNotBlank(executeStartTime)){
            sql += " and d.execute_time>='"+executeStartTime+"' ";
        }
@ -364,6 +371,12 @@ public class RehabilitationManageService {
                sql+=" and i.code="+searchTask+" " ;
            }
        }
        if(taskExecutor.equals("1")){ //我的任务
            sql+="and d.doctor='"+doctorCode+"' ";
        }
        if(taskExecutor.equals("2")){//他人任务
            sql+="and d.doctor <>'"+doctorCode+"' ";
        }
        if(status!=null){
            sql+= " and d.status="+status;
        }
@ -477,14 +490,21 @@ public class RehabilitationManageService {
     * @param searchTask 快速查找任务(1、我的任务,2、随访,3、复诊,4、健康教育)
     * @param status 任务状态(0未完成,1已完成,2已预约)
     * @param doctorCode 登陆医生
     * @param taskExecutor 任务执行者 0全部;1我的任务 2他人任务
     */
    public ObjEnvelop calendarPlanDetailList(String planId,Integer searchTask,Integer status,String doctorCode,String executeStartTime,String executeEndTime){
    public ObjEnvelop calendarPlanDetailList(String planId,Integer searchTask,Integer status,String doctorCode,String executeStartTime,String executeEndTime,String taskExecutor){
        String[] planIdlist = planId.split(",");
        StringBuilder planCondition = new StringBuilder();
        planCondition .append("'"+planIdlist[0]+"'");
        for (int i=1;i<planIdlist.length;i++){
            planCondition .append(",'"+planIdlist[i]+"'");
        }
        String sql = " select d.*,DATE_FORMAT(d.execute_time,'%Y/%m/%d %H:%i') as executeTime ,i.code,i.name from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_rehabilitation_service_item i on i.code = d.hospital_service_item_id  " +
                " where  d.plan_id='"+planId+"' AND  d.execute_time IS NOT NULL  and d.execute_time <>'' " ;
                " where  d.plan_id in ("+planCondition+" )AND  d.execute_time IS NOT NULL  and d.execute_time <>'' " ;
        if(searchTask!=null){
            if(searchTask==8){
            if(searchTask==8){//
                sql+="and d.doctor='"+doctorCode+"' ";
            }else {
                sql+=" and i.code="+searchTask+" " ;
@ -492,6 +512,12 @@ public class RehabilitationManageService {
                sql+=" and i.reserve=1 " ;
            }*/
        }
        if(taskExecutor.equals("1")){ //我的任务
            sql+="and d.doctor='"+doctorCode+"' ";
        }
        if(taskExecutor.equals("2")){//他人任务
            sql+="and d.doctor <>'"+doctorCode+"' ";
        }
        if (StringUtils.isNoneBlank(executeEndTime)&&StringUtils.isNoneBlank(executeStartTime)){
            sql+="and d.execute_time>='"+executeStartTime+"' and d.execute_time<='"+executeEndTime+"' ";
        }
@ -1217,7 +1243,7 @@ public class RehabilitationManageService {
    public ObjEnvelop appCalendarPlanDetailList(String planId,Integer searchTask,Integer status,String executeStartTime,String executeEndTime){
        Map<String,Object> resultMap = new HashMap<>();
        ObjEnvelop objEnvelop = calendarPlanDetailList(planId,searchTask,status,null,executeStartTime,executeEndTime);
        ObjEnvelop objEnvelop = calendarPlanDetailList(planId,searchTask,status,null,executeStartTime,executeEndTime,"0");
        Integer finishCount = rehabilitationDetailDao.findByStatusAndPlanId(1,planId);
        Integer allCount = rehabilitationDetailDao.findAllByPlanId(planId);
        resultMap.put("planDetailList",objEnvelop.getObj());

+ 4 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationPlanService.java

@ -476,4 +476,8 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
    public void deleteDetailByPlanIdAndHospitalServiceItemId(String planId, String hospitalServiceItemId, Date dateShort) {
        rehabilitationDetailDao.deleteDetailByPlanIdAndHospitalServiceItemId(planId, hospitalServiceItemId, dateShort);
    }
    public void deleteDetailByPlanId(String planId, Date dateShort) {
        rehabilitationDetailDao.deleteDetailByPlanId(planId, dateShort);
    }
}