Browse Source

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

liubing 2 years ago
parent
commit
c0b4705ede
18 changed files with 1747 additions and 152 deletions
  1. 88 0
      business/base-service/src/main/java/com/yihu/jw/healthCare/service/HealthCareNewService.java
  2. 220 79
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/HcyyPrescriptionService.java
  3. 93 7
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  4. 85 7
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/HcyyEntranceService.java
  5. 930 0
      common/common-entity/sql/mysql关键字大全.sql
  6. 4 4
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DevicePatientHealthIndex.java
  7. 39 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/healthCare/YlzMedicalRelationDO.java
  8. 1 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/HcyyService.java
  9. 26 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/PatientInfoPlatFormService.java
  10. 33 9
      svr/svr-cloud-device/src/main/java/com/yihu/jw/care/endpoint/DeviceController.java
  11. 34 3
      svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/DeviceService.java
  12. 11 0
      svr/svr-cloud-transfor/pom.xml
  13. 44 12
      svr/svr-cloud-transfor/src/main/java/com/yihu/jw/care/controller/TransforController.java
  14. 22 23
      svr/svr-cloud-transfor/src/main/java/com/yihu/jw/care/service/AqgService.java
  15. 3 3
      svr/svr-cloud-transfor/src/main/resources/application.yml
  16. 2 2
      svr/svr-internet-hospital/pom.xml
  17. 89 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  18. 23 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/HcyyPrescriptionCotroller.java

+ 88 - 0
business/base-service/src/main/java/com/yihu/jw/healthCare/service/HealthCareNewService.java

@ -171,6 +171,9 @@ public class HealthCareNewService {
            String signResult = SafeUtil.sign(object.toJSONString(),ylzConfigSignKey);
            obj = SafeUtil.encrypt(signResult,ylzConfigEncryptKey);
            JSONObject jsonObject = JSONObject.parseObject(obj);
          /*  obj = YibaoJiaMi.encryptData(object,ylzConfigSignKey,ylzConfigEncryptKey);
            JSONObject jsonObject = JSONObject.parseObject(obj);*/
            logger.info("请求前funid=="+funid+"data="+data.toJSONString());
            String response = httpClientUtil.postBody(ylzConfigUrl,jsonObject);
            ylzHttpLogDO.setResponseEncrpty(response);
@ -182,6 +185,8 @@ public class HealthCareNewService {
                    if (dataResult!=null&&dataResult!=""){
                        String decryptResult = AES.aesDecrypt(dataResult,ylzConfigEncryptKey);
                        JSONObject dataObject = JSONObject.parseObject(decryptResult);
                 /*       String decryptResult = YibaoJiaMi.decrypt(dataResult,ylzConfigEncryptKey);
                        JSONObject dataObject = JSONObject.parseObject(decryptResult);*/
                        result.put("encrypt_data",dataObject);
                        response = result.toJSONString();
                    }
@ -1408,6 +1413,8 @@ public class HealthCareNewService {
            ylzMedicalRelationDO.setDetailSerial(detailSerial);
            ylzMedicailRelationDao.save(ylzMedicalRelationDO);
            logger.info("医保费用明细上传保存成功");
        }else {
            throw new Exception(object.getString("cause"));
        }
        return result;
    }
@ -1572,6 +1579,9 @@ public class HealthCareNewService {
                ylzMedicalRelationDO.setEnterpriseSupplement(jsonObject.getString("enterprise_supplement"));
                ylzMedicalRelationDO.setJtgjPay(jsonObject.getString("jtgj_pay"));
                ylzMedicalRelationDO.setCollector(jsonObject.getString("collector"));
                ylzMedicalRelationDO.setClrOptins(jsonObject.getString("CLR_OPTINS"));
                ylzMedicalRelationDO.setClrWay(jsonObject.getString("CLR_WAY"));
                ylzMedicalRelationDO.setClrType(jsonObject.getString("CLR_TYPE"));
                BigDecimal b1 = new BigDecimal(ylzMedicalRelationDO.getTcjjPay());
                BigDecimal b2 = new BigDecimal(ylzMedicalRelationDO.getSbjjPay());
                BigDecimal b3 = new BigDecimal(ylzMedicalRelationDO.getGwyPay());
@ -1603,6 +1613,8 @@ public class HealthCareNewService {
                    ylzMb.setCreateTime(new Date());
                    ylzMedicailBillDao.save(ylzMb);
                }
            }else {
                throw new Exception(object.getString("cause"));
            }
        }
@ -1929,6 +1941,82 @@ public class HealthCareNewService {
            String billSerial = jsonObject.getString("bill_serial");
            String personCash = jsonObject.getString("person_cash");
            YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByInsuranceSerial(insuranceSerial);
            JSONObject outybsfJson = new JSONObject();
            JSONObject ybdata = new JSONObject();
            ybdata.put("respond_time",jsonObject.getString("date"));
            ybdata.put("inf_refmsgid",jsonObject.getString("personal_code"));
            ybdata.put("appname","hlwyy");
            ybdata.put("infcode",0);
            ybdata.put("refmsg_time",jsonObject.getString("date"));
            JSONObject output = new JSONObject();
            JSONArray setldetailArray = new JSONArray();
            JSONObject setldetailObj =new JSONObject();
            setldetailObj.put("fund_pay_type_name",jsonObject.getString("treatment_type_name"));
            setldetailObj.put("fund_payamt",jsonObject.getString("account_balance"));
            setldetailObj.put("fund_pay_type",jsonObject.getString("treatment_type"));
            setldetailObj.put("inscp_scp_amt",jsonObject.getString("pay_standard"));
            setldetailArray.add(setldetailObj);
            output.put("setldetail",setldetailArray);
            JSONObject setlinfoObj = new JSONObject();
            setlinfoObj.put("hifp_pay",jsonObject.getString("tcjj_pay"));
            setlinfoObj.put("clr_way",jsonObject.getString("clr_way"));
            setlinfoObj.put("mdtrt_id",jsonObject.getString("insurance_serial"));
            setlinfoObj.put("maf_pay",jsonObject.getString("yljz_pay"));
            setlinfoObj.put("fulamt_ownpay_amt",jsonObject.getString("person_cash"));
            setlinfoObj.put("acct_pay",jsonObject.getString("person_account"));
            setlinfoObj.put("clr_type",jsonObject.getString("clr_type"));
            setlinfoObj.put("fund_pay_sumamt",jsonObject.getString("fund_amount"));
            setlinfoObj.put("certno",jsonObject.getString("idcard"));
            setlinfoObj.put("setl_time",DateUtil.dateToStrLong(DateUtil.strToDate(jsonObject.getString("pay_date")+jsonObject.getString("pay_time"))));
            setlinfoObj.put("clr_optins",jsonObject.getString("clr_optins"));
            setlinfoObj.put("setl_id",jsonObject.getString("bill_serial"));
            setlinfoObj.put("acct_mulaid_pay",jsonObject.getString("jtgj_pay"));
            setlinfoObj.put("psn_type",jsonObject.getString("treatment_type"));
            setlinfoObj.put("hifdm_pay",0);
            setlinfoObj.put("hifmi_pay",0);
            setlinfoObj.put("psn_cert_type",jsonObject.getString("cert_type"));
            setlinfoObj.put("oth_pay",jsonObject.getString("other_pay"));
            setlinfoObj.put("cvlserv_flag","");
            setlinfoObj.put("age","");
            setlinfoObj.put("psn_part_amt",jsonObject.getString("person_cash"));
            setlinfoObj.put("psn_name",jsonObject.getString("sex_mc"));
            setlinfoObj.put("med_type",ylzMedicalRelationDO.getMedicalType());
            setlinfoObj.put("medins_setl_id",billSerial);
            setlinfoObj.put("act_pay_dedc",jsonObject.getString("pay_standard"));
            setlinfoObj.put("gend",jsonObject.getString("sex_mc"));
            setlinfoObj.put("cvlserv_pay",jsonObject.getString("gwy_pay"));
            setlinfoObj.put("hifes_pay",jsonObject.getString("enterprise_supplement"));
            setlinfoObj.put("balc",jsonObject.getString("account_balance"));
            setlinfoObj.put("mdtrt_cert_type",jsonObject.getString("medical_mode"));
            setlinfoObj.put("preselfpay_amt",0);
            setlinfoObj.put("psn_no",jsonObject.getString("personal_code"));
            setlinfoObj.put("psn_cash_pay",jsonObject.getString("person_cash"));
            setlinfoObj.put("insutype",ylzMedicalRelationDO.getInsuranceType());
            setlinfoObj.put("medfee_sumamt",ylzMedicalRelationDO.getTotalAmount());
            JSONObject expContent = new JSONObject();
            JSONArray fplistArray = jsonObject.getJSONArray("fplist");
            JSONArray fpArray = new JSONArray();
            for (int i=0;i<fplistArray.size();i++){
                JSONObject fplist = fplistArray.getJSONObject(i);
                JSONObject fplistObJ = new JSONObject();
                fplistObJ.put("itemSumamt",Double.parseDouble(fplist.getString("project_pay")));
                fplistObJ.put("itemClaaAmt",Double.parseDouble(fplist.getString("invoice_pay")));
                fplistObJ.put("itemClabAmt",Double.parseDouble(fplist.getString("special_pay")));
                fplistObJ.put("itemOthAmt",Double.parseDouble(fplist.getString("uninsurance_pay")));
                fplistObJ.put("itemOwnpayAmt",Double.parseDouble(fplist.getString("own_pay")));
                fplistObJ.put("medChrgitmName",fplist.getString("type_name"));
                fplistObJ.put("medChrgitmType",fplist.getString("type"));
                fpArray.add(fplistObJ);
            }
            expContent.put("fplist",fpArray);
            setlinfoObj.put("exp_content",expContent.toJSONString());
            output.put("setlinfo",setlinfoObj);
            ybdata.put("output",output);
            outybsfJson.put("data",ybdata);
            ylzMedicalRelationDO.setClrType(jsonObject.getString("clr_type"));
            ylzMedicalRelationDO.setClrWay(jsonObject.getString("clr_way"));
            ylzMedicalRelationDO.setClrOptins(jsonObject.getString("clr_optins"));
            ylzMedicalRelationDO.setOutJson(outybsfJson.toJSONString());
            if (ylzMedicalRelationDO!=null){
                if (!ylzMedicalRelationDO.getPersonCash().equalsIgnoreCase(personCash)){
                    throw new Exception("医保结算金额不一致!");

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

@ -1091,7 +1091,7 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    /**
     * 挂号接口
     * @param outPatientId
     * @param doctor
     * @param doctor flag 0自费1医保
     * @return
     */
    public JSONObject registerOutPatient(String outPatientId, String doctor){
@ -1156,7 +1156,7 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        }
        JSONObject res = null;
        try {
            String obj = hcyyEntranceService.registered(doctorFlag,outpatientDO.getDept(),patientMappingDO.getMappingCode(),chargeType,courierflag);
            String obj = hcyyEntranceService.registered(doctorFlag,outpatientDO.getDept(),patientMappingDO.getMappingCode(),chargeType,courierflag,outpatientDO.getMedicalState());
            if (StringUtils.isNoneBlank(obj)){
                res = JSONObject.parseObject(obj);
            }
@ -1648,6 +1648,7 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                        if (ylzMedicalRelationDO==null){
                            ylzMedicalRelationDO = new YlzMedicalRelationDO();
                            ylzMedicalRelationDO.setLogNo(logNo);
                            ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState()));
                            ylzMedicalRelationDO.setRelationCode(outpatientId);
                            ylzMedicalRelationDO.setName(object.getString("PSN_NAME"));
                            ylzMedicalRelationDO.setTotalAmount(object.getString("COST"));
@ -1660,9 +1661,20 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                            ylzMedicalRelationDO.setHisDeptName(object.getString("DEPT_NAME"));
                            ylzMedicalRelationDO.setStatus(0);
                            ylzMedicalRelationDO.setState(0);
                            ylzMedicalRelationDO.setDel(1);
                            ylzMedicalRelationDO.setDataSource("54");
                            ylzMedicalRelationDO.setIdcard(outpatientDO.getIdcard());
                            ylzMedicalRelationDO.setBalance(balance);
                            ylzMedicalRelationDO.setPersonAccount("0");
                            ylzMedicalRelationDO.setMedicalPrice("0");
                            ylzMedicalRelationDO.setCertType("01");
                            ylzMedicalRelationDO.setMedicalMode("10");
                            ylzMedicalRelationDO.setRegionCode("350200");
                            if (StringUtils.isNoneBlank(outpatientDO.getDiseaseCode())){
                                ylzMedicalRelationDO.setMedicalType("13");
                            }else {
                                ylzMedicalRelationDO.setMedicalType("11");
                            }
                            ylzMedicalRelationDO.setHisSettleNo(object.getString("IPT_OTP_NO"));
                            ylzMedicalRelationDO.setCardNo(object.getString("CARD_NO"));
                            ylzMedicalRelationDO.setDate(DateUtil.strToDate(object.getString("BEGNTIME")));
@ -1670,6 +1682,9 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                        }else {
                            ylzMedicalRelationDO.setLogNo(logNo);
                            ylzMedicalRelationDO.setRelationCode(outpatientId);
                            ylzMedicalRelationDO.setDataSource("54");
                            ylzMedicalRelationDO.setDel(1);
                            ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState()));
                            ylzMedicalRelationDO.setName(object.getString("PSN_NAME"));
                            ylzMedicalRelationDO.setTotalAmount(object.getString("COST"));
                            ylzMedicalRelationDO.setPersonCash(object.getString("ORIGIN_CHARGES"));
@ -1682,6 +1697,15 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                            ylzMedicalRelationDO.setPersonAccount("0");
                            ylzMedicalRelationDO.setMedicalPrice("0");
                            ylzMedicalRelationDO.setBalance(balance);
                            ylzMedicalRelationDO.setCertType("01");
                            ylzMedicalRelationDO.setMedicalMode("10");
                            ylzMedicalRelationDO.setRegionCode("350200");
                            if (StringUtils.isNoneBlank(outpatientDO.getDiseaseCode())){
                                ylzMedicalRelationDO.setMedicalType("13");
                            }else {
                                ylzMedicalRelationDO.setMedicalType("11");
                            }
                            ylzMedicalRelationDO.setIdcard(outpatientDO.getIdcard());
                            ylzMedicalRelationDO.setHisSettleNo(object.getString("IPT_OTP_NO"));
                            ylzMedicalRelationDO.setCardNo(object.getString("CARD_NO"));
                            ylzMedicalRelationDO.setDate(DateUtil.strToDate(object.getString("BEGNTIME")));
@ -1693,16 +1717,20 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                        String detailSql =" select * from SST_JSDP_JSMX_GJYB where LOG_NO ='"+logNo+"' ";
                        String detailRes = hcyyEntranceService.getSql(detailSql);
                        List<YlzMedicalMxDO> mxDOList = new ArrayList<>();
                        Integer itemCount = 0;
                        if (StringUtils.isNoneBlank(detailRes)) {
                            JSONObject drs = JSONObject.parseObject(detailRes);
                            Integer dstatus = drs.getInteger("status");
                            if (dstatus != null && dstatus == 200) {
                                JSONArray darray = drs.getJSONArray("detailModelList");
                                itemCount=darray.size();
                                for (int j = 0; j < darray.size(); j++) {
                                    JSONObject dobject = darray.getJSONObject(j);
                                    YlzMedicalMxDO medicalMxDO = new YlzMedicalMxDO();
                                    medicalMxDO.setDel(1);
                                    medicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
                                    medicalMxDO.setCreateTime(new Date());
                                    medicalMxDO.setInvoiceType("01");
                                    medicalMxDO.setItemName(dobject.getString("XMMC00"));
                                    medicalMxDO.setHisDetailSn(dobject.getString("FEEDETL_SN"));
                                    medicalMxDO.setItemCode(dobject.getString("MED_LIST_CODG"));
@ -1711,6 +1739,13 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                                    medicalMxDO.setSpecificationType(dobject.getString(""));
                                    medicalMxDO.setAmount(dobject.getString("CNT"));
                                    medicalMxDO.setPrice(dobject.getString("PRIC"));
                                    medicalMxDO.setPrescriptionCode(dobject.getString("RXNO"));
                                    medicalMxDO.setSpecificationType(dobject.getString("SPECIFICATION_TYPE"));
                                    medicalMxDO.setDosageForm(dobject.getString("DOSAGE_FORM"));
                                    medicalMxDO.setPrescriptionDate(DateUtil.strToDate(object.getString("BEGNTIME")));
                                    medicalMxDO.setActgDate(DateUtil.strToDate(object.getString("BEGNTIME")));
                                    medicalMxDO.setClerkDays(DateUtil.strToDate(object.getString("BEGNTIME")));
                                    medicalMxDO.setPeopleType(null);
                                    medicalMxDO.setSingleDose(dobject.getString("SIN_DOS_DSCR"));
                                    medicalMxDO.setUseFrequency(dobject.getString("USED_FRQU_DSCR"));
                                    medicalMxDO.setMedicationDays(dobject.getString("PRD_DAYS"));
@ -1721,7 +1756,13 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                                    medicalMxDO.setHisDeptName(dobject.getString("BILG_DEPT_NAME"));
                                    medicalMxDO.setMedicalPerId(dobject.getString("BILG_DR_CODG"));
                                    medicalMxDO.setMedicalPerName(dobject.getString("BILG_DR_NAME"));
                                    medicalMxDO.setLimitType(dobject.getString("HOSP_APPR_FLAG"));
                                    if (StringUtils.isNoneBlank(dobject.getString("HOSP_APPR_FLAG"))){
                                        if (dobject.getString("HOSP_APPR_FLAG").equalsIgnoreCase("0")||dobject.getString("HOSP_APPR_FLAG").equalsIgnoreCase("2")){
                                            medicalMxDO.setLimitType("N");
                                        } else if (dobject.getString("HOSP_APPR_FLAG").equalsIgnoreCase("1")) {
                                            medicalMxDO.setLimitType("Y");
                                        }
                                    }
                                    medicalMxDO.setHisItemCode(dobject.getString("MED_LIST_CODG"));
                                    medicalMxDO.setHisItemName(dobject.getString("XMMC00"));
                                    medicalMxDO.setTotalMoney(dobject.getString("DET_ITEM_FEE_SUMAMT"));
@ -1730,11 +1771,13 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                                }
                            }
                        }
                        ylzMedicalRelationDO.setItemCount(itemCount+"");
                        ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
                        ylzMedicalRelationDO.setYlzMedicalMxDOList(mxDOList);
                        List<YlzMedicalIcdDO> icdDOS = new ArrayList<>();
                        ylzMedicailIcdDao.deleteByMedicalId(ylzMedicalRelationDO.getId());
                        //获取诊断
                        String icdSql =" select * from SST_JSDP_JSMX_GJYB where LOG_NO ='"+logNo+"' ";
                        String icdSql =" select * from SST_JSDP_DZMX_GJYB where LOG_NO ='"+logNo+"' ";
                        String icdRes = hcyyEntranceService.getSql(icdSql);
                        if (StringUtils.isNoneBlank(icdRes)) {
                            JSONObject drs = JSONObject.parseObject(icdRes);
@ -1773,61 +1816,124 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                throw new Exception("未找到待结算记录");
            }
            YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByOutpatient(outpatientId);
            if (ylzMedicalRelationDO.getState()==1){
            if (ylzMedicalRelationDO.getState()!=null&&ylzMedicalRelationDO.getState()==1){
                return "已结算";
            }
            BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(ylzMedicalRelationDO.getId());
            ylzMedicalRelationDO.setState(1);
            ylzMedicalRelationDO.setSettleDate(new Date());
            ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
            String sql = "update SST_JSDP_JBXX_GJYB\n" +
                    "   set SETL_ID           = '', \n" +
                    "       ACCT_PAY          = '0',\n" +
                    "       PSN_CASH_PAY      = '"+ylzMedicalRelationDO.getTotalAmount()+"',\n" +
                    "       FUND_PAY_SUMAMT   = '0',\n" +
                    "       CVLSERV_PAY       = '0',\n" +
                    "       PSN_PART_AMT      = '0',\n" +
                    "       HIFMI_PAY         = '0',\n" +
                    "       MEDFEE_SUMAMT     = '"+ylzMedicalRelationDO.getBcwkje()+"',\n" +
                    "       SETL_TIME         = '0',\n" +
                    "       BALC              = '0',\n" +
                    "       ACCT_MULAID_PAY   = '0',\n" +
                    "       HIFOB_PAY         = '0',\n" +
                    "       MDTRT_ID          = '',\n" +
                    "       HIFP_PAY          = '0',\n" +
                    "       MAF_PAY           = '',\n" +
                    "       OTH_PAY           = '0',\n" +
                    "       HIFES_PAY         = '0',\n" +
                    "       OUTCHARGENO       = '"+businessOrderDO.getOrderNo()+"',\n" +
                    "       PSN_CERT_TYPE     = '0',\n" +
                    "       NATY              = '0',\n" +
                    "       BRDY              = '0',\n" +
                    "       CVLSERV_FLAG      = '0',\n" +
                    "       ACT_PAY_DEDC      = '0',\n" +
                    "       PSN_TYPE          = '0',\n" +
                    "       HOSP_PART_AMT     = '0',\n" +
                    "       CLR_OPTINS        = '0',\n" +
                    "       CLR_WAY           = '0',\n" +
                    "       CLR_TYPE          = '0',\n" +
                    "       POOL_PROP_SELFPAY = '0',\n" +
                    "       INSUPLC_ADMDVS    = '',\n" +
                    "       INSUTYPE          = '',\n" +
                    "       PSN_NO            = '',\n" +
                    "       CHANNEL_TYPE      = '',\n" +
                    "       ACSIGN_TYPE       = 'null',\n" +
                    "       MDTRT_CERT_TYPE   = '03',\n" +
                    "       CVL_ACCT_PAY      = '0',\n" +
                    "       CVL_ACCT_BALC     = '0',\n" +
                    "       HL_ACCT_PAY       = '0',\n" +
                    "       HL_ACCT_BALC      = '0',\n" +
                    "       FM_ACCT_BALC      = '0',\n" +
                    "       PUR_ACCT_PAY      = '0'\n" +
                    " where 1 = 1\n" +
                    "   and LOG_NO = '"+ylzMedicalRelationDO.getLogNo()+"'";
            //结算更新
            System.out.println("sql=="+sql);
            String res = hcyyEntranceService.updateUrl(sql);
            String depositType = "";
            String depositAmount = "";
            String outChargeNo = "";
            String orderNo="";
            if (businessOrderDO!=null){
                depositType = businessOrderDO.getDepositType();
                depositAmount = businessOrderDO.getPayPrice()+"";
                outChargeNo = businessOrderDO.getTraceNo();
                orderNo = businessOrderDO.getOrderNo();
            }
            if (ylzMedicalRelationDO.getMedicalState()==null||(ylzMedicalRelationDO.getMedicalState()!=null&&ylzMedicalRelationDO.getMedicalState()==0)){
                String sql = "update SST_JSDP_JBXX_GJYB\n" +
                        "   set SETL_ID           = '', \n" +
                        "       ACCT_PAY          = '0',\n" +
                        "       PSN_CASH_PAY      = '"+ylzMedicalRelationDO.getPersonCash()+"',\n" +
                        "       FUND_PAY_SUMAMT   = '0',\n" +
                        "       CVLSERV_PAY       = '0',\n" +
                        "       PSN_PART_AMT      = '0',\n" +
                        "       HIFMI_PAY         = '0',\n" +
                        "       MEDFEE_SUMAMT     = '"+ylzMedicalRelationDO.getBcwkje()+"',\n" +
                        "       SETL_TIME         = '0',\n" +
                        "       BALC              = '0',\n" +
                        "       ACCT_MULAID_PAY   = '0',\n" +
                        "       HIFOB_PAY         = '0',\n" +
                        "       MDTRT_ID          = '',\n" +
                        "       HIFP_PAY          = '0',\n" +
                        "       MAF_PAY           = '',\n" +
                        "       OTH_PAY           = '0',\n" +
                        "       HIFES_PAY         = '0',\n" +
                        "       OUTCHARGENO       = '"+orderNo+"',\n" +
                        "       PSN_CERT_TYPE     = '0',\n" +
                        "       NATY              = '0',\n" +
                        "       BRDY              = '0',\n" +
                        "       CVLSERV_FLAG      = '0',\n" +
                        "       ACT_PAY_DEDC      = '0',\n" +
                        "       PSN_TYPE          = '0',\n" +
                        "       HOSP_PART_AMT     = '0',\n" +
                        "       CLR_OPTINS        = '0',\n" +
                        "       CLR_WAY           = '0',\n" +
                        "       CLR_TYPE          = '0',\n" +
                        "       POOL_PROP_SELFPAY = '0',\n" +
                        "       INSUPLC_ADMDVS    = '',\n" +
                        "       INSUTYPE          = '',\n" +
                        "       PSN_NO            = '',\n" +
                        "       CHANNEL_TYPE      = '',\n" +
                        "       ACSIGN_TYPE       = 'null',\n" +
                        "       MDTRT_CERT_TYPE   = '03',\n" +
                        "       CVL_ACCT_PAY      = '0',\n" +
                        "       CVL_ACCT_BALC     = '0',\n" +
                        "       HL_ACCT_PAY       = '0',\n" +
                        "       HL_ACCT_BALC      = '0',\n" +
                        "       FM_ACCT_BALC      = '0',\n" +
                        "       PUR_ACCT_PAY      = '0'\n" +
                        " where 1 = 1\n" +
                        "   and LOG_NO = '"+ylzMedicalRelationDO.getLogNo()+"'";
                //结算更新
                System.out.println("sql=="+sql);
                String res = hcyyEntranceService.updateUrl(sql);
            }else {
                String sql = "update SST_JSDP_JBXX_GJYB\n" +
                        "   set SETL_ID      = '"+ylzMedicalRelationDO.getBillSerial()+"',\n" +
                        "       PSN_CASH_PAY      = '"+ylzMedicalRelationDO.getPersonCash()+"',\n" +
                        "       MEDFEE_SUMAMT     = '"+ylzMedicalRelationDO.getBcwkje()+"',\n" +
                        "       HIFOB_PAY         = '0',\n" +
                        "       OUTCHARGENO       = '"+orderNo+"',\n" +
                        "       BRDY              = '0',\n" +
                        "       CVLSERV_FLAG      = '0',\n" +
                        "       HOSP_PART_AMT     = '0',\n" +
                        "       POOL_PROP_SELFPAY = '0',\n" +
                        "       INSUPLC_ADMDVS    = '"+ylzMedicalRelationDO.getAdministrativeArea()+"',\n" +
                        "       INSUTYPE          = '',\n" +
                        "       PSN_NO            = '',\n" +
                        "       CHANNEL_TYPE      = '',\n" +
                        "       ACSIGN_TYPE       = 'null',\n" +
                        "       MDTRT_CERT_TYPE   = '03',\n" +
                        "       CVL_ACCT_PAY      = '0',\n" +
                        "       CVL_ACCT_BALC     = '0',\n" +
                        "       HL_ACCT_PAY       = '0',\n" +
                        "       HL_ACCT_BALC      = '0',\n" +
                        "       FM_ACCT_BALC      = '0',\n" +
                        "       PUR_ACCT_PAY      = '0',\n" +
                        "       CHRG_BCHNO      = '"+ylzMedicalRelationDO.getBillSerial()+"',\n" +
                        "       MDTRT_ID      = '"+ylzMedicalRelationDO.getInsuranceSerial()+"',\n" +
                        "       PSN_CERT_TYPE      = '"+ylzMedicalRelationDO.getCertType()+"',\n" +
                        "       NATY      = '"+ylzMedicalRelationDO.getCertType()+"',\n" +
                        "       PSN_TYPE      = '"+ylzMedicalRelationDO.getTreatmentType()+"',\n" +
                        "       RYDYMC      = '"+ylzMedicalRelationDO.getTreatmentTypeName()+"',\n" +
                        "       YBDYZT      = '"+(StringUtils.isNoneBlank(ylzMedicalRelationDO.getTreatmentStatus())?ylzMedicalRelationDO.getTreatmentStatus():0)+"',\n" +
                        "       YBDYMC      = '"+(StringUtils.isNoneBlank(ylzMedicalRelationDO.getTreatmentStatusName())?ylzMedicalRelationDO.getTreatmentStatusName():"")+"',\n" +
                        "       YDJYLX      = '"+ylzMedicalRelationDO.getAllopatryType()+"',\n" +
                        "       YDLXMC      = '"+ylzMedicalRelationDO.getAllopatryTypeName()+"',\n" +
                        "       ACT_PAY_DEDC = '"+ylzMedicalRelationDO.getPayStandard()+"',\n" +
                        "       HIFP_PAY      = '"+ylzMedicalRelationDO.getTcjjPay()+"',\n" +
                        "       CVLSERV_PAY = '"+ylzMedicalRelationDO.getGwyPay()+"',\n" +
                        "       HIFES_PAY      = '"+ylzMedicalRelationDO.getEnterpriseSupplement()+"',\n" +
                        "       HIFMI_PAY      = '"+ylzMedicalRelationDO.getSbjjPay()+"',\n" +
                        "       MAF_PAY      = '"+ylzMedicalRelationDO.getYljzPay()+"',\n" +
                        "       OTH_PAY      = '"+ylzMedicalRelationDO.getOtherPay()+"',\n" +
                        "       PSN_PART_AMT      = '"+ylzMedicalRelationDO.getPersonCash()+"',\n" +
                        "       ACCT_PAY      = '"+ylzMedicalRelationDO.getPersonAccount()+"',\n" +
                        "       BALC      = '"+ylzMedicalRelationDO.getAccountBalance()+"',\n" +
                        "       ACCT_MULAID_PAY = '"+ylzMedicalRelationDO.getJtgjPay()+"',\n" +
                        "       CLR_WAY = '"+(StringUtils.isNoneBlank(ylzMedicalRelationDO.getClrWay())?ylzMedicalRelationDO.getClrWay():0)+"',\n" +
                        "       CLR_OPTINS = '"+(StringUtils.isNoneBlank(ylzMedicalRelationDO.getClrOptins())?ylzMedicalRelationDO.getClrOptins():0)+"',\n" +
                        "       CLR_TYPE = '"+(StringUtils.isNoneBlank(ylzMedicalRelationDO.getClrType())?ylzMedicalRelationDO.getClrType():0)+"',\n" +
                        "       FUND_PAY_SUMAMT = '"+ylzMedicalRelationDO.getFundPrice()+"',\n" +
                        "       SETL_TIME = '"+DateUtil.dateToStrShort(ylzMedicalRelationDO.getPayDate())+"',\n" +
                        "       OUTYBSFJSON = '"+ylzMedicalRelationDO.getOutJson()+"'\n" +
                        " where 1 = 1\n" +
                        "   and LOG_NO = '"+ylzMedicalRelationDO.getLogNo()+"'";
                //结算更新
                System.out.println("sql=="+sql);
                String res = hcyyEntranceService.updateUrl(sql);
            }
            Map<String,Object> params = new HashedMap();
            String url =entranceUrlLocal +"comfirmSettleMent";
            params.put("mct","03");
@ -1835,38 +1941,73 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            params.put("xtgzh0",ylzMedicalRelationDO.getLogNo());
            HttpResponse response = HttpUtils.doGet(url,params);
            System.out.println("response=="+response.getContent());
            List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutPatientIdList(ylzMedicalRelationDO.getRelationCode());
            /*String */
            String realOrder = "";
            for (WlyyPrescriptionDO prescriptionDO:wlyyPrescriptionDOS){
                if (prescriptionDO.getStatus()==20){
                    WlyyPrescriptionLogDO prescriptionLogDO = new WlyyPrescriptionLogDO();
                    prescriptionLogDO.setCreateTime(new Date());
                    prescriptionLogDO.setStatus(30);
                    prescriptionLogDO.setOutpatientId(prescriptionDO.getOutpatientId());
                    prescriptionLogDO.setPrescriptionCode(prescriptionDO.getId());
                    prescriptionLogDO.setUserCode(prescriptionDO.getPatientCode());
                    prescriptionLogDO.setUserName(prescriptionDO.getPatientName());
                    prescriptionLogDO.setUserType(1);
                    prescriptionLogDO.setDatajson("处方结算");
                    prescriptionLogDao.save(prescriptionLogDO);
                    prescriptionDO.setStatus(30);
                    prescriptionDO.setPayTime(new Date());
                    prescriptionDao.save(prescriptionDO);
                    logger.info("变更处方结算状态成功");
                    realOrder = prescriptionDO.getRealOrder();
            String res = response.getContent();
            boolean flag = true;
            if (StringUtils.isNoneBlank(res)){
                JSONObject jsonObject = JSONObject.parseObject(res);
                String status = jsonObject.getString("status");
                if (status.equalsIgnoreCase("200")){
                    JSONObject obj = jsonObject.getJSONObject("obj");
                    String rs = obj.getString("rs");
                    JSONObject rsObj = JSONObject.parseObject(rs);
                    String retCode = rsObj.getString("retCode");
                    if (retCode.equalsIgnoreCase("99")){
                        flag=false;
                        throw new Exception(rsObj.getString("retMsg"));
                    }
                }else {
                    flag = false;
                }
            }
            if (flag){
                ylzMedicalRelationDO.setState(1);
                ylzMedicalRelationDO.setSettleDate(new Date());
                ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
                List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutPatientIdList(ylzMedicalRelationDO.getRelationCode());
                /*String */
                String realOrder = "";
                for (WlyyPrescriptionDO prescriptionDO:wlyyPrescriptionDOS){
                    if (prescriptionDO.getStatus()==20){
                        WlyyPrescriptionLogDO prescriptionLogDO = new WlyyPrescriptionLogDO();
                        prescriptionLogDO.setCreateTime(new Date());
                        prescriptionLogDO.setStatus(30);
                        prescriptionLogDO.setOutpatientId(prescriptionDO.getOutpatientId());
                        prescriptionLogDO.setPrescriptionCode(prescriptionDO.getId());
                        prescriptionLogDO.setUserCode(prescriptionDO.getPatientCode());
                        prescriptionLogDO.setUserName(prescriptionDO.getPatientName());
                        prescriptionLogDO.setUserType(1);
                        prescriptionLogDO.setDatajson("处方结算");
                        prescriptionLogDao.save(prescriptionLogDO);
                        prescriptionDO.setStatus(30);
                        prescriptionDO.setVoucherNo(ylzMedicalRelationDO.getHisBillSerial());
                        prescriptionDO.setPayTime(new Date());
                        prescriptionDao.save(prescriptionDO);
                        logger.info("变更处方结算状态成功");
                        realOrder = prescriptionDO.getRealOrder();
                    }
                    try {
                        sfToHis(outpatientId, realOrder);
                    }catch (Exception e){
                        e.printStackTrace();
                    }
                }
                try {
                    sfToHis(outpatientId, realOrder);
                    logger.info("=================电子发票开具开始=================");
                    hcyyEntranceService.OutpatientInvoicing(ylzMedicalRelationDO.getHisBillSerial(),"lb");
                    logger.info("=================电子发票开具结束=================");
                }catch (Exception e){
                    e.printStackTrace();
                }
                return "结算成功!";
            }else {
                throw new Exception("结算失败!");
            }
            return "结算成功!";
        }catch (Exception e){
            e.printStackTrace();
            return "结算失败";
            throw new Exception(e.getMessage());
        }
    }

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

@ -42,7 +42,6 @@ import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import com.yihu.jw.entity.hospital.doctor.WlyyDoctorOnlineTimeDO;
import com.yihu.jw.entity.hospital.doctor.WlyyDoctorWorkTimeDO;
import com.yihu.jw.entity.hospital.doctor.WlyyPatientRegisterTimeDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalIcdDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalMxDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalRelationDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
@ -64,7 +63,6 @@ import com.yihu.jw.hospital.doctor.dao.DoctorWorkTimeDao;
import com.yihu.jw.hospital.doctor.dao.PatientRegisterTimeDao;
import com.yihu.jw.hospital.doctor.dao.WlyyDoctorOnlineTimeDao;
import com.yihu.jw.hospital.drugstore.dao.BaseDrugStoreDao;
import com.yihu.jw.hospital.family.dao.WlyyNatPatientFamilyMemberDao;
import com.yihu.jw.hospital.healthCare.YlzMedicailMxDao;
import com.yihu.jw.hospital.healthCare.YlzMedicailRelationDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
@ -95,7 +93,6 @@ import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.restmodel.web.*;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.sms.dao.BaseSmsTemplateDao;
import com.yihu.jw.sms.service.ZhongShanSMSService;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.LatitudeUtils;
@ -116,7 +113,6 @@ import com.yihu.jw.wechat.service.BaseSensitiveFilterWordsService;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import com.yihu.jw.yx.dao.YxTokenMappingDao;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import com.ylzinfo.ehc.EhcHandler;
import com.ylzinfo.ehc.common.utils.DateUtils;
@ -144,9 +140,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.print.DocFlavor;
import javax.validation.constraints.Null;
import java.beans.Transient;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.Boolean;
@ -7273,6 +7266,98 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        System.out.println("old"+(new Date().getTime()-statr));
        return envelop;
    }
    /**
     * 查找有专家问诊排班的医院
     */
    @Transactional(readOnly = true)
    public MixEnvelop findHospitalByZJ(String iswork, String orgName, String outpatientType,
                                       String workingTime, Integer page, Integer pagesize) {
        long statr = new Date().getTime();
        String sql = "SELECT " +
                " distinct o.name AS \"orgName\"," +
                " h.org_code AS \"orgCode\",o.photo AS \"photo\" " ;
        sql+=" FROM " +
                " base_doctor d " +
                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
                " LEFT JOIN base_org o on o.code = h.org_code ";
        Map<String, Object> params = new HashedMap();
        Date date = new Date();
        if (StringUtils.isNotBlank(workingTime)) {
            sql += " JOIN wlyy_doctor_work_time wk on wk.doctor = d.id ";
        }
        sql += " WHERE h.del = '1' ";
        if (StringUtils.isNotBlank(iswork) && "1".equals(iswork)) {
            logger.info("iswork:" + iswork);
            sql += " AND (" +
                    " EXISTS ( " +
                    " SELECT " +
                    "  1 " +
                    " FROM " +
                    "  wlyy_doctor_work_time t " +
                    " WHERE " +
                    "  t.doctor = d.id " +
                    " AND t.start_time <=:startTime" +
                    " AND t.end_time >=:endTime" +
                    " ) OR " +
                    " d.consult_status = '1') ";
            params.put("startTime", date);
            params.put("endTime", date);
        }
        if (StringUtils.isNotBlank(orgName)) {
            sql += " AND h.org_name like :orgName";
            params.put("orgName", "%" + orgName + "%");
        }
        if (StringUtils.isNotBlank(outpatientType)) {
            if (outpatientType.contains("or")) {
                String[] outpatientTypeArray = outpatientType.split("or");
                sql += " AND ( ";
                for (int i = 0; i < outpatientTypeArray.length; i++) {
                    sql += " d.outpatient_type like'%" + outpatientTypeArray[i] + "%'";
                    if (i != outpatientTypeArray.length - 1) {
                        sql += " or ";
                    }
                }
                sql += " ) ";
            } else {
                sql += " AND d.outpatient_type like'%" + outpatientType + "%'";
            }
        } else {
            sql += " AND d.outpatient_type is not null ";
        }
        if (StringUtils.isNotBlank(workingTime)) {
            sql += " AND wk.work_date = :workingTime ";
            params.put("workingTime", workingTime);
        }
        sql +=" and d.del='1' and o.del='1' order by o.sort ";
        String sqlCount = "select count(1) as \"total\" from ( "+sql+" ) t";
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params, page, pagesize);
        List<Map<String, Object>> listCount = hibenateUtils.createSQLQuery(sqlCount, params);
        Long count = 0L;
        if(listCount!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            count = hibenateUtils.objTransformLong(listCount.get(0).get("total"));
        }
        logger.info("findHospitalByZJ end:" + DateUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss:SSS"));
        logger.info("sql:" + sql);
        MixEnvelop envelop =new MixEnvelop();
        envelop.setDetailModelList(list);
        envelop.setTotalCount(count.intValue());
        envelop.setPageSize(pagesize);
        envelop.setCurrPage(page);
        System.out.println("old"+(new Date().getTime()-statr));
        return envelop;
    }
    /**
     * 获取常见疾病、热门部门、医生拒绝接诊原因 字典
     *
@ -10318,6 +10403,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                } catch (Exception e) {
                    e.printStackTrace();
                    throw new Exception(e.getMessage());
                }
            }
            prescriptionLogService.addPrescriptionLog(prescriptionId, 20, 2, operate, operateName, reason, new Date());

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

@ -136,9 +136,9 @@ public class HcyyEntranceService {
    private JdbcTemplate jdbcTemplate;
    private static String key="bvvsf3JA0mUXMU+mVnMaOQ==";
    private static String key="ydxtMEQmPymRtfz15lW76Tne88pHcuAU8WygMu/TrTKPRY5G7jttcg==";
    private static String caKey = "bvvsf3JA0mUXMU+mVnMaOQ==";
    private static String caKey = "ydxtMEQmPymRtfz15lW76Tne88pHcuAU8WygMu/TrTKPRY5G7jttcg==";
    private static String checkKey = "ydxtMEQmPymRtfz15lW76Tne88pHcuAU8WygMu/TrTKPRY5G7jttcg==";
@ -403,6 +403,7 @@ public class HcyyEntranceService {
                            doctor.setTownName("海沧区");
                            doctor.setCityCode("350200");
                            doctor.setCityName("厦门市");
                            doctor.setAtddrNo(doctorJson.getString("COUNTRY_CODE"));
                            if (!"[]".equalsIgnoreCase(doctorJson.getString("expertise"))&&StringUtils.isNoneBlank(doctorJson.getString("expertise"))){
                                doctor.setExpertise(doctorJson.getString("expertise"));
                            }
@ -437,12 +438,12 @@ public class HcyyEntranceService {
                                    doctorHospitalDao.save(hospitalDO);
                                }
                            }
                            List<DoctorMappingDO> doctorMappingDOS = doctorMappingDao.findByOrgCodeAndMappingCode("350211A5010",doctorJson.getString("code"));
                            List<DoctorMappingDO> doctorMappingDOS = doctorMappingDao.findByOrgCodeAndMappingCode("350211A1002",doctorJson.getString("code"));
                            if (doctorMappingDOS!=null&&doctorMappingDOS.size()!=0){
                                DoctorMappingDO doctorMappingDO = doctorMappingDOS.get(0);
                                doctorMappingDO.setIdcard(idcard);
                                doctorMappingDO.setDoctor(doctor.getId());
                                doctorMappingDO.setOrgCode("350211A5022");
                                doctorMappingDO.setOrgCode("350211A1002");
                                doctorMappingDO.setOrgName("海沧医院");
                                doctorMappingDO.setMappingCode(doctorJson.getString("code"));
                                doctorMappingDO.setMappingName(doctorJson.getString("name"));
@ -457,7 +458,7 @@ public class HcyyEntranceService {
                                DoctorMappingDO doctorMappingDO = new DoctorMappingDO();
                                doctorMappingDO.setIdcard(idcard);
                                doctorMappingDO.setDoctor(doctor.getId());
                                doctorMappingDO.setOrgCode("350211A5022");
                                doctorMappingDO.setOrgCode("350211A1002");
                                doctorMappingDO.setOrgName("海沧医院");
                                doctorMappingDO.setMappingCode(doctorJson.getString("code"));
                                doctorMappingDO.setMappingName(doctorJson.getString("name"));
@ -482,6 +483,7 @@ public class HcyyEntranceService {
                            doctor.setProvinceName("福建省");
                            doctor.setTownCode("350205");
                            doctor.setTownName("海沧区");
                            doctor.setAtddrNo(doctorJson.getString("COUNTRY_CODE"));
                            doctor.setCityCode("350200");
                            doctor.setCityName("厦门市");
                            if (!"[]".equalsIgnoreCase(doctorJson.getString("expertise"))&&StringUtils.isNoneBlank(doctorJson.getString("expertise"))){
@ -1087,7 +1089,7 @@ public class HcyyEntranceService {
     * @throws Exception
     */
    //挂号(调his后台包)
    public String registered(String doctor,String dept,String sickId,String clinicclass,String courierflag)throws Exception{
    public String registered(String doctor,String dept,String sickId,String clinicclass,String courierflag,String flag)throws Exception{
        String api = "Registered";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
@ -1115,6 +1117,10 @@ public class HcyyEntranceService {
        if (!StringUtils.isEmpty(courierflag)&&!courierflag.equalsIgnoreCase("null")){
            condition +="<courierflag>"+courierflag+"</courierflag>";
        }
        if (!StringUtils.isEmpty(flag)&&!flag.equalsIgnoreCase("null")){
            condition +="<flag>"+flag+"</flag>";
        }
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
@ -1804,6 +1810,7 @@ public class HcyyEntranceService {
        wlyyHttpLogDO.setRequest(msgBody);
        wlyyHttpLogDO.setName("保存电子病历");
        wlyyHttpLogDO.setCreateTime(new Date());
        wlyyHttpLogDO = wlyyHttpLogDao.save(wlyyHttpLogDO);
        logger.info("returnEmrHtmlByHLW params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
        logger.info("returnEmrHtmlByHLW json:"+xml);
@ -1957,7 +1964,7 @@ public class HcyyEntranceService {
                "</root>";
        String condition ="";
        if (!StringUtils.isEmpty(bstrEmrID)){
            condition += "<bstrEmrID>"+bstrEmrID+"</bstrEmrID>";
            condition += "<emrId>"+bstrEmrID+"</emrId>";
        }
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
@ -3172,4 +3179,75 @@ public class HcyyEntranceService {
    //===========================结算==================================
    //===========================电票接口===============================
    /**
     * 电票下载接口
     * @return
     */
    public String downloadinvoice(String settleNo)throws Exception{
        String api = "downloadinvoice";
        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.isNoneBlank(settleNo)){
            condition = "<SETTLE_NO>"+settleNo+"</SETTLE_NO>";
        }
        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("downloadinvoice params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("downloadinvoice json:"+json);
        return json;
    }
    /**
     * 电票开具接口
     * @return
     */
    public String OutpatientInvoicing(String settleNo,String operator)throws Exception{
        String api = "OutpatientInvoicing";
        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.isNoneBlank(settleNo)){
            condition += "<SETTLE_NO>"+settleNo+"</SETTLE_NO>";
        }
        if (StringUtils.isNoneBlank(operator)){
            condition += "<OPERATOR>"+operator+"</OPERATOR>";
        }
        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("OutpatientInvoicing params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("OutpatientInvoicing json:"+json);
        return json;
    }
    //===========================电票接口===============================
}

+ 930 - 0
common/common-entity/sql/mysql关键字大全.sql

@ -0,0 +1,930 @@
关键字
A
ACCESSIBLE
ACCOUNT
ACTION
ACTIVE
ADD
ADMIN
AFTER
AGAINST
AGGREGATE
ALGORITHM
ALL
ALTER
ALWAYS
ANALYSE
ANALYZE
AND
ANY
ARRAY
AS
ASC
ASCII
ASENSITIVE
AT
ATTRIBUTE
AUTHENTICATION
AUTOEXTEND_SIZE
AUTO_INCREMENT
AVG
AVG_ROW_LENGTH
B
BACKUP
BEFORE
BEGIN
BETWEEN
BIGINT
BINARY
BINLOG
BIT
BLOB
BLOCK
BOOL
BOOLEAN
BOTH
BTREE
BUCKETS
BY
BYTE
C
CACHE
CALL
CASCADE
CASCADED
CASE
CATALOG_NAME
CHAIN
CHALLENGE_RESPONSE
CHANGE
CHANGED
CHANNEL
CHAR
CHARACTER
CHARSET
CHECK
CHECKSUM
CIPHER
CLASS_ORIGIN
CLIENT
CLONE
CLOSE
COALESCE
CODE
COLLATE
COLLATION
COLUMN
COLUMNS
COLUMN_FORMAT
COLUMN_NAME
COMMENT
COMMIT
COMMITTED
COMPACT
COMPLETION
COMPONENT
COMPRESSED
COMPRESSION
CONCURRENT
CONDITION
CONNECTION
CONSISTENT
CONSTRAINT
CONSTRAINT_CATALOG
CONSTRAINT_NAME
CONSTRAINT_SCHEMA
CONTAINS
CONTEXT
CONTINUE
CONVERT
CPU
CREATE
CROSS
CUBE
CUME_DIST
CURRENT
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
CURRENT_USER
CURSOR
CURSOR_NAME
D
DATA
DATABASE
DATABASES
DATAFILE
DATE
DATETIME
DAY
DAY_HOUR
DAY_MICROSECOND
DAY_MINUTE
DAY_SECOND
DEALLOCATE
DEC
DECIMAL
DECLARE
DEFAULT
DEFAULT_AUTH
DEFINER
DEFINITION
DELAYED
DELAY_KEY_WRITE
DELETE
DENSE_RANK
DESC
DESCRIBE
DESCRIPTION
DES_KEY_FILE
DETERMINISTIC
DIAGNOSTICS
DIRECTORY
DISABLE
DISCARD
DISK
DISTINCT
DISTINCTROW
DIV
DO
DOUBLE
DROP
DUAL
DUMPFILE
DUPLICATE
DYNAMIC
E
EACH
ELSE
ELSEIF
EMPTY
ENABLE
ENCLOSED
ENCRYPTION
END
ENDS
ENFORCED
ENGINE
ENGINES
ENGINE_ATTRIBUTE
ENUM
ERROR
ERRORS
ESCAPE
ESCAPED
EVENT
EVENTS
EVERY
EXCEPT
EXCHANGE
EXCLUDE
EXECUTE
EXISTS
EXIT
EXPANSION
EXPIRE
EXPLAIN
EXPORT
EXTENDED
EXTENT_SIZE
F
FACTOR
FAILED_LOGIN_ATTEMPTS
FALSE
FAST
FAULTS
FETCH
FIELDS
FILE
FILE_BLOCK_SIZE
FILTER
FINISH
FIRST
FIRST_VALUE
FIXED
FLOAT
FLOAT4
FLOAT8
FLUSH
FOLLOWING
FOLLOWS
FOR
FORCE
FOREIGN
FORMAT
FOUND
FROM
FULL
FULLTEXT
FUNCTION
G
GENERAL
GENERATED
GEOMCOLLECTION
GEOMETRY
GEOMETRYCOLLECTION
GET
GET_FORMAT
GET_MASTER_PUBLIC_KEY
GET_SOURCE_PUBLIC_KEY
GLOBAL
GRANT
GRANTS
GROUP
GROUPING
GROUPS
GROUP_REPLICATION
H
HANDLER
HASH
HAVING
HELP
HIGH_PRIORITY
HISTOGRAM
HISTORY
HOST
HOSTS
HOUR
HOUR_MICROSECOND
HOUR_MINUTE
HOUR_SECOND
I
IDENTIFIED
IF
IGNORE
IGNORE_SERVER_IDS
IMPORT
IN
INACTIVE
INDEX
INDEXES
INFILE
INITIAL
INITIAL_SIZE
INITIATE
INNER
INOUT
INSENSITIVE
INSERT
INSERT_METHOD
INSTALL
INSTANCE
INT
INT1
INT2
INT3
INT4
INT8
INTEGER
INTERVAL
INTO
INVISIBLE
INVOKER
IO
IO_AFTER_GTIDS
IO_BEFORE_GTIDS
IO_THREAD
IPC
IS
ISOLATION
ISSUER
ITERATE
J
JOIN
JSON
JSON_TABLE
JSON_VALUE
K
KEY
KEYRING
KEYS
KEY_BLOCK_SIZE
KILL
L
LAG
LANGUAGE
LAST
LAST_VALUE
LATERAL
LEAD
LEADING
LEAVE
LEAVES
LEFT
LESS
LEVEL
LIKE
LIMIT
LINEAR
LINES
LINESTRING
LIST
LOAD
LOCAL
LOCALTIME
LOCALTIMESTAMP
LOCK
LOCKED
LOCKS
LOGFILE
LOGS
LONG
LONGBLOB
LONGTEXT
LOOP
LOW_PRIORITY
M
MASTER
MASTER_AUTO_POSITION
MASTER_BIND
MASTER_COMPRESSION_ALGORITHMS
MASTER_CONNECT_RETRY
MASTER_DELAY
MASTER_HEARTBEAT_PERIOD
MASTER_HOST
MASTER_LOG_FILE
MASTER_LOG_POS
MASTER_PASSWORD
MASTER_PORT
MASTER_PUBLIC_KEY_PATH
MASTER_RETRY_COUNT
MASTER_SERVER_ID
MASTER_SSL
MASTER_SSL_CA
MASTER_SSL_CAPATH
MASTER_SSL_CERT
MASTER_SSL_CIPHER
MASTER_SSL_CRL
MASTER_SSL_CRLPATH
MASTER_SSL_KEY
MASTER_SSL_VERIFY_SERVER_CERT
MASTER_TLS_CIPHERSUITES
MASTER_TLS_VERSION
MASTER_USER
MASTER_ZSTD_COMPRESSION_LEVEL
MATCH
MAXVALUE
MAX_CONNECTIONS_PER_HOUR
MAX_QUERIES_PER_HOUR
MAX_ROWS
MAX_SIZE
MAX_UPDATES_PER_HOUR
MAX_USER_CONNECTIONS
MEDIUM
MEDIUMBLOB
MEDIUMINT
MEDIUMTEXT
MEMBER
MEMORY
MERGE
MESSAGE_TEXT
MICROSECOND
MIDDLEINT
MIGRATE
MINUTE
MINUTE_MICROSECOND
MINUTE_SECOND
MIN_ROWS
MOD
MODE
MODIFIES
MODIFY
MONTH
MULTILINESTRING
MULTIPOINT
MULTIPOLYGON
MUTEX
MYSQL_ERRNO
N
NAME
NAMES
NATIONAL
NATURAL
NCHAR
NDB
NDBCLUSTER
NESTED
NETWORK_NAMESPACE
NEVER
NEW
NEXT
NO
NODEGROUP
NONE
NOT
NOWAIT
NO_WAIT
NO_WRITE_TO_BINLOG
NTH_VALUE
NTILE
NULL
NULLS
NUMBER
NUMERIC
NVARCHAR
O
OF
OFF
OFFSET
OJ
OLD
ON
ONE
ONLY
OPEN
OPTIMIZE
OPTIMIZER_COSTS
OPTION
OPTIONAL
OPTIONALLY
OPTIONS
OR
ORDER
ORDINALITY
ORGANIZATION
OTHERS
OUT
OUTER
OUTFILE
OVER
OWNER
P
PACK_KEYS
PAGE
PARSER
PARTIAL
PARTITION
PARTITIONING
PARTITIONS
PASSWORD
PASSWORD_LOCK_TIME
PATH
PERCENT_RANK
PERSIST
PERSIST_ONLY
PHASE
PLUGIN
PLUGINS
PLUGIN_DIR
POINT
POLYGON
PORT
PRECEDES
PRECEDING
PRECISION
PREPARE
PRESERVE
PREV
PRIMARY
PRIVILEGES
PRIVILEGE_CHECKS_USER
PROCEDURE
PROCESS
PROCESSLIST
PROFILE
PROFILES
PROXY
PURGE
Q
QUARTER
QUERY
QUICK
R
RANDOM
RANGE
RANK
READ
READS
READ_ONLY
READ_WRITE
REAL
REBUILD
RECOVER
RECURSIVE
REDOFILE
REDO_BUFFER_SIZE
REDUNDANT
REFERENCE
REFERENCES
REGEXP
REGISTRATION
RELAY
RELAYLOG
RELAY_LOG_FILE
RELAY_LOG_POS
RELAY_THREAD
RELEASE
RELOAD
REMOTE
REMOVE
RENAME
REORGANIZE
REPAIR
REPEAT
REPEATABLE
REPLACE
REPLICA
REPLICAS
REPLICATE_DO_DB
REPLICATE_DO_TABLE
REPLICATE_IGNORE_DB
REPLICATE_IGNORE_TABLE
REPLICATE_REWRITE_DB
REPLICATE_WILD_DO_TABLE
REPLICATE_WILD_IGNORE_TABLE
REPLICATION
REQUIRE
REQUIRE_ROW_FORMAT
RESET
RESIGNAL
RESOURCE
RESPECT
RESTART
RESTORE
RESTRICT
RESUME
RETAIN
RETURN
RETURNED_SQLSTATE
RETURNING
RETURNS
REUSE
REVERSE
REVOKE
RIGHT
RLIKE
ROLE
ROLLBACK
ROLLUP
ROTATE
ROUTINE
ROW
ROWS
ROW_COUNT
ROW_FORMAT
ROW_NUMBER
RTREE
S
SAVEPOINT
SCHEDULE
SCHEMA
SCHEMAS
SCHEMA_NAME
SECOND
SECONDARY
SECONDARY_ENGINE
SECONDARY_ENGINE_ATTRIBUTE
SECONDARY_LOAD
SECONDARY_UNLOAD
SECOND_MICROSECOND
SECURITY
SELECT
    SENSITIVE
        SEPARATOR
    SERIAL
    SERIALIZABLE
    SERVER
    SESSION
SET
    SHARE
    SHOW
    SHUTDOWN
    SIGNAL
    SIGNED
    SIMPLE
    SKIP
    SLAVE
    SLOW
    SMALLINT
    SNAPSHOT
    SOCKET
    SOME
    SONAME
    SOUNDS
    SOURCE
    SOURCE_AUTO_POSITION
    SOURCE_BIND
    SOURCE_COMPRESSION_ALGORITHMS
    SOURCE_CONNECT_RETRY
    SOURCE_DELAY
    SOURCE_HEARTBEAT_PERIOD
    SOURCE_HOST
    SOURCE_LOG_FILE
    SOURCE_LOG_POS
    SOURCE_PASSWORD
    SOURCE_PORT
    SOURCE_PUBLIC_KEY_PATH
    SOURCE_RETRY_COUNT
    SOURCE_SSL
    SOURCE_SSL_CA
    SOURCE_SSL_CAPATH
    SOURCE_SSL_CERT
    SOURCE_SSL_CIPHER
    SOURCE_SSL_CRL
    SOURCE_SSL_CRLPATH
    SOURCE_SSL_KEY
    SOURCE_SSL_VERIFY_SERVER_CERT
    SOURCE_TLS_CIPHERSUITES
    SOURCE_TLS_VERSION
    SOURCE_USER
    SOURCE_ZSTD_COMPRESSION_LEVEL
    SPATIAL
    SPECIFIC
    SQL
    SQLEXCEPTION
    SQLSTATE
    SQLWARNING
    SQL_AFTER_GTIDS
    SQL_AFTER_MTS_GAPS
    SQL_BEFORE_GTIDS
    SQL_BIG_RESULT
    SQL_BUFFER_RESULT
    SQL_CACHE
    SQL_CALC_FOUND_ROWS
    SQL_NO_CACHE
    SQL_SMALL_RESULT
    SQL_THREAD
    SQL_TSI_DAY
    SQL_TSI_HOUR
    SQL_TSI_MINUTE
    SQL_TSI_MONTH
    SQL_TSI_QUARTER
    SQL_TSI_SECOND
    SQL_TSI_WEEK
    SQL_TSI_YEAR
    SRID
    SSL
    STACKED
START
    STARTING
    STARTS
    STATS_AUTO_RECALC
    STATS_PERSISTENT
    STATS_SAMPLE_PAGES
    STATUS
    STOP
    STORAGE
    STORED
    STRAIGHT_JOIN
    STREAM
    STRING
    SUBCLASS_ORIGIN
    SUBJECT
    SUBPARTITION
    SUBPARTITIONS
    SUPER
    SUSPEND
    SWAPS
    SWITCHES
    SYSTEM
    T
    TABLE
    TABLES
    TABLESPACE
    TABLE_CHECKSUM
    TABLE_NAME
    TEMPORARY
    TEMPTABLE
    TERMINATED
    TEXT
    THAN
    THEN
    THREAD_PRIORITY
    TIES
    TIME
    TIMESTAMP
    TIMESTAMPADD
    TIMESTAMPDIFF
    TINYBLOB
    TINYINT
    TINYTEXT
    TLS
    TO
    TRAILING
    TRANSACTION
    TRIGGER
    TRIGGERS
    TRUE
    TRUNCATE
    TYPE
    TYPES
    U
    UNBOUNDED
    UNCOMMITTED
    UNDEFINED
    UNDO
    UNDOFILE
    UNDO_BUFFER_SIZE
    UNICODE
    UNINSTALL
UNION
UNIQUE
UNKNOWN
UNLOCK
UNREGISTER
UNSIGNED
UNTIL
UPDATE
    UPGRADE
    USAGE
    USE
    USER
    USER_RESOURCES
    USE_FRM
    USING
    UTC_DATE
    UTC_TIME
    UTC_TIMESTAMP
    V
    VALIDATION
    VALUE
VALUES
    VARBINARY
    VARCHAR
    VARCHARACTER
    VARIABLES
    VARYING
    VCPU
    VIEW
    VIRTUAL
    VISIBLE
    W
    WAIT
    WARNINGS
    WEEK
    WEIGHT_STRING
    WHEN
WHERE
    WHILE
    WINDOW
WITH
    WITHOUT
    WORK
    WRAPPER
    WRITE
    X
    X509
    XA
    XID
    XML
    XOR
    Y
    YEAR
    YEAR_MONTH
    Z
    ZEROFILL
    ZONE
    A
    ACTIVE
    ADMIN
    ARRAY
    ATTRIBUTE
    AUTHENTICATION
    B
    BUCKETS
    C
    CHALLENGE_RESPONSE
    CLONE
    COMPONENT
    CUME_DIST
    D
    DEFINITION
    DENSE_RANK
    DESCRIPTION
    E
    EMPTY
    ENFORCED
    ENGINE_ATTRIBUTE
    EXCEPT
    EXCLUDE
    F
    FACTOR
    FAILED_LOGIN_ATTEMPTS
    FINISH
    FIRST_VALUE
    FOLLOWING
    G
    GEOMCOLLECTION
    GET_MASTER_PUBLIC_KEY
    GET_SOURCE_PUBLIC_KEY
    GROUPING
    GROUPS
    H
    HISTOGRAM
    HISTORY
    I
    INACTIVE
    INITIAL
    INITIATE
    INVISIBLE
    J
    JSON_TABLE
    JSON_VALUE
    K
    KEYRING
    L
    LAG
    LAST_VALUE
    LATERAL
    LEAD
    LOCKED
    M
    MASTER_COMPRESSION_ALGORITHMS
    MASTER_PUBLIC_KEY_PATH
    MASTER_TLS_CIPHERSUITES
    MASTER_ZSTD_COMPRESSION_LEVEL
    MEMBER
    N
    NESTED
    NETWORK_NAMESPACE
    NOWAIT
    NTH_VALUE
    NTILE
    NULLS
    O
    OF
    OFF
    OJ
    OLD
    OPTIONAL
    ORDINALITY
    ORGANIZATION
    OTHERS
    OVER
    P
    PASSWORD_LOCK_TIME
    PATH
    PERCENT_RANK
    PERSIST
    PERSIST_ONLY
    PRECEDING
    PRIVILEGE_CHECKS_USER
    PROCESS
    R
    RANDOM
    RANK
    RECURSIVE
    REFERENCE
    REGISTRATION
    REPLICA
    REPLICAS
    REQUIRE_ROW_FORMAT
    RESOURCE
    RESPECT
    RESTART
    RETAIN
    RETURNING
    REUSE
    ROLE
    ROW_NUMBER
    S
    SECONDARY
    SECONDARY_ENGINE
    SECONDARY_ENGINE_ATTRIBUTE
    SECONDARY_LOAD
    SECONDARY_UNLOAD
    SKIP
    SOURCE_AUTO_POSITION
    SOURCE_BIND
    SOURCE_COMPRESSION_ALGORITHMS
    SOURCE_CONNECT_RETRY
    SOURCE_DELAY
    SOURCE_HEARTBEAT_PERIOD
    SOURCE_HOST
    SOURCE_LOG_FILE
    SOURCE_LOG_POS
    SOURCE_PASSWORD
    SOURCE_PORT
    SOURCE_PUBLIC_KEY_PATH
    SOURCE_RETRY_COUNT
    SOURCE_SSL
    SOURCE_SSL_CA
    SOURCE_SSL_CAPATH
    SOURCE_SSL_CERT
    SOURCE_SSL_CIPHER
    SOURCE_SSL_CRL
    SOURCE_SSL_CRLPATH
    SOURCE_SSL_KEY
    SOURCE_SSL_VERIFY_SERVER_CERT
    SOURCE_TLS_CIPHERSUITES
    SOURCE_TLS_VERSION
    SOURCE_USER
    SOURCE_ZSTD_COMPRESSION_LEVEL
    SRID
    STREAM
    SYSTEM
    T
    THREAD_PRIORITY
    TIES
    TLS
    U
    UNBOUNDED
    UNREGISTER
    V
    VCPU
    VISIBLE
    W
    WINDOW
    Z
    ZONE

+ 4 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DevicePatientHealthIndex.java

@ -21,11 +21,11 @@ public class DevicePatientHealthIndex extends IdEntity {
	private String user;
	// 干预标志
	private String intervene;
	// 血糖/收缩压/体重/腰围/早餐前空腹
	// 血糖/收缩压/体重/腰围/早餐前空腹/血氧百分比
	private String value1;
	// 舒张压/早餐后空腹/身高
	// 舒张压/早餐后空腹/身高/血氧报警上限
	private String value2;
	// 午餐空腹/BMI
	// 午餐空腹/BMI/血氧报警下限
	private String value3;
	// 午餐后/偏胖-1/正常0/偏瘦1
	private String value4;
@ -36,7 +36,7 @@ public class DevicePatientHealthIndex extends IdEntity {
	// 睡前
	private String value7;
	// 健康指标类型(1血糖,2血压,3体重/身高/BMI,4腰围,5心率,6体温,7呼吸)
	// 健康指标类型(1血糖,2血压,3体重/身高/BMI,4腰围,5心率,6体温,7呼吸,8血氧)
	private Integer type;
	// 记录时间
	private Date recordDate;

+ 39 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/healthCare/YlzMedicalRelationDO.java

@ -94,6 +94,45 @@ public class YlzMedicalRelationDO extends UuidIdentityEntity {
    private Date settleDate;//his结算时间
    private String bcwkje;//本次未扣费用
    private String clrOptins;//清算经办机构
    private String clrWay;//清算方式
    private String clrType;//清算类别
    private String outJson;//海沧his需要
    public String getOutJson() {
        return outJson;
    }
    public void setOutJson(String outJson) {
        this.outJson = outJson;
    }
    public String getClrOptins() {
        return clrOptins;
    }
    public void setClrOptins(String clrOptins) {
        this.clrOptins = clrOptins;
    }
    public String getClrWay() {
        return clrWay;
    }
    public void setClrWay(String clrWay) {
        this.clrWay = clrWay;
    }
    public String getClrType() {
        return clrType;
    }
    public void setClrType(String clrType) {
        this.clrType = clrType;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name="settle_date")
    public Date getSettleDate() {

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

@ -54,7 +54,7 @@ public class HcyyService {
    @Autowired
    private OauthRsaKeyDao rsaKeyDao;
    private static String caKey ="bvvsf3JA0mUXMU+mVnMaOQ==";
    private static String caKey ="ydxtMEQmPymRtfz15lW76Tne88pHcuAU8WygMu/TrTKPRY5G7jttcg==";
    static {
        System.setProperty("kasite.appId", APP_ID);
        System.setProperty("kasite.appSecret", APP_SECRET);

+ 26 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/PatientInfoPlatFormService.java

@ -3,6 +3,7 @@ package com.yihu.jw.care.service.third;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.dao.device.BaseSleepPlanDao;
import com.yihu.jw.care.dao.device.DeviceDao;
import com.yihu.jw.care.dao.device.PatientSafeAreaDao;
import com.yihu.jw.care.dao.label.BaseCapacityLabelDao;
import com.yihu.jw.care.dao.label.WlyyPatientLabelDao;
@ -22,6 +23,7 @@ import com.yihu.jw.care.util.Point;
import com.yihu.jw.entity.base.dict.BaseYujingDict;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.device.BaseSleepPlan;
import com.yihu.jw.entity.care.device.Device;
import com.yihu.jw.entity.care.device.PatientSafeAreaDO;
import com.yihu.jw.entity.care.label.BaseCapacityLabelDO;
import com.yihu.jw.entity.care.label.WlyyPatientLabelDO;
@ -40,6 +42,7 @@ import com.yihu.jw.util.healthIndex.HealthIndexUtil;
import org.apache.commons.lang.StringUtils;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -94,6 +97,10 @@ public class PatientInfoPlatFormService {
    private GpsUtil gpsUtil;
    @Autowired
    private HealthIndexUtil healthIndexUtil;
    @Autowired
    private DeviceDao deviceDao;
    @Value("${spring.profiles.active}")
    private String profiles;
    /**
@ -714,6 +721,7 @@ public class PatientInfoPlatFormService {
     *获取设备详情
     */
    public List<Map<String,Object>> getPatientDeviceInfoWithDetail(String patient,String deviceSn,String warnTime,Integer isShow){
        //已绑定设备
        List<Map<String,Object>>  list = new ArrayList<>();
        String sql = "select dd.photo,pd.device_sn,dd.brands,dd.category_code,dd.model,pd.device_name,date_format(pd.czrq,'%Y-%m-%d %H:%i:%S' ) deviceTime,dd.device_type as deviceType " +
                "from dm_device dd INNER JOIN wlyy_patient_device pd on dd.category_code = pd.category_code INNER JOIN wlyy_devices wd on dd.model = wd.device_model and pd.device_sn = wd.device_code \n" +
@ -727,7 +735,9 @@ public class PatientInfoPlatFormService {
        sql+=" order by dd.device_type desc,pd.czrq asc ";
        list =  jdbcTemplate.queryForList(sql);
        Map<String,String> map = new HashMap<>();
        for (Map<String,Object> tmp :list){
            map.put(tmp.get("device_name")+"","");
            String category_code = tmp.get("category_code").toString();
            String deviceSN = tmp.get("device_sn").toString();
            Map<String,Object> detailInfo =  getDeviceIndexAndOrder(category_code,deviceSN,patient,warnTime);
@ -739,6 +749,22 @@ public class PatientInfoPlatFormService {
            list.add(resultMap);
        }
        //查找所有设备
        if("hzkxtest".equals(profiles)){
            List<Device> deviceList = deviceDao.findAll();
            Map<String,List<Device>>  deviceMap = deviceList.stream().collect(Collectors.groupingBy(Device::getName));
            for (String deviceName:deviceMap.keySet()){
                if(map.get(deviceName)==null){
                    Map<String,Object> devicetmp=new HashMap<>();
                    devicetmp.put("photo",deviceMap.get(deviceName).get(0).getPhoto());
                    devicetmp.put("category_code",deviceMap.get(deviceName).get(0).getCategoryCode());
                    devicetmp.put("deviceType",deviceMap.get(deviceName).get(0).getDeviceType());
                    devicetmp.put("device_name",deviceName);
                    devicetmp.put("detailInfo",new JSONObject());
                    list.add(devicetmp);
                }
            }
        }
        return list;
    }

+ 33 - 9
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/endpoint/DeviceController.java

@ -1,29 +1,22 @@
package com.yihu.jw.care.endpoint;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.care.dao.device.DeviceDetailDao;
import com.yihu.jw.care.service.DeviceService;
import com.yihu.jw.care.service.YsDeviceService;
import com.yihu.jw.care.util.DeviceDataPushLogUtil;
import com.yihu.jw.entity.care.device.DeviceDetail;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import jxl.Sheet;
import jxl.Workbook;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.HashMap;
import java.util.Map;
/**
 * Created with IntelliJ IDEA.
@ -277,6 +270,37 @@ public class DeviceController {
        }
    }
    @ApiOperation("设备血氧接收")
    @RequestMapping(value = "byBloodoxygen",  method = {RequestMethod.POST,RequestMethod.GET})
    public String byBloodoxygen(
            @ApiParam(name="device_type",required = false,value="设备型号",defaultValue = "")
            @RequestParam(value = "device_type",required = true) String device_type,
            @ApiParam(name="imei",required = false,value="15位设备唯一序号",defaultValue = "")
            @RequestParam(value = "imei",required = true) String imei,
            @ApiParam(name="time_begin_str",required = false,value="时间YYYYmmDDHHMMSS显示(将time_begin按YYYYmmDDHHMMSS格式化,字符串,长度固定14 )",defaultValue = "")
            @RequestParam(value = "time_begin_str",required = true) String time_begin_str,
            @ApiParam(name="time_begin",required = false,value="发生时间YYYY-MM-DD HH:mm:SS",defaultValue = "")
            @RequestParam(value = "time_begin",required = true) String time_begin,
            @ApiParam(name="bloodoxygen",required = false,value="血氧百分比",defaultValue = "")
            @RequestParam(value = "bloodoxygen",required = true) Integer bloodoxygen,
            @ApiParam(name="bloodoxygen_h",required = false,value="血氧报警上限")
            @RequestParam(value = "bloodoxygen_h",required = false) Integer bloodoxygen_h,
            @ApiParam(name="bloodoxygen_l",required = false,value="血氧报警下限")
            @RequestParam(value = "bloodoxygen_l",required = false) Integer bloodoxygen_l,
            HttpServletRequest request) {
        try {
            String paraString = JSON.toJSONString(request.getParameterMap());
            logger.info("爱牵挂血氧接收,请求参数:\n"+paraString);
            dataPushLogUtil.savePushLog(imei,paraString,"爱牵挂设备血氧数据接收");
            deviceService.byBloodoxygen(device_type, imei, time_begin_str, time_begin, bloodoxygen, bloodoxygen_h, bloodoxygen_l);
            dataPushLogUtil.updContactStatus(imei,1,false);
            return success();
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"Device data incoming failure");
        }
    }
    /*******************************************睡眠带begin****************************************************************/
    @ApiOperation("爱牵挂-睡眠带睡眠接收")
    @RequestMapping(value = "bySleep",  method = {RequestMethod.POST,RequestMethod.GET})

+ 34 - 3
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/DeviceService.java

@ -10,7 +10,6 @@ import com.yihu.jw.care.util.*;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.device.*;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.patient.dao.BasePatientDao;
@ -29,7 +28,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@ -37,7 +35,6 @@ import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import javax.servlet.http.HttpServletRequest;
import java.text.MessageFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
@ -766,6 +763,40 @@ public class DeviceService {
        }
    }
    //设备血氧接收
    @Async
    public void byBloodoxygen(String device_type,String imei,String time_begin_str,String time_begin
            ,Integer bloodoxygen,Integer bloodoxygen_h,Integer bloodoxygen_l) {
        try {
            if(StringUtils.isNotBlank(imei)) {
                List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByDeviceSn(imei);
                if (devicePatientDeviceDos.size() > 0) {
                    DevicePatientDevice devicePatientDevice = devicePatientDeviceDos.get(0);
                    BasePatientDO patientDO = patientDao.findById(devicePatientDevice.getUser());
                    DevicePatientHealthIndex patientHealthIndex = new DevicePatientHealthIndex();
                    patientHealthIndex.setName(patientDO.getName());
                    patientHealthIndex.setDeviceSn(imei);
                    patientHealthIndex.setUser(devicePatientDevice.getUser());
                    patientHealthIndex.setIdcard(devicePatientDevice.getUserIdcard());
                    patientHealthIndex.setValue1(bloodoxygen + "");
                    patientHealthIndex.setValue2(bloodoxygen_h + "");
                    patientHealthIndex.setValue3(bloodoxygen_l + "");
                    patientHealthIndex.setType(8);
                    Date recordDate = DateUtil.strToDate(time_begin);
                    patientHealthIndex.setRecordDate(recordDate);
                    patientHealthIndex.setSortDate(recordDate);
                    patientHealthIndex.setCzrq(new Date());
                    patientHealthIndex.setStatus(0);
                    patientHealthIndex.setDel("1");
                    healthIndexDao.save(patientHealthIndex);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    /**
     *
     * @param device

+ 11 - 0
svr/svr-cloud-transfor/pom.xml

@ -50,6 +50,17 @@
            <artifactId>swagger-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>mysql-starter</artifactId>
            <version>2.0.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat-jdbc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- SPRINGSIDE -->
        <dependency>
            <groupId>org.springside</groupId>

+ 44 - 12
svr/svr-cloud-transfor/src/main/java/com/yihu/jw/care/controller/TransforController.java

@ -45,7 +45,7 @@ public class TransforController {
            long startTime=System.currentTimeMillis();
            String paraString = JSON.toJSONString(request.getParameterMap());
            String url = RequestParamUtil.getParamUrl(request);
            String result = aqgService.aqgForward(url);
            String result = aqgService.aqgForward(url,imei);
            long endTime=System.currentTimeMillis();
            logger.info("爱牵挂设备sos数据接收,请求参数:"+paraString+" "+(endTime-startTime)+"ms; 响应:"+result);
            return success();
@ -71,7 +71,7 @@ public class TransforController {
            long startTime=System.currentTimeMillis();
            String paraString = JSON.toJSONString(request.getParameterMap());
            String url = RequestParamUtil.getParamUrl(request);
            String result = aqgService.aqgForward(url);
            String result = aqgService.aqgForward(url,imei);
            long endTime=System.currentTimeMillis();
            logger.info("爱牵挂设备开关机数据接收,请求参数:"+paraString+" "+(endTime-startTime)+"ms; 响应:"+result);
            return success();
@ -95,7 +95,7 @@ public class TransforController {
            long startTime=System.currentTimeMillis();
            String paraString = JSON.toJSONString(request.getParameterMap());
            String url = RequestParamUtil.getParamUrl(request);
            String result = aqgService.aqgForward(url);
            String result = aqgService.aqgForward(url,deviceid);
            long endTime=System.currentTimeMillis();
            logger.info("爱牵挂设备消息通知数据接收,请求参数:"+paraString+" "+(endTime-startTime)+"ms; 响应:"+result);
            return success();
@ -131,7 +131,7 @@ public class TransforController {
            long startTime=System.currentTimeMillis();
            String paraString = JSON.toJSONString(request.getParameterMap());
            String url = RequestParamUtil.getParamUrl(request);
            String result = aqgService.aqgForward(url);
            String result = aqgService.aqgForward(url,imei);
            long endTime=System.currentTimeMillis();
            logger.info("爱牵挂位置接收,请求参数:"+paraString+" "+(endTime-startTime)+"ms; 响应:"+result);
            return success();
@ -160,7 +160,7 @@ public class TransforController {
            long startTime=System.currentTimeMillis();
            String paraString = JSON.toJSONString(request.getParameterMap());
            String url = RequestParamUtil.getParamUrl(request);
            String result = aqgService.aqgForward(url);
            String result = aqgService.aqgForward(url,imei);
            long endTime=System.currentTimeMillis();
            logger.info("爱牵挂心率数据接收,请求参数:"+paraString+" "+(endTime-startTime)+"ms; 响应:"+result);
            return success();
@ -190,7 +190,7 @@ public class TransforController {
            long startTime=System.currentTimeMillis();
            String paraString = JSON.toJSONString(request.getParameterMap());
            String url =RequestParamUtil.getParamUrl(request);
            String result = aqgService.aqgForward(url);
            String result = aqgService.aqgForward(url,imei);
            long endTime=System.currentTimeMillis();
            logger.info("爱牵挂血压数据接收,请求参数:"+paraString+" "+(endTime-startTime)+"ms; 响应:"+result);
            return success();
@ -222,7 +222,7 @@ public class TransforController {
            long startTime=System.currentTimeMillis();
            String paraString = JSON.toJSONString(request.getParameterMap());
            String url = RequestParamUtil.getParamUrl(request);
            String result = aqgService.aqgForward(url);
            String result = aqgService.aqgForward(url,imei);
            long endTime=System.currentTimeMillis();
            logger.info("爱牵挂跌倒数据接收,请求参数:"+paraString+" "+(endTime-startTime)+"ms; 响应:"+result);
            return success();
@ -246,7 +246,7 @@ public class TransforController {
            long startTime=System.currentTimeMillis();
            String paraString = JSON.toJSONString(request.getParameterMap());
            String url = RequestParamUtil.getParamUrl(request);
            String result = aqgService.aqgForward(url);
            String result = aqgService.aqgForward(url,imei);
            long endTime=System.currentTimeMillis();
            logger.info("设备步数接收,请求参数:"+paraString+" "+(endTime-startTime)+"ms; 响应:"+result);
            return success();
@ -256,6 +256,38 @@ public class TransforController {
        }
    }
    @ApiOperation("设备血氧接收")
    @RequestMapping(value = "byBloodoxygen",  method = {RequestMethod.POST,RequestMethod.GET})
    public String byBloodoxygen(
            @ApiParam(name="device_type",required = false,value="设备型号",defaultValue = "")
            @RequestParam(value = "device_type",required = true) String device_type,
            @ApiParam(name="imei",required = false,value="15位设备唯一序号",defaultValue = "")
            @RequestParam(value = "imei",required = true) String imei,
            @ApiParam(name="time_begin_str",required = false,value="时间YYYYmmDDHHMMSS显示(将time_begin按YYYYmmDDHHMMSS格式化,字符串,长度固定14 )",defaultValue = "")
            @RequestParam(value = "time_begin_str",required = true) String time_begin_str,
            @ApiParam(name="time_begin",required = false,value="发生时间YYYY-MM-DD HH:mm:SS",defaultValue = "")
            @RequestParam(value = "time_begin",required = true) String time_begin,
            @ApiParam(name="bloodoxygen",required = false,value="血氧百分比",defaultValue = "")
            @RequestParam(value = "bloodoxygen",required = true) Integer bloodoxygen,
            @ApiParam(name="bloodoxygen_h",required = false,value="血氧报警上限")
            @RequestParam(value = "bloodoxygen_h",required = false) Integer bloodoxygen_h,
            @ApiParam(name="bloodoxygen_l",required = false,value="血氧报警下限")
            @RequestParam(value = "bloodoxygen_l",required = false) Integer bloodoxygen_l,
            HttpServletRequest request) {
        try {
            long startTime=System.currentTimeMillis();
            String paraString = JSON.toJSONString(request.getParameterMap());
            String url = RequestParamUtil.getParamUrl(request);
            String result = aqgService.aqgForward(url,imei);
            long endTime=System.currentTimeMillis();
            logger.info("设备血氧接收,请求参数:"+paraString+" "+(endTime-startTime)+"ms; 响应:"+result);
            return success();
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"Device data incoming failure");
        }
    }
    /*******************************************睡眠带begin****************************************************************/
    @ApiOperation("爱牵挂-睡眠带睡眠接收")
    @RequestMapping(value = "bySleep",  method = {RequestMethod.POST,RequestMethod.GET})
@ -279,7 +311,7 @@ public class TransforController {
            long startTime=System.currentTimeMillis();
            String paraString = JSON.toJSONString(request.getParameterMap());
            String url = RequestParamUtil.getParamUrl(request);
            String result = aqgService.aqgForward(url);
            String result = aqgService.aqgForward(url,device);
            long endTime=System.currentTimeMillis();
            logger.info("爱牵挂-睡眠带睡眠接收,请求参数:"+paraString+" "+(endTime-startTime)+"ms; 响应:"+result);
            return success();
@ -336,7 +368,7 @@ public class TransforController {
            long startTime=System.currentTimeMillis();
            String paraString = JSON.toJSONString(request.getParameterMap());
            String url = RequestParamUtil.getParamUrl(request);
            String result = aqgService.aqgForward(url);
            String result = aqgService.aqgForward(url,device);
            long endTime=System.currentTimeMillis();
            logger.info("爱牵挂-睡眠带睡眠报告接收,请求参数:"+paraString+" "+(endTime-startTime)+"ms; 响应:"+result);
            return success();
@ -360,7 +392,7 @@ public class TransforController {
            long startTime=System.currentTimeMillis();
            String paraString = JSON.toJSONString(request.getParameterMap());
            String url = RequestParamUtil.getParamUrl(request);
            String result = aqgService.aqgForward(url);
            String result = aqgService.aqgForward(url,device);
            long endTime=System.currentTimeMillis();
            logger.info("爱牵挂-睡眠带wifi在线状态接收,请求参数:"+paraString+" "+(endTime-startTime)+"ms; 响应:"+result);
            return success();
@ -394,7 +426,7 @@ public class TransforController {
            long startTime=System.currentTimeMillis();
            String paraString = JSON.toJSONString(request.getParameterMap());
            String url = RequestParamUtil.getParamUrl(request);
            String result = aqgService.aqgForward(url);
            String result = aqgService.aqgForward(url,imei);
            long endTime=System.currentTimeMillis();
            logger.info("爱牵挂-手表睡眠接收,请求参数:"+paraString+" "+(endTime-startTime)+"ms; 响应:"+result);
            return success();

+ 22 - 23
svr/svr-cloud-transfor/src/main/java/com/yihu/jw/care/service/AqgService.java

@ -4,11 +4,14 @@ package com.yihu.jw.care.service;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.net.URLDecoder;
import java.util.List;
import java.util.Map;
/**
 * Created with IntelliJ IDEA.
@ -20,36 +23,32 @@ import java.net.URLDecoder;
@Service
public class AqgService {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public String getBaseUrl(String imei){
        if(StringUtils.isBlank(imei)){
            return "https://zhyzh.gongshu.gov.cn/device/";
        }
        String sql = "SELECT push_address from device_push_address where device_sn = '"+imei+"'";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if(list==null||list.size()==0){
            return "https://zhyzh.gongshu.gov.cn/device/";
        }else {
            return list.get(0).get("push_address")+"";
        }
    }
    private Logger logger = LoggerFactory.getLogger(AqgService.class);
    private static final RestTemplate restTemplate = new RestTemplate();
    private static final String baseUrl = "https://zhyzh.gongshu.gov.cn/device/";
//    private static final String baseUrl = "http://ehr.yihu.com/wlyy/aqg";
    public String aqgForward(String method,String body,String uri){
        String res = "";
        try {
            String url;
            if(StringUtils.isBlank(body)){
                uri = URLDecoder.decode(uri,"UTF-8");
                url = baseUrl+uri;
            }else{
                url = baseUrl+method+"?"+body;
            }
            ResponseEntity<String> responseEntity = null;
            logger.info("推送爱牵挂数据给医养项目url="+ url);
            responseEntity = restTemplate.getForEntity(url, String.class);
            res = responseEntity.getBody();
            logger.info("推送爱牵挂数据给医养项目res="+ res);
        }catch (Exception e){
            e.printStackTrace();
        }
        return res;
    }
    public String aqgForward(String url){
    public String aqgForward(String url,String imei){
        String res = "";
        try {
            String baseUrl = getBaseUrl(imei);
            ResponseEntity<String> responseEntity = null;
            logger.info("推送爱牵挂数据给医养项目url="+ baseUrl+url);
            responseEntity = restTemplate.getForEntity(baseUrl+url, String.class);

+ 3 - 3
svr/svr-cloud-transfor/src/main/resources/application.yml

@ -77,9 +77,9 @@ spring:
  profiles: prod
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://172.26.0.104/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
    username: ssgg
    password: ssgg@jkzl2019
    url: jdbc:mysql://192.168.1.221:3306/device?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
    username: wlyy_sr
    password: 4zjQjEax
#  elasticsearch:
#    cluster-name: jkzl #集群名 默认elasticsearch
#    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode

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

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

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

@ -29,6 +29,8 @@ import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.es.service.StatisticsEsService;
import com.yihu.jw.es.service.yqfk.YqfkService;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.healthCare.service.HealthCareNewService;
import com.yihu.jw.healthCare.service.HealthCareService;
import com.yihu.jw.healthUpload.service.BaseDoctorHealthUploadService;
import com.yihu.jw.hospital.dao.consult.KnowledgeArticleUserDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
@ -70,6 +72,7 @@ import com.yihu.jw.sms.service.YkyyINSMSService;
import com.yihu.jw.util.common.FileUtil;
import com.yihu.jw.util.common.XMLUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.enterprise.EnterpriseService;
@ -249,7 +252,39 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private EnterpriseService enterpriseService;
    @Autowired
    private WxEnterpriseDao wxEnterpriseDao;
    @Value("${wechat.id}")
    private String wechatId;
    public static String entranceHealthCareUrl = "http://127.0.0.1:10023/healthCare/";
    @Autowired
    private HealthCareService healthCareService;
    @Autowired
    private HealthCareNewService healthCareNewService;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @GetMapping(value = "findHospitalByZJ")
    @ApiOperation(value = "查找有专家问诊排班的医院", notes = "查找有专家问诊排班的医院")
    public MixEnvelop findHospitalByZJ(@ApiParam(name = "iswork", value = "是否过滤排班,1是")
                                                            @RequestParam(value = "iswork", required = true)String iswork,
                                                            @ApiParam(name = "orgName", value = "机构code", required = false)
                                                            @RequestParam(value = "orgName", required = false)String orgName,
                                                            @ApiParam(name = "outpatientType", value = "咨询类型zj 专家咨询")
                                                            @RequestParam(value = "outpatientType", required = false)String outpatientType,
                                                            @ApiParam(name = "workingTime", value = "排班时间YYYY-MM-DD")
                                                            @RequestParam(value = "workingTime", required = false)String workingTime,
                                                            @ApiParam(name = "page", value = "第几页")
                                                            @RequestParam(value = "page",required = false) Integer page,
                                                            @ApiParam(name = "pagesize", value = "分页大小")
                                                            @RequestParam(value = "pagesize",required = false) Integer pagesize
    ){
        try {
            logger.info("findHospitalByZJ start:"+ DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));
            return prescriptionService.findHospitalByZJ(iswork,orgName,
                    outpatientType,workingTime,page,pagesize);
        } catch (Exception e){
            return  failedMixEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
@ -2911,4 +2946,58 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                       @RequestParam(value = "flag",required = false)Integer flag,HttpServletRequest request)throws Exception{
        return ObjEnvelop.getSuccess("ok",hcyyEntranceService.initiateDataSign(prescriptionId, flag,getIpAddress(request)));
    }
    @GetMapping(value = "doctorAuthentication")
    @ApiOperation(value = "医师身份验证", notes = "医师身份验证")
    public ObjEnvelop doctorAuthentication(@ApiParam(name = "doctorId", value = "医生id", required = true)
                                           @RequestParam(value = "doctorId",required = true) String doctorId){
        try {
            if (wechatId.equalsIgnoreCase("xm_xzzx_wx")){
                String url = entranceHealthCareUrl + "doctorAuthentication?doctorId="+doctorId;
                String infoResponse = httpClientUtil.get(url,"GBK");
                JSONObject jsonObject = JSONObject.parseObject(infoResponse);
                if(jsonObject.getInteger("status")==200){
                    return ObjEnvelop.getSuccess("ok",jsonObject.get("obj"));
                }else {
                    return ObjEnvelop.getError("调用内网接口失败:"+jsonObject.getString("message"));
                }
            }else if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
                return ObjEnvelop.getSuccess("ok",healthCareService.doctorAuthentication(doctorId));
            }else {
                return ObjEnvelop.getSuccess("ok",healthCareNewService.doctorAuthentication(doctorId));
            }
        }catch (Exception e){
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
    }
    @PostMapping(value = "/authorized")
    @ApiOperation(value = "渠道应用是否已授权", notes = "渠道应用是否已授权")
    public ObjEnvelop authorized(@ApiParam(name = "patient", value = "患者id", required = true)
                                 @RequestParam(value = "patient", required = true)String patient)throws Exception{
        try {
            if (wechatId.equalsIgnoreCase("xm_xzzx_wx")) {
                String url = entranceHealthCareUrl + "authorized?patient="+patient;
                String infoResponse = httpClientUtil.get(url,"GBK");
                JSONObject jsonObject = JSONObject.parseObject(infoResponse);
                if(jsonObject.getInteger("status")==200){
                    return ObjEnvelop.getSuccess("ok",jsonObject.get("obj"));
                }else {
                    return ObjEnvelop.getError("调用内网接口失败:"+jsonObject.getString("message"));
                }
            }else if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
                return ObjEnvelop.getSuccess("ok",healthCareService.authorized(patient));
            }else {
                return ObjEnvelop.getSuccess("ok",healthCareNewService.authorized(patient));
            }
        }catch (Exception e){
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
    }
}

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

@ -271,8 +271,10 @@ public class HcyyPrescriptionCotroller extends EnvelopRestEndpoint {
                                 @ApiParam(name = "clinicclass", value = "挂号类别", required = false)
                                     @RequestParam(value = "clinicclass",required = false)String clinicclass,
                                 @ApiParam(name = "courierflag", value = "快递发药标识(Y快递N为自取)", required = false)
                                     @RequestParam(value = "courierflag",required = false)String courierflag)throws Exception{
        return ObjEnvelop.getSuccess("ok",hcyyEntranceService.registered(doctor,dept,sickId,clinicclass,courierflag));
                                     @RequestParam(value = "courierflag",required = false)String courierflag,
                                 @ApiParam(name = "flag", value = "flag 0自费1医保", required = false)
                                     @RequestParam(value = "flag",required = false)String flag)throws Exception{
        return ObjEnvelop.getSuccess("ok",hcyyEntranceService.registered(doctor,dept,sickId,clinicclass,courierflag,flag));
    }
    /**
@ -860,4 +862,23 @@ public class HcyyPrescriptionCotroller extends EnvelopRestEndpoint {
                                           @RequestParam(value = "realorder",required = false)String realorder)throws Exception{
        return ObjEnvelop.getSuccess("ok",hcyyPrescriptionService.sfToHis(outpatientId,realorder));
    }
    @GetMapping(value = "/downloadinvoice")
    @ApiOperation(value = "电票下载", notes = "电票下载")
    public ObjEnvelop downloadinvoice(@ApiParam(name = "settleNo", value = "结算号", required = false)
                                           @RequestParam(value = "settleNo",required = false)String settleNo)throws Exception{
        return ObjEnvelop.getSuccess("ok",hcyyEntranceService.downloadinvoice(settleNo));
    }
    @GetMapping(value = "/OutpatientInvoicing")
    @ApiOperation(value = "电票开具", notes = "电票开具")
    public ObjEnvelop OutpatientInvoicing(@ApiParam(name = "settleNo", value = "结算号", required = false)
                                      @RequestParam(value = "settleNo",required = false)String settleNo,
                                          @ApiParam(name = "operator", value = "操作人", required = false)
                                          @RequestParam(value = "operator",required = false)String operator)throws Exception{
        return ObjEnvelop.getSuccess("ok",hcyyEntranceService.OutpatientInvoicing(settleNo,operator));
    }
}