Browse Source

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

LAPTOP-KB9HII50\70708 2 years ago
parent
commit
ec4391c321

+ 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());
        }
    }

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

@ -10318,6 +10318,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;
    }
    //===========================电票接口===============================
}

+ 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);

+ 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>

+ 66 - 1
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,15 @@ 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 = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
@ -2911,4 +2922,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));
    }
}