12 Commits c0b4705ede ... b2e884a77a

Auteur SHA1 Bericht Datum
  liubing b2e884a77a Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev 2 jaren geleden
  liubing aa37049c8a 11 2 jaren geleden
  wangzhinan c75e9d9259 海沧医保接口 2 jaren geleden
  wangzhinan 8c7b801df5 Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev 2 jaren geleden
  wangzhinan 436b0fc3fd 海沧医保接口 2 jaren geleden
  wangzhinan b62b711c05 海沧医保接口 2 jaren geleden
  liubing a0303ca8e5 Merge branch 'dev' of liubing/wlyy2.0 into dev 2 jaren geleden
  wangzhinan af519fc6a1 海沧医保接口 2 jaren geleden
  wangzhinan e5287b7c23 海沧医保接口 2 jaren geleden
  wangzhinan 9a9735034a Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev 2 jaren geleden
  wangzhinan f3b0fbde89 海沧医保接口 2 jaren geleden
  wangzhinan 8f7ebcdc7c 海沧医保接口 2 jaren geleden
25 gewijzigde bestanden met toevoegingen van 469 en 119 verwijderingen
  1. 85 29
      business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorInfoService.java
  2. 3 0
      business/base-service/src/main/java/com/yihu/jw/hospital/dict/WlyyChargeDictDao.java
  3. 1 0
      business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseUserMsgService.java
  4. 28 3
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/HcyyPrescriptionService.java
  5. 6 3
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionExpressageService.java
  6. 62 40
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  7. 27 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  8. 2 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/HcyyEntranceService.java
  9. 56 21
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  10. 8 3
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  11. 6 1
      common/common-entity/sql/sql记录
  12. 14 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java
  13. 14 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/dict/WlyyChargeDictDO.java
  14. 20 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyOutpatientDO.java
  15. 5 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/DoctorServiceEndPoint.java
  16. 2 2
      svr/svr-internet-hospital/pom.xml
  17. 5 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/config/DoctorServiceEndPoint.java
  18. 1 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  19. 1 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java
  20. 6 7
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  21. 4 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  22. 12 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/QrcodeService.java
  23. 1 1
      svr/svr-internet-hospital/src/main/resources/bootstrap.yml
  24. 23 0
      svr/svr-iot/src/main/java/com/yihu/iot/controller/third/ThirdDataInputController.java
  25. 77 0
      svr/svr-iot/src/main/java/com/yihu/iot/datainput/service/DataSearchService.java

+ 85 - 29
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorInfoService.java

@ -80,7 +80,7 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
     * @param page
     * @param pageSize
     */
    public Envelop queryList(String city, String hospital, String status, String name, String type, String typeCode, String dept, int page, int pageSize){
    public Envelop queryList(String city, String hospital, String status,String chargeType,String conditionKey, String name, String type, String typeCode, String dept, int page, int pageSize){
        Map<String,Object> params = new HashedMap();
        String sqlTotal ="SELECT " +
                " COUNT(1) AS \"total\" " +
@ -103,6 +103,15 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
            sqlTotal += " AND a.del =:status";
            params.put("status",status);
        }
        if (StringUtils.isNotBlank(chargeType)){
            sqlTotal += " AND (a.twfz_charge_type=:chargeType or a.spfz_charge_type=:chargeType or a.xtfz_charge_type=:chargeType or a.xgsz_charge_type=:chargeType) ";
            params.put("chargeType",chargeType);
        }
        if (StringUtils.isNotBlank(conditionKey)){
            conditionKey = "%"+conditionKey+"%";
            sqlTotal += " AND (a.name like:conditionKey or a.idcard like:conditionKey or a.mobile like :conditionKey)";
            params.put("conditionKey",conditionKey);
        }
        if (StringUtils.isNotBlank(name)){
            name = "%"+name+"%";
            sqlTotal += " AND (a.name like:name or b.dept_name like:name or c.mapping_code like :name)";
@ -133,6 +142,10 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                " a.NAME AS \"name\", " +
                " a.introduce AS \"introduce\", " +
                " a.expertise AS \"expertise\", " +
                " a.idcard AS \"idcard\", " +
                " a.job_title_code AS \"jobTitleCode\", " +
                " a.mobile AS \"mobile\", " +
                " a.job_title_name AS \"jobTitleName\", " +
                " a.outpatient_type AS \"outpatientType\", " +
                " a.del AS \"del\", " +
                " b.dept_name AS \"deptName\", " +
@ -146,12 +159,14 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                "\tv.req_fee as \"twzxFee\",\n" +
                "\td.req_fee as \"xtzxFee\",\n" +
                "\tg.req_fee as \"jyzxFee\",\n" +
                "\th.req_fee as \"xgszFee\",\n" +
                "\tm.charge_type as \"twfzType\",\n" +
                "\tn.charge_type as \"spfzType\",\n" +
                "\tp.charge_type as \"spzxType\",\n" +
                "\tv.charge_type as \"twzxType\",\n" +
                "\td.charge_type as \"xtzxType\",\n" +
                "\tg.charge_type as \"jyzxType\"\n" +
                "\tg.charge_type as \"jyzxType\",\n" +
                "\th.charge_type as \"xgszType\"\n" +
                " FROM " +
                " base_doctor a " +
                " JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
@ -162,6 +177,7 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                " LEFT JOIN wlyy_charge_dict v ON a.twzx_charge_type = v.charge_type and v.is_del='1'\n" +
                " LEFT JOIN wlyy_charge_dict d ON a.xtfz_charge_type = d.charge_type and d.is_del='1'\n" +
                " LEFT JOIN wlyy_charge_dict g ON a.jyzx_charge_type = g.charge_type and g.is_del='1'\n" +
                " LEFT JOIN wlyy_charge_dict h ON a.xgsz_charge_type = h.charge_type and h.is_del='1'\n" +
                " LEFT JOIN base_doctor_mapping c ON a.id = c.doctor " +
                " WHERE 1=1";
        if (StringUtils.isNotBlank(city)){
@ -173,8 +189,19 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
        if (StringUtils.isNotBlank(status)){
            sql += " AND a.del =:status";
        }
        if (StringUtils.isNotBlank(chargeType)){
            sql += " AND (a.twfz_charge_type=:chargeType or a.spfz_charge_type=:chargeType or a.xtfz_charge_type=:chargeType or a.xgsz_charge_type=:chargeType) ";
            params.put("chargeType",chargeType);
        }
        if (StringUtils.isNotBlank(conditionKey)){
            conditionKey = "%"+conditionKey+"%";
            sql += " AND (a.name like:conditionKey or a.idcard like:conditionKey or a.mobile like :conditionKey)";
            params.put("conditionKey",conditionKey);
        }
        if (StringUtils.isNotBlank(name)){
            name = "%"+name+"%";
            sql += " AND (a.name like:name or b.dept_name like:name or c.mapping_code like:name)";
            params.put("name",name);
        }
        if (StringUtils.isNotBlank(type)){
            sql += " AND a.outpatient_type like:type";
@ -204,6 +231,9 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                " a.id AS \"id\", " +
                " a.NAME AS \"name\", " +
                " a.job_title_name AS \"jobTitleName\", " +
                " a.idcard AS \"idcard\", " +
                " a.job_title_code AS \"jobTitleCode\", " +
                " a.mobile AS \"mobile\", " +
                " a.introduce AS \"introduce\", " +
                " a.expertise AS \"expertise\", " +
                " a.photo AS \"photo\", " +
@ -221,12 +251,14 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                "\tv.req_fee as \"twzxFee\",\n" +
                "\tq.req_fee as \"xtzxFee\",\n" +
                "\tg.req_fee as \"jyzxFee\",\n" +
                "\tk.req_fee as \"xgszFee\",\n" +
                "\tm.charge_type as \"twfzType\",\n" +
                "\tn.charge_type as \"spfzType\",\n" +
                "\tp.charge_type as \"spzxType\",\n" +
                "\tv.charge_type as \"twzxType\",\n" +
                "\tq.charge_type as \"xtzxType\",\n" +
                "\tg.charge_type as \"jyzxType\"\n" +
                "\tg.charge_type as \"jyzxType\",\n" +
                "\tk.charge_type as \"xgszType\"\n" +
                " FROM " +
                " base_doctor a " +
                " LEFT JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
@ -240,6 +272,7 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                " LEFT JOIN wlyy_charge_dict v ON a.twzx_charge_type = v.charge_type and v.is_del='1'\n" +
                " LEFT JOIN wlyy_charge_dict q ON a.xtfz_charge_type = q.charge_type and q.is_del='1'\n" +
                " LEFT JOIN wlyy_charge_dict g ON a.jyzx_charge_type = g.charge_type and g.is_del='1'\n" +
                " LEFT JOIN wlyy_charge_dict k ON a.xgsz_charge_type = k.charge_type and k.is_del='1'\n" +
                " WHERE 1=1 ";
        if(StringUtils.isNotBlank(doctorId)){
            sql+=" AND a.id =:id";
@ -296,17 +329,24 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
    public Boolean update(JSONObject jsonObject)throws Exception{
        //取出数据
        String doctorId = jsonObject.get("doctorId").toString();
        String introduce = jsonObject.get("introduce").toString();
        String expertise = jsonObject.get("expertise").toString();
        String photo = jsonObject.get("photo").toString();
        String outpatientType = jsonObject.get("outpatientType").toString();
        String newSpecialDisease = jsonObject.get("specialDisease").toString();
        String newSpecialDiseaseCode = jsonObject.get("specialDiseaseCode").toString();
        String introduce = jsonObject.get("introduce")!=null?jsonObject.getString("introduce"):null;
        String expertise = jsonObject.get("expertise")!=null?jsonObject.getString("expertise"):null;
        String photo = jsonObject.get("photo")!=null?jsonObject.getString("photo"):null;
        String outpatientType = jsonObject.get("outpatientType")!=null?jsonObject.getString("outpatientType"):null;
        String newSpecialDisease = jsonObject.get("specialDisease")!=null?jsonObject.getString("specialDisease"):null;
        String newSpecialDiseaseCode = jsonObject.get("specialDiseaseCode")!=null?jsonObject.getString("specialDiseaseCode"):null;
        BaseDoctorDO doctorDO = baseDoctorDao.findOne(doctorId);
        if (doctorDO!=null){
            doctorDO.setIntroduce(introduce);
            doctorDO.setExpertise(expertise);
            doctorDO.setPhoto(photo);
            if (StringUtils.isNoneBlank(introduce)){
                doctorDO.setIntroduce(introduce);
            }
            if (StringUtils.isNoneBlank(expertise)){
                doctorDO.setExpertise(expertise);
            }
            if (StringUtils.isNoneBlank(photo)){
                doctorDO.setPhoto(photo);
            }
            if(StringUtils.isNoneBlank(outpatientType)){
                doctorDO.setOutpatientType(outpatientType);
            }else {
@ -360,28 +400,44 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                    doctorDO.setXtfzChargeType(jsonObject.get("XTFZType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("XTFZFee")==null?"":jsonObject.get("XTFZFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("XTFZFee").toString(),doctorDO.getName());
                doctorDO.setXtfzChargeType(chargeType);
            }else {
                if (jsonObject.get("XTFZType")!=null){
                    doctorDO.setXtfzChargeType(jsonObject.get("XTFZType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("XGSZFee")==null?"":jsonObject.get("XGSZFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("XGSZFee").toString(),doctorDO.getName());
                doctorDO.setXgszChargeType(chargeType);
            }else {
                if (jsonObject.get("XGSZType")!=null){
                    doctorDO.setXgszChargeType(jsonObject.get("XGSZType").toString());
                }
            }
        }
        //baseDoctorDao.update(doctorId,introduce,expertise,photo,outpatientType);
        baseDoctorDao.save(doctorDO);
        //删除医生旧专病门诊,保存新专病门诊
        Map<String,Object> params = new HashedMap();
        String sqlTotal ="SELECT " +
                " COUNT(1) AS \"total\" " +
                " FROM " +
                " wlyy_doctor_special_disease a " +
                " WHERE " +
                " 1 = 1";
        sqlTotal += " AND a.doctor_code =:doctorId";
        params.put("doctorId",doctorId);
        Long count = 0L;
        List<Map<String, Object>> total = hibenateUtils.createSQLQuery(sqlTotal, params);
        //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
        count = hibenateUtils.objTransformLong(total.get(0).get("total"));
        if (count > 0){
            specialDiseaseDao.deleteByDoctorCode(doctorId);
        }
        if(StringUtils.isNotBlank(newSpecialDisease) && StringUtils.isNotBlank(newSpecialDiseaseCode)){
            //删除医生旧专病门诊,保存新专病门诊
            Map<String,Object> params = new HashedMap();
            String sqlTotal ="SELECT " +
                    " COUNT(1) AS \"total\" " +
                    " FROM " +
                    " wlyy_doctor_special_disease a " +
                    " WHERE " +
                    " 1 = 1";
            sqlTotal += " AND a.doctor_code =:doctorId";
            params.put("doctorId",doctorId);
            Long count = 0L;
            List<Map<String, Object>> total = hibenateUtils.createSQLQuery(sqlTotal, params);
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            count = hibenateUtils.objTransformLong(total.get(0).get("total"));
            if (count > 0){
                specialDiseaseDao.deleteByDoctorCode(doctorId);
            }
            String[] split = newSpecialDisease.split(",");
            String[] splitCode = newSpecialDiseaseCode.split(",");
            specialDiseaseDao.deleteByDoctorCode(doctorId);

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/dict/WlyyChargeDictDao.java

@ -24,4 +24,7 @@ public interface WlyyChargeDictDao extends PagingAndSortingRepository<WlyyCharge
    @Query("from WlyyChargeDictDO d where d.reqFee = ?1 and d.isDel='1' ")
    WlyyChargeDictDO  findByReqFee(Double reqFee);
    @Query("from WlyyChargeDictDO d where d.code = ?1 and d.isDel='1' ")
    WlyyChargeDictDO  findByCode(String code);
}

+ 1 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseUserMsgService.java

@ -136,6 +136,7 @@ public class BaseUserMsgService extends BaseJpaService<BaseUserMessageDO, BaseUs
                baseUserMessageDO.setStatus(Integer.valueOf(1));
                baseUserMessageDO.setDel(Integer.valueOf(1));
                baseUserMessageDO.setType(type);
                baseUserMessageDO.setIsShow(1);
                baseUserMessageDO.setIsRead(Integer.valueOf(0));
                this.baseUserMessageDao.save(baseUserMessageDO);
                objEnvelop.setStatus(Integer.valueOf(200));

+ 28 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/HcyyPrescriptionService.java

@ -108,6 +108,8 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    public PrescriptionLogDao prescriptionLogDao;
    @Autowired
    public PrescriptionService prescriptionService;
    @Autowired
    public PrescriptionDiagnosisDao prescriptionDiagnosisDao;
@ -487,7 +489,7 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
     */
    public List<WlyyPrescriptionEmrDO> selectHistoryEmr(String patientId,String eventNo) throws Exception {
        List<WlyyPrescriptionEmrDO> wlyyPrescriptionEmrDOList = new ArrayList<>();
        String obj = hcyyEntranceService.SelectEmrInfo(patientId,patientId);
        String obj = hcyyEntranceService.SelectEmrInfo(patientId,eventNo);
        if("[[]]".equalsIgnoreCase(obj)||"[]".equalsIgnoreCase(obj)||StringUtils.isBlank(obj)){
            return null;
        }else {
@ -670,6 +672,14 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                    wlyyInspectionVOList.add(inspectionVO);
                }
                wlyyPrescriptionVO.setInspectionVOs(wlyyInspectionVOList);
                try {
                    List<WlyyPrescriptionEmrDO> listEmr = selectHistoryEmr(patNo,registerSn);
                    if (null!=listEmr&&listEmr.size()>0){
                        wlyyPrescriptionVO.setWlyyPrescriptionEmrDO(listEmr.get(0));
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                prescriptionVOList.add(wlyyPrescriptionVO);
            }
        }
@ -801,6 +811,18 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            paramRequest.put("catalogid","74");
            paramRequest.put("emrtype","93");
            paramRequest.put("emrtitle","互联网医院");
            String str = "";
            List<WlyyPrescriptionDiagnosisDO> diagnosisDOS = prescriptionDiagnosisDao.findByPrescriptionId(prescriptionId,1);
            if (diagnosisDOS!=null&&diagnosisDOS.size()!=0){
                for (WlyyPrescriptionDiagnosisDO diagnosisDO:diagnosisDOS){
                    str+=diagnosisDO.getName()+",";
                }
            }
            if (StringUtils.isNoneBlank(str)&&str.length()>1){
                str = str.substring(0,str.length()-1);
            }
            paramRequest.put("diseaseName",str);
            if (StringUtils.isNoneBlank(baseSign)){
                JSONObject object = hcyyEntranceService.getSignPicture(doctorDO.getId());
@ -1816,7 +1838,10 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                throw new Exception("未找到待结算记录");
            }
            YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByOutpatient(outpatientId);
            if (ylzMedicalRelationDO.getState()!=null&&ylzMedicalRelationDO.getState()==1){
            if (ylzMedicalRelationDO!=null&&ylzMedicalRelationDO.getState()!=null&&ylzMedicalRelationDO.getState()==1){
                return "已结算";
            }
            if (ylzMedicalRelationDO==null){
                return "已结算";
            }
            BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(ylzMedicalRelationDO.getId());
@ -1890,7 +1915,7 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                        "       HOSP_PART_AMT     = '0',\n" +
                        "       POOL_PROP_SELFPAY = '0',\n" +
                        "       INSUPLC_ADMDVS    = '"+ylzMedicalRelationDO.getAdministrativeArea()+"',\n" +
                        "       INSUTYPE          = '',\n" +
                        "       INSUTYPE          = '"+ylzMedicalRelationDO.getInsuranceType()+"',\n" +
                        "       PSN_NO            = '',\n" +
                        "       CHANNEL_TYPE      = '',\n" +
                        "       ACSIGN_TYPE       = 'null',\n" +

+ 6 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionExpressageService.java

@ -562,6 +562,12 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
        DefaultTransactionDefinition def = new DefaultTransactionDefinition();
        def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW); // 事务隔离级别,开启新事务
        TransactionStatus status = transactionManager.getTransaction(def); // 获得事务状态
        for (WlyyPrescriptionDO wlyyPrescriptionDO:sfprescription){
            if (wlyyPrescriptionDO.getStatus()<32&&wlyyPrescriptionDO.getStatus()>=30){
                wlyyPrescriptionDO.setStatus(32);
                prescriptionDao.save(wlyyPrescriptionDO);
            }
        }
        try {
            //用于判断新节点是否包含了"已收件"的节点
@ -626,12 +632,9 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
                    }
                }
                //保存配送成功的日志
                WlyyOutpatientExpressageLogDO outpatiExpressLog = new WlyyOutpatientExpressageLogDO();
                outpatiExpressLog.setOutpatientId(sfexpress.getOutpatientId());
                outpatiExpressLog.setId(UUID.randomUUID().toString());
                outpatiExpressLog.setType(8);
                outpatiExpressLog.setCreateTime(new Date());
                outpatiExpressLog.setFlag(1);

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

@ -741,13 +741,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        rs.put("sex", basePatientDO.getSex());
        PatientMedicareCardDO cardDO = basePatientMedicareCardDao.findByCodeAndPatientCodeAndDel(outpatientDO.getCardNo(), outpatientDO.getPatient());
        rs.put("ssc", cardDO);
        rs.put("age", IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard()));
        rs.put("age", IdCardUtil.getAgeByBirthday(basePatientDO.getBirthday()));
        rs.put("address", basePatientDO.getAddress());
        rs.put("mobile", basePatientDO.getMobile());
        rs.put("birthday", DateUtil.dateToStr(basePatientDO.getBirthday(), "yyyy-MM-dd"));
        rs.put("diseaseCode",outpatientDO.getDiseaseCode());
        rs.put("diseaseName",outpatientDO.getDiseaseName());
        rs.put("inquirySign",outpatientDO.getInquirySign());
        rs.put("visitType",outpatientDO.getVisitType());
        rs.put("virusFlag",outpatientDO.getVirusFlag());
        String hisPatient="";
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(basePatientDO.getId());
        if(null!=patientMappingDO){
@ -1114,20 +1116,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        Double price = 0.0;
        String chargeType1 = null;
        if (doctorDO!=null){
            if (outpatient.getOutpatientType().equalsIgnoreCase("1")){
                if(outpatientDO.getType().equalsIgnoreCase("1")){
                    chargeType1 = doctorDO.getTwfzChargeType();
                }else if(outpatientDO.getType().equalsIgnoreCase("2")){
                    chargeType1 = doctorDO.getSpfzChargeType();
                }
            }else if (outpatient.getOutpatientType().equalsIgnoreCase("3")){
                if(outpatientDO.getType().equalsIgnoreCase("1")){
                    chargeType1 = doctorDO.getTwzxChargeType();
                }else if(outpatientDO.getType().equalsIgnoreCase("2")){
                    chargeType1 = doctorDO.getSpzxChargeType();
            if (!StringUtils.isNoneBlank(outpatient.getVisitType())||outpatient.getVisitType().equalsIgnoreCase("2")){
                if (outpatient.getOutpatientType().equalsIgnoreCase("1")){
                    if(outpatientDO.getType().equalsIgnoreCase("1")){
                        chargeType1 = doctorDO.getTwfzChargeType();
                    }else if(outpatientDO.getType().equalsIgnoreCase("2")){
                        chargeType1 = doctorDO.getSpfzChargeType();
                    }
                }else if (outpatient.getOutpatientType().equalsIgnoreCase("3")){
                    if(outpatientDO.getType().equalsIgnoreCase("1")){
                        chargeType1 = doctorDO.getTwzxChargeType();
                    }else if(outpatientDO.getType().equalsIgnoreCase("2")){
                        chargeType1 = doctorDO.getSpzxChargeType();
                    }
                }else if (outpatient.getOutpatientType().equalsIgnoreCase("2")){
                    chargeType1 = doctorDO.getXtfzChargeType();
                }
            }else if (outpatient.getOutpatientType().equalsIgnoreCase("2")){
                chargeType1 = doctorDO.getXtfzChargeType();
            }else if (StringUtils.isNoneBlank(outpatient.getVisitType())&&outpatient.getVisitType().equalsIgnoreCase("1")){
                chargeType1 = doctorDO.getXgszChargeType();
            }
            if(doctorDO!=null){
                if (StringUtils.isNoneBlank(chargeType1)){
@ -2190,21 +2196,28 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        logger.info("下载银医通");
        String chargeType = "";
        if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(outpatientDO.getType())){
            chargeType = doctorDO.getTwfzChargeType();
        }else if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(outpatientDO.getType())){
            chargeType = doctorDO.getSpfzChargeType();
        }else if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(outpatientDO.getType())){
            chargeType = doctorDO.getTwzxChargeType();
        }else if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(outpatientDO.getType())){
            chargeType = doctorDO.getSpzxChargeType();
        }else if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"3".equalsIgnoreCase(outpatientDO.getType())){
            chargeType = doctorDO.getJyzxChargeType();
        }else if ("2".equalsIgnoreCase(outpatientDO.getOutpatientType())){
            chargeType = doctorDO.getXtfzChargeType();
        if (StringUtils.isNoneBlank(outpatientDO.getVisitType())&&outpatientDO.getVisitType().equalsIgnoreCase("1")){
            chargeType = doctorDO.getXgszChargeType();
        }else {
            chargeType = doctorDO.getChargeType();
            if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(outpatientDO.getType())){
                chargeType = doctorDO.getTwfzChargeType();
            }else if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(outpatientDO.getType())){
                chargeType = doctorDO.getSpfzChargeType();
            }else if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(outpatientDO.getType())){
                chargeType = doctorDO.getTwzxChargeType();
            }else if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(outpatientDO.getType())){
                chargeType = doctorDO.getSpzxChargeType();
            }else if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())&&"3".equalsIgnoreCase(outpatientDO.getType())){
                chargeType = doctorDO.getJyzxChargeType();
            }else if ("2".equalsIgnoreCase(outpatientDO.getOutpatientType())){
                chargeType = doctorDO.getXtfzChargeType();
            }else if ("2".equalsIgnoreCase(outpatientDO.getOutpatientType())){
                chargeType = doctorDO.getXtfzChargeType();
            }else {
                chargeType = doctorDO.getChargeType();
            }
        }
        net.sf.json.JSONObject rs = entranceService.BS10111(outpatientDO.getCardNo(), doctorMappingDO.getMappingCode(), outpatientDO.getDept(), chargeType, outpatientDO.getWinNo(), demoFlag);
        net.sf.json.JSONObject res = rs.getJSONObject("resquest");
        logger.info("挂号结果 res: " + res.toString());
@ -4496,6 +4509,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            rs.put("idCard",doctorDO.getIdcard());
            rs.put("idCardType",doctorDO.getIdCardType());
            rs.put("mark",doctorDO.getMark());
            rs.put("twzxChargeType",doctorDO.getTwzxChargeType());
            rs.put("twfzChargeType",doctorDO.getTwfzChargeType());
            rs.put("spzxChargeType",doctorDO.getSpzxChargeType());
            rs.put("spfzChargeType",doctorDO.getSpfzChargeType());
            rs.put("jyzxChargeType",doctorDO.getJyzxChargeType());
            rs.put("xtfzChargeType",doctorDO.getXtfzChargeType());
            rs.put("xgszChargeType",doctorDO.getXgszChargeType());
            List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
            String sqlCharge = "SELECT\n" +
                    "\tm.req_fee as \"twfzFee\",\n" +
@ -4503,7 +4523,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "\tb.req_fee as \"spzxFee\",\n" +
                    "\tv.req_fee as \"twzxFee\",\n" +
                    "\tg.req_fee as \"jyzxFee\",\n" +
                    "\td.req_fee as \"xtzxFee\"\n" +
                    "\td.req_fee as \"xtzxFee\",\n" +
                    "\th.req_fee as \"xgszFee\"\n" +
                    "FROM\n" +
                    "\tbase_doctor t\n" +
                    "LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type and m.is_del='1'\n" +
@ -4512,6 +4533,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type and v.is_del='1'\n" +
                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type and d.is_del='1'\n" +
                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type and g.is_del='1'\n" +
                    " LEFT JOIN wlyy_charge_dict h ON t.xgsz_charge_type = h.charge_type and h.is_del='1'\n" +
                    "WHERE t.id = '"+doctorDO.getId()+"' ";
            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            //System.out.println(chargeDictDOLists.get(1));
@ -7767,7 +7789,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        rs.put("townCode", basePatientDO.getTownCode());
        rs.put("townName", basePatientDO.getTownName());
        rs.put("idcard", basePatientDO.getIdcard());
        rs.put("age", IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard()));
        rs.put("age", IdCardUtil.getAgeByBirthday(basePatientDO.getBirthday()));
        rs.put("mobile", basePatientDO.getMobile());
        rs.put("photo", basePatientDO.getPhoto());
        rs.put("address", basePatientDO.getAddress());
@ -8394,7 +8416,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
                for (WlyyPrescriptionDO prescriptionDO:wlyyPrescriptionDOList){
                    prescriptionDO.setStatus(32);
                    prescriptionDO.setStatus(31);
                    prescriptionDao.save(prescriptionDO);
                }
                if (sfexpress_obj != null && StringUtils.isNoneBlank(sfexpress_obj.getMailno())) {
@ -8506,7 +8528,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                            System.out.println("获取顺丰物流面单信息:6");
                        }
                        wlyyPrescriptionDOS.setStatus(32);
                        wlyyPrescriptionDOS.setStatus(31);
                        prescriptionDao.save(wlyyPrescriptionDOS);
                        if (sfexpress_obj != null && StringUtils.isNoneBlank(sfexpress_obj.getMailno())) {
                            com.alibaba.fastjson.JSONObject object = sfexpressService.postSFOrderQueryService(sfexpress_obj);
@ -12891,7 +12913,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                                String url = "https://hlwyy.xmzsh.com/hlwyy/ims-wx/#/nucleicTest/detail?id=" + baseNatAppointmentDO.getId();
                                String date = DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime());
                                WlyyHospitalSysDictDO hospitalSysDictDO1 = wlyyHospitalSysDictDao.findById("natConfigTestNew");
                                String addres = "我院五号楼北侧(急诊部后侧)";
                                String addres = "我院发热门诊的核酸采样点(采样时间为8:00~12:00,14:00~17:30)。";
                                String timeDes = "6-8小时";
                                if (hospitalSysDictDO1!=null){
                                    com.alibaba.fastjson.JSONArray array1 = com.alibaba.fastjson.JSONArray.parseArray(hospitalSysDictDO1.getDictValue());
@ -12906,7 +12928,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                                }
                                String first = "尊敬的用户" + baseNatAppointmentDO.getName() + ",您已完成线上自助核酸检测预约申请";
                                String contentMsg = "申请人:" + baseNatAppointmentDO.getName() + "\r\n 预约时间:" + date + " \r\n发票流水号:" + baseNatAppointmentDO.getRealOrder();
                                String remark = "1、请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至"+addres+"核酸检测点领取标本试管窗口绑定检测。\r\n" +
                                String remark = "1、请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至"+addres+
                                        "2、核酸检测标本采集"+timeDes+"后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
                                String responseMsg = "";
                                responseMsg = entranceService.ehospitalNotice(
@ -13333,7 +13355,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                String url="";
                String date = DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime());
                WlyyHospitalSysDictDO hospitalSysDictDO1 = wlyyHospitalSysDictDao.findById("natConfigTestNew");
                String addres = "我院五号楼北侧(急诊部后侧)";
                String addres = "我院发热门诊的核酸采样点(采样时间为8:00~12:00,14:00~17:30)。";
                String timeDes = "6-8小时";
                if (hospitalSysDictDO1!=null){
                    com.alibaba.fastjson.JSONArray array1 = com.alibaba.fastjson.JSONArray.parseArray(hospitalSysDictDO1.getDictValue());
@ -13348,7 +13370,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
                String contentMsg="申请人:"+baseNatAppointmentDO.getName()+"\r\n预约时间:"+date;
                String remark = "1、请于预约时间"+date+"前,携带医保卡/就诊卡/电子健康卡到院区自助机进行结算。\r\n" +
                        "2、结算完成后请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至"+addres+"核酸检测点领取标本试管窗口绑定检测。\r\n" +
                        "2、结算完成后请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至"+addres+
                        "3、核酸检测标本采集"+timeDes+"后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
                if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)) {
                    responseMsg = entranceService.ehospitalNotice(
@ -13372,7 +13394,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                String date = DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime());
                jsonObject.put("keyword2","申请人:"+baseNatAppointmentDO.getName()+"\n预约时间:"+date);
                WlyyHospitalSysDictDO hospitalSysDictDO1 = wlyyHospitalSysDictDao.findById("natConfigTestNew");
                String addres = "我院五号楼北侧(急诊部后侧)";
                String addres = "我院发热门诊的核酸采样点(采样时间为8:00~12:00,14:00~17:30)。";
                String timeDes = "6-8小时";
                if (hospitalSysDictDO1!=null){
                    com.alibaba.fastjson.JSONArray array1 = com.alibaba.fastjson.JSONArray.parseArray(hospitalSysDictDO1.getDictValue());
@ -13386,7 +13408,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    }
                }
                String remark =  "1、请于预约时间"+date+"前,携带医保卡/就诊卡/电子健康卡到院区自助机进行结算。\n" +
                        "2、结算完成后请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至"+addres+"核酸检测点领取标本试管窗口绑定检测。\n" +
                        "2、结算完成后请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至"+addres+
                        "3、核酸检测标本采集"+timeDes+"后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
                jsonObject.put("remark",remark);
                jsonObject.put("url","111111");
@ -13824,7 +13846,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "发票流水号:"+realorder+"");
            BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
            WlyyHospitalSysDictDO hospitalSysDictDO1 = wlyyHospitalSysDictDao.findById("natConfigTestNew");
            String addres = "我院五号楼北侧(急诊部后侧)";
            String addres = "我院发热门诊的核酸采样点(采样时间为8:00~12:00,14:00~17:30)。";
            String timeDes = "6-8小时";
            if (hospitalSysDictDO1!=null){
                com.alibaba.fastjson.JSONArray array1 = com.alibaba.fastjson.JSONArray.parseArray(hospitalSysDictDO1.getDictValue());
@ -13837,7 +13859,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    }
                }
            }
            String remark = "1、请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至"+addres+"核酸检测点领取标本试管窗口绑定检测。\n" +
            String remark = "1、请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至"+addres+
                    "2、核酸检测标本采集"+timeDes+"后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
            jsonObject.put("remark",remark);
            jsonObject.put("url",redirdctUrl);
@ -15027,7 +15049,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    logger.info("变更处方结算状态成功");
                    String fee = ylzMedicalRelationDO.getTotalAmount();
                    Double medicarePrice = Double.parseDouble(ylzMedicalRelationDO.getMedicalPrice())+Double.parseDouble(ylzMedicalRelationDO.getPersonAccount());
                    String pushPayLog =  payInfoNoticeService.pushPrescriptionPayMedicare(wlyyOutpatientDO.getConsumer(),prescriptionDO.getDoctorName(),prescriptionDO.getVoucherNo(),prescriptionDO.getOutpatientId(),prescriptionDO.getId(),fee,medicarePrice+"",ylzMedicalRelationDO.getPersonCash(),title,null);
                    String pushPayLog =  payInfoNoticeService.pushPrescriptionPayMedicare(wlyyOutpatientDO.getConsumer(),prescriptionDO.getDoctorName(),prescriptionDO.getRealOrder(),prescriptionDO.getOutpatientId(),prescriptionDO.getId(),fee,medicarePrice+"",ylzMedicalRelationDO.getPersonCash(),title,null);
                    logger.info("处方结算成功"+pushPayLog+"====="+realOrder);
                    //2.6.1	电子处方订单接收
                    logger.info("医保电子处方订单");

File diff suppressed because it is too large
+ 27 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java


+ 2 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/HcyyEntranceService.java

@ -1762,6 +1762,7 @@ public class HcyyEntranceService {
                SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                htmlDeo = replaceHtml(htmlDeo,"@createTime@",sf.format(prescriptionEmrDO.getCreateTime()));
                htmlDeo = replaceHtml(htmlDeo,"@complaint@",prescriptionEmrDO.getComplaint());
                htmlDeo = replaceHtml(htmlDeo,"@diseaseName@",jsonObject.getString("diseaseName"));
                htmlDeo = replaceHtml(htmlDeo,"@medicalHistory@",prescriptionEmrDO.getMedicalHistory());
                htmlDeo = replaceHtml(htmlDeo,"@popularHistory@",prescriptionEmrDO.getPopularHistory());
                htmlDeo = replaceHtml(htmlDeo,"@pastHistory@",prescriptionEmrDO.getPastHistory());
@ -1842,7 +1843,7 @@ public class HcyyEntranceService {
            condition += "<patientId>"+patientId+"</patientId>";
        }
        if (StringUtils.isNotBlank(eventNo)&&!"null".equalsIgnoreCase(eventNo)){
            condition += "<eventNo>"+eventNo+"</eventNo>";
            condition += "<eventNo>R"+eventNo+"</eventNo>";
        }
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";

+ 56 - 21
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -24,9 +24,11 @@ import com.yihu.jw.hospital.healthCare.YlzMedicailRelationDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.HcyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.HcyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
@ -151,6 +153,8 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    private HttpClientUtil httpClientUtil;
    @Autowired
    private YlzMedicailRelationDao ylzMedicailRelationDao;
    @Autowired
    private HcyyPrescriptionService hcyyPrescriptionService;
    /**
@ -1815,28 +1819,34 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                String fee = null;
                if (wechatId.equalsIgnoreCase("xm_zsyy_wx")||wechatId.equalsIgnoreCase("xm_xzzx_wx")||wechatId.equalsIgnoreCase("xm_hcyy_wx")){
                    if (wlyyOutpatientDO!=null){
                        if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                            WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getTwfzChargeType(),"6");
                            fee = chargeDictDO.getReqFee()+"";
                        }else if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                            WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getSpfzChargeType(),"6");
                            fee = chargeDictDO.getReqFee()+"";
                        }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                            WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getTwzxChargeType(),"6");
                            fee = chargeDictDO.getReqFee()+"";
                        }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                            WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getSpzxChargeType(),"6");
                            fee = chargeDictDO.getReqFee()+"";
                        }else if ("2".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                            WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getXtfzChargeType(),"6");
                            fee = chargeDictDO.getReqFee()+"";
                        }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"3".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                            WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getJyzxChargeType(),"6");
                        if (wlyyOutpatientDO.getVisitType()!=null&&wlyyOutpatientDO.getVisitType().equalsIgnoreCase("1")){
                            WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getXgszChargeType(),"6");
                            fee = chargeDictDO.getReqFee()+"";
                        }else {
                            WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getChargeType(),"6");
                            fee = chargeDictDO.getReqFee()+"";
                            if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                                WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getTwfzChargeType(),"6");
                                fee = chargeDictDO.getReqFee()+"";
                            }else if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                                WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getSpfzChargeType(),"6");
                                fee = chargeDictDO.getReqFee()+"";
                            }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                                WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getTwzxChargeType(),"6");
                                fee = chargeDictDO.getReqFee()+"";
                            }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                                WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getSpzxChargeType(),"6");
                                fee = chargeDictDO.getReqFee()+"";
                            }else if ("2".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                                WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getXtfzChargeType(),"6");
                                fee = chargeDictDO.getReqFee()+"";
                            }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"3".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                                WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getJyzxChargeType(),"6");
                                fee = chargeDictDO.getReqFee()+"";
                            }else {
                                WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getChargeType(),"6");
                                fee = chargeDictDO.getReqFee()+"";
                            }
                        }
                    }
                }else {
@ -2145,7 +2155,20 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            }
            logger.info("开始1"+idcard);
            String openId = "";
            businessOrderDO.setPayPrice(b1.doubleValue());
            JSONObject object1 = hcyyPrescriptionService.selectCardInfo(cardNo);
            Double cardFee = object1.getDouble("ZHYE");
            BigDecimal b = new BigDecimal(String.valueOf(cardFee));
            BigDecimal c = new BigDecimal(String.valueOf(fee));
            if (b.compareTo(c) == 1){
                return "无需线上支付";
            }
            BigDecimal balance = c.subtract(b);
            if (balance.doubleValue()<=0){
                return "无需线上支付";
            }
            businessOrderDO.setPayPrice(balance.doubleValue());
            businessOrderDO.setPayType(4);
            businessOrderDO.setHistoryOrder(businessOrderDO.getOrderNo());
            businessOrderDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
@ -2209,7 +2232,19 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            }
            logger.info("开始2"+idcard);
            String openId = "";
            businessOrderDO.setPayPrice(b1.doubleValue());
            JSONObject object1 = hcyyPrescriptionService.selectCardInfo(cardNo);
            Double cardFee = object1.getDouble("ZHYE");
            BigDecimal b = new BigDecimal(String.valueOf(cardFee));
            BigDecimal c = new BigDecimal(String.valueOf(fee));
            if (b.compareTo(c) == 1){
                return "无需线上支付";
            }
            BigDecimal balance = c.subtract(b);
            if (balance.doubleValue()<=0){
                return "无需线上支付";
            }
            businessOrderDO.setPayPrice(balance.doubleValue());
            businessOrderDO.setPayType(4);
            businessOrderDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
            businessOrderDO.setDepositType(depositType);

+ 8 - 3
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -2125,6 +2125,7 @@ public class ImService {
                if ("4".equalsIgnoreCase(baseEvaluateDO.getScoreType())) {
                    BaseUserMessageDO baseUserMessageDO = new BaseUserMessageDO();
                    baseUserMessageDO.setCreateTime(new Date());
                    baseUserMessageDO.setIsShow(1);
                    baseUserMessageDO.setReceiver(consultTeamDo.getDoctor());
                    BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(consultTeamDo.getDoctor());
                    if (baseDoctorDO != null) {
@ -4065,13 +4066,16 @@ public class ImService {
            if (flag) {
                sql = sql + "date_format(op.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
                sql = sql + "date_format(op.end_time,'%Y-%m-%d %H:%i:%S' )  AS \"endTime\", ";
                sql = sql + "date_format(d.birthday,'%Y-%m-%d' )  AS \"birthday\",";
            } else {
                sql = sql + "to_char(op.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\",";
                sql = sql + "to_char(op.end_time,'YYYY-MM-DD hh24:mi:ss')  AS \"endTime\",";
                sql = sql + "to_char(d.birthday,'YYYY-MM-DD')  AS \"birthday\",";
            }
        } else {
            sql = sql + "date_format(op.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
            sql = sql + "date_format(op.end_time,'%Y-%m-%d %H:%i:%S' )  AS \"endTime\",";
            sql = sql + "date_format(d.birthday,'%Y-%m-%d' )  AS \"birthday\",";
        }
        sql = sql + "op.status AS \"status\"," +
                "b.evaluate AS \"evaluate\"," +
@ -4172,9 +4176,10 @@ public class ImService {
        sql += " ORDER BY op.create_time desc ";
        List<Map<String, Object>> mapList = hibenateUtils.createSQLQuery(sql, page, pagesize);
        for (Map<String, Object> map : mapList) {
            if (map.get("patientIdcard") != null) {
                String idcard = map.get("patientIdcard").toString();
                Integer age = IdCardUtil.getAgeForIdcard(idcard);
            if (map.get("birthday") != null) {
                String birthday = map.get("birthday").toString();
                Date birDate = DateUtil.strToDateShort(birthday);
                Integer age = IdCardUtil.getAgeByBirthday(birDate);
                map.put("patientAge", age);
            } else {
                map.put("patientAge", null);

+ 6 - 1
common/common-entity/sql/sql记录

@ -2432,4 +2432,9 @@ alter table wlyy_patient_rehabilitation_plan add column patient_info_code varcha
alter table wlyy_patient_rehabilitation_plan add column third_org_code varchar(50) DEFAULT NULL COMMENT '自动下转的医院code';
-- 2023-02-13
ALTER TABLE base_doctor_daily_report_upload add column leader_comment VARCHAR(1000) COMMENT '上级点评'
ALTER TABLE base_doctor_daily_report_upload add column leader_comment VARCHAR(1000) COMMENT '上级点评'
-- 2023-01-29 wzn base
alter table base_doctor add column xgsz_charge_type varchar(50) DEFAULT NULL COMMENT '新冠首诊号别';
alter table wlyy_outpatient add column visit_type varchar(2) DEFAULT NULL COMMENT '就诊类型:1首诊2复诊';
alter table wlyy_outpatient add column virus_flag varchar(2) DEFAULT NULL COMMENT '新冠病毒:1阴性、2阳性、0无';
alter table wlyy_charge_dict add column code varchar(50) DEFAULT NULL COMMENT '号别编码';

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

@ -282,6 +282,11 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
     */
    private String jyzxChargeType;
    /**
     * 新冠首诊
     */
    private String xgszChargeType;
    private String visitTime;
    /**
@ -312,6 +317,15 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
    private String ztId;//禅道用户id
    public String getXgszChargeType() {
        return xgszChargeType;
    }
    public void setXgszChargeType(String xgszChargeType) {
        this.xgszChargeType = xgszChargeType;
    }
    public String getZtId() {
        return ztId;
    }

+ 14 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/dict/WlyyChargeDictDO.java

@ -12,7 +12,12 @@ import java.util.Date;
@Entity
@Table(name = "wlyy_charge_dict")
public class WlyyChargeDictDO extends UuidIdentityEntity {
    /**
     * 号别编码
     */
    private String code;
    /**号别code*/
    private String chargeType;
    /**号别名称*/
    private String chargeName;
@ -24,6 +29,15 @@ public class WlyyChargeDictDO extends UuidIdentityEntity {
    private String deptTypeCode;
    private String isDel;
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getIsDel() {
        return isDel;
    }

+ 20 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyOutpatientDO.java

@ -308,6 +308,26 @@ public class WlyyOutpatientDO extends UuidIdentityEntity {
    private String inquirySign;//问诊标识1发热咨询0普通门诊
    private String visitType;//就诊类型:1首诊2复诊
    private String virusFlag;//新冠病毒:1阴性、2阳性、0无
    @Column(name = "visit_type")
    public String getVisitType() {
        return visitType;
    }
    public void setVisitType(String visitType) {
        this.visitType = visitType;
    }
    @Column(name = "virus_flag")
    public String getVirusFlag() {
        return virusFlag;
    }
    public void setVirusFlag(String virusFlag) {
        this.virusFlag = virusFlag;
    }
    @Column(name = "inquiry_sign")
    public String getInquirySign() {
        return inquirySign;

+ 5 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/DoctorServiceEndPoint.java

@ -37,6 +37,10 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
            @RequestParam(value = "hospital", required = false) String hospital,
            @ApiParam(name = "status", value = "状态")
            @RequestParam(value = "status", required = false) String status,
            @ApiParam(name = "chargeType", value = "挂号类别")
            @RequestParam(value = "chargeType", required = false) String chargeType,
            @ApiParam(name = "conditionKey", value = "搜索条件(姓名、手机号、身份证)")
            @RequestParam(value = "conditionKey", required = false) String conditionKey,
            @ApiParam(name = "name", value = "科室或医生名称")
            @RequestParam(value = "name", required = false) String name,
            @ApiParam(name = "type", value = "咨询类型")
@ -50,7 +54,7 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
            @ApiParam(name = "pageSize", value = "页码", required = true, defaultValue = "10")
            @RequestParam(value = "pageSize") int pageSize) throws Exception {
        try {
            return baseDoctorService.queryList(city,hospital,status,name,type,typeCode,dept,page,pageSize);
            return baseDoctorService.queryList(city,hospital,status,chargeType,conditionKey,name,type,typeCode,dept,page,pageSize);
        }catch (Exception e){
            return failedException2(e);
        }

+ 2 - 2
svr/svr-internet-hospital/pom.xml

@ -11,7 +11,7 @@
    </parent>
    <groupId>com.yihu.jw</groupId>
    <artifactId>svr-internet-hospital-test</artifactId>
    <artifactId>svr-internet-hospital</artifactId>
    <packaging>jar</packaging>
    <version>${parent.version}</version>
@ -267,7 +267,7 @@
    </dependencies>
    <build>
        <finalName>svr-internet-hospital-test</finalName>
        <finalName>svr-internet-hospital</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>

+ 5 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/config/DoctorServiceEndPoint.java

@ -36,6 +36,10 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
            @RequestParam(value = "hospital", required = false) String hospital,
            @ApiParam(name = "status", value = "状态")
            @RequestParam(value = "status", required = false) String status,
            @ApiParam(name = "chargeType", value = "挂号类别")
            @RequestParam(value = "chargeType", required = false) String chargeType,
            @ApiParam(name = "conditionKey", value = "搜索条件(姓名、手机号、身份证)")
            @RequestParam(value = "conditionKey", required = false) String conditionKey,
            @ApiParam(name = "name", value = "科室或医生名称")
            @RequestParam(value = "name", required = false) String name,
            @ApiParam(name = "type", value = "咨询类型")
@ -50,7 +54,7 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
            @RequestParam(value = "pageSize") int pageSize) throws Exception {
        try{
            return baseDoctorService.queryList(city,hospital,status,name,type,typeCode,dept,page,pageSize);
            return baseDoctorService.queryList(city,hospital,status,chargeType,conditionKey,name,type,typeCode,dept,page,pageSize);
        }catch (Exception e){
            return failedException(e);
        }

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

@ -376,7 +376,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
						}
					}
				}else if("xm_hcyy_wx".equals(wxId)){ //心脏中心挂号
				}else if("xm_hcyy_wx".equals(wxId)){ //海沧医院
					if (demoFlag.equalsIgnoreCase("true")){
						rsCode="0";
						mes="已退号";

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -672,7 +672,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
		try {
			BasePatientDO result = basePatientService.findByIdAndDel(patient);
			//---居民性别取身份证字段--
			result.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(result.getIdcard())));
			/*result.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(result.getIdcard())));*/
			if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
				familyMemberService.saveYktFamily(patient);
			}

+ 6 - 7
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -439,20 +439,19 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorInfo)
    @ApiOperation(value = "获取医生信息", notes = "获取医生信息")
    public Envelop findDoctorInfo(@ApiParam(name = "doctor", value = "医生code")
    public Envelop findDoctorInfo(@ApiParam(name = "doctor", value = "医生code",required = false)
                                     @RequestParam(value = "doctor", required = false)String doctor,
                                  @ApiParam(name = "idcard", value = "医生身份证")
                                  @ApiParam(name = "idcard", value = "医生身份证",required = false)
                                  @RequestParam(value = "idcard", required = false)String idcard,
                                     @ApiParam(name = "withWork", value = "传1带排班,其他不带")
                                     @ApiParam(name = "withWork", value = "传1带排班,其他不带",required = false)
                                     @RequestParam(value = "withWork", required = false)String withWork,
                                     @ApiParam(name = "patient", value = "患者code")
                                         @RequestParam(value = "patient", required = false)String patient)throws Exception{
        try {
            return success(prescriptionService.findDoctorInfo(doctor,idcard,withWork,patient));
        }catch (Exception e){
        } catch (Exception e){
            return  failedException(e);
        }
    }
@ -1311,7 +1310,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                            String url = "https://hlwyy.xmzsh.com/hlwyy/ims-wx/#/nucleicTest/detail?id="+natAppointmentDO.getId();
                                            String date = DateUtil.dateToStrLong(natAppointmentDO.getAppointmentTime());
                                            WlyyHospitalSysDictDO hospitalSysDictDO = wlyyHospitalSysDictDao.findById("natConfigTestNew");
                                            String addres = "我院五号楼北侧(急诊部后侧)";
                                            String addres = "我院发热门诊的核酸采样点(采样时间为8:00~12:00,14:00~17:30)。";
                                            String timeDes = "6-8小时";
                                            if (hospitalSysDictDO!=null){
                                                com.alibaba.fastjson.JSONArray array = com.alibaba.fastjson.JSONArray.parseArray(hospitalSysDictDO.getDictValue());
@ -1326,7 +1325,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                            }
                                            String first = "尊敬的用户"+natAppointmentDO.getName()+",您已完成线上自助核酸检测预约申请";
                                            String contentMsg = "申请人:"+natAppointmentDO.getName()+"\r\n 预约时间:"+date+" \r\n发票流水号:"+waitPayDetailVO.getRecipeNo();
                                            String remark="1、请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至"+addres+"核酸检测点领取标本试管窗口绑定检测。\r\n" +
                                            String remark="1、请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至"+addres +
                                                    "2、核酸检测标本采集"+timeDes+"后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
                                            String responseMsg="";
                                            if ("xm_zsyy_wx".equalsIgnoreCase(wxId)) {

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

@ -1103,13 +1103,15 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorInfo)
    @ApiOperation(value = "获取医生信息", notes = "获取医生信息")
    public ObjEnvelop findDoctorInfo(@ApiParam(name = "doctor", value = "医生code")
                                     @RequestParam(value = "doctor", required = true) String doctor,
                                     @RequestParam(value = "doctor", required = false) String doctor,
                                     @ApiParam(name = "idcard", value = "医生身份证")
                                     @RequestParam(value = "idcard", required = false)String idcard,
                                     @ApiParam(name = "withWork", value = "传1带排班,其他不带")
                                     @RequestParam(value = "withWork", required = false) String withWork,
                                     @ApiParam(name = "patient", value = "患者code")
                                     @RequestParam(value = "patient", required = false) String patient) {
        try {
            return success(prescriptionService.findDoctorInfo(doctor,null, withWork, patient));
            return success(prescriptionService.findDoctorInfo(doctor,idcard, withWork, patient));
        } catch (Exception e) {
            return failedObjEnvelopException(e);
        }

+ 12 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/QrcodeService.java

@ -9,6 +9,7 @@ import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.HcyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.patient.dao.BasePatientDao;
@ -75,6 +76,8 @@ public class QrcodeService {
    private HttpClientUtil httpClientUtil;
    @Autowired
    private BaseOrgDao baseOrgDao;
    @Autowired
    private HcyyEntranceService hcyyEntranceService;
    /**
     * 生成所有医生的二维码
     *
@ -96,6 +99,8 @@ public class QrcodeService {
        }else if("xm_xzzx_wx".equals(wxId)){
            token = xzzxEntranceService.getXzToken();
        }else if("xm_hcyy_wx".equals(wxId)){
            token = hcyyEntranceService.getHcToken();
        }else{
            token = wxAccessTokenService.getWxAccessTokenById(wxId).getAccessToken();
        }
@ -143,6 +148,8 @@ public class QrcodeService {
        }else if("xm_xzzx_wx".equals(wxId)){
            token = xzzxEntranceService.getXzToken();
        }else if("xm_hcyy_wx".equals(wxId)){
            token = hcyyEntranceService.getHcToken();
        }else{
            token = wxAccessTokenService.getWxAccessTokenById(wxId).getAccessToken();
        }
@ -254,6 +261,8 @@ public class QrcodeService {
        }else if("xm_xzzx_wx".equals(wxId)){
            token = xzzxEntranceService.getXzToken();
        }else if("xm_hcyy_wx".equals(wxId)){
            token = hcyyEntranceService.getHcToken();
        }else{
            token = wxAccessTokenService.getWxAccessTokenById(wxId).getAccessToken();
        }
@ -457,7 +466,9 @@ public class QrcodeService {
                jsonObject.put("nickname","nickname");
                objEnvelop.setMessage(jsonObject.toString());
                return objEnvelop;
            }else{
            } else if ("xm_hcyy_wx".equalsIgnoreCase(wxId)) {
                token =  hcyyEntranceService.getHcToken();
            } else{
                token = wxAccessTokenService.getWxAccessTokenById(wxId).getAccessToken();
            }
            System.out.println("token"+token);

+ 1 - 1
svr/svr-internet-hospital/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name:  svr-internet-hospital
    name:  svr-internet-hospital-wangzhinan
  cloud:
    config:
      failFast: true

+ 23 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/third/ThirdDataInputController.java

@ -83,6 +83,29 @@ public class ThirdDataInputController {
        }
    }
    @PostMapping(value = "searchList2")
    @ApiOperation(value = "查询数据,分页", notes = "根据条件查询数据,分页")
    @IntefaceLogRequired
    public MixEnvelop searchList2(
            @ApiParam(name="startTime",value="开始时间",defaultValue = "")
            @RequestParam(value="startTime",required = false) String startTime,
            @ApiParam(name="endTime",value="结束时间",defaultValue = "")
            @RequestParam(value="endTime",required = false) String endTime,
            @ApiParam(name="sn",value="设备sn",defaultValue = "")
            @RequestParam(value="sn",required = false) String sn,
            @ApiParam(name="ext_code",value="地区",defaultValue = "")
            @RequestParam(value="ext_code",required = false) String ext_code,
            @ApiParam(name="idcard",value="身份证",defaultValue = "")
            @RequestParam(value="idcard",required = false) String idcard,
            @ApiParam(name="itemCode",value="体征指标代码",defaultValue = "")
            @RequestParam(value="itemCode",required = false) String itemCode) throws IOException {
        try{
            return dataSearchService.getDataToBean2(startTime,endTime,sn,ext_code,idcard,itemCode);
        } catch (ApiException e){
            return MixEnvelop.getError("操作失败", e.getErrorCode());
        }
    }
    @PostMapping(value = IotRequestMapping.ThirdOpen.uploadData)
    @ApiOperation(value = "体征数据上传", notes = "数据上传入库")
    @IntefaceLogRequired

+ 77 - 0
svr/svr-iot/src/main/java/com/yihu/iot/datainput/service/DataSearchService.java

@ -81,6 +81,83 @@ public class DataSearchService {
        return MixEnvelop.getSuccessListWithPage("success",list,page,size,count);
    }
    public MixEnvelop getDataToBean2(String startTime, String endTime, String sn, String ext_code,
                                    String idcard, String itemCode) throws IOException {
        logger.info("load data from elasticsearch start:" + org.apache.http.client.utils.DateUtils.formatDate(new Date(), DateUtil.yyyy_MM_dd_HH_mm_ss));
        String sql = "select * from "+ esIndex + " where  ";
        String countSql = "select count(*) count from "+ esIndex + " where  ";
        boolean firstFilter = true;
        if (StringUtils.isNotBlank(idcard)){
            sql += "  idcard = '"+idcard+"' ";
            countSql += " idcard = '"+idcard+"' ";
            firstFilter = false;
        }
        if(StringUtils.isNotEmpty(startTime)){
            if (firstFilter){
                sql += "  measure_data.measure_time>='"+startTime+"'";
                countSql += "  measure_data.measure_time>='"+startTime+"'";
                firstFilter = false;
            }else {
                sql += " and measure_data.measure_time>='"+startTime+"'";
                countSql += " and measure_data.measure_time>='"+startTime+"'";
            }
        }
        if(StringUtils.isNotEmpty(endTime)){
            if (firstFilter){
                sql += "  measure_data.measure_time<='"+endTime+"'";
                countSql += "  measure_data.measure_time<='"+endTime+"'";
                firstFilter = false;
            }else {
                sql += " and measure_data.measure_time<='"+endTime+"'";
                countSql += " and measure_data.measure_time<='"+endTime+"'";
            }
        }
        if(StringUtils.isNotEmpty(sn)){
            if (firstFilter){
                sql += "  sn='"+sn+"'";
                countSql += "  sn='"+sn+"'";
                firstFilter = false;
            }else {
                sql += " and sn='"+sn+"'";
                countSql += " and sn='"+sn+"'";
            }
        }
        if(StringUtils.isNotEmpty(ext_code)){
            if (firstFilter){
                sql += "  ext_code='"+ext_code+"'";
                countSql += "  ext_code='"+ext_code+"'";
                firstFilter = false;
            }else {
                sql += " and ext_code='"+ext_code+"'";
                countSql += " and ext_code='"+ext_code+"'";
            }
        }
        if(StringUtils.isNotEmpty(itemCode)){
            if (firstFilter){
                sql += "  measure_data.sign_name='"+itemCode+"'";
                countSql += "  measure_data.sign_name='"+itemCode+"'";
                firstFilter = false;
            }else {
                sql += " and measure_data.sign_name='"+itemCode+"'";
                countSql += " and measure_data.sign_name='"+itemCode+"'";
            }
        }
        sql+=" order by measure_data.measure_time desc ";
        List<iot.device.DataBodySignsVO> list = elasticSearchQueryGenerator.excute(sql, iot.device.DataBodySignsVO.class, ConstantUtils.esIndex, ConstantUtils.esType);
        Long count = elasticSearchQueryGenerator.excuteForLong(countSql,ConstantUtils.esType,ConstantUtils.esIndex);
        return MixEnvelop.getSuccessListWithPage("success",list,1,count.intValue()+1,count);
    }
//    @Autowired
//    private HBaseHelper hBaseHelper;