Browse Source

Merge branch 'medicare' of liubing/wlyy2.0 into medicare

liubing 2 years ago
parent
commit
8740018cd6

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/a1entity/MedicineShipmentLog.java

@ -105,6 +105,7 @@ public class MedicineShipmentLog extends UuidIdentityEntityWithOperator implemen
    private String useWay;
    private String useRate;
    private String useRateCode;
    private String useDose;
    public MedicineShipmentLog() {
@ -287,6 +288,14 @@ public class MedicineShipmentLog extends UuidIdentityEntityWithOperator implemen
        this.useRate = useRate;
    }
    public String getUseRateCode() {
        return useRateCode;
    }
    public void setUseRateCode(String useRateCode) {
        this.useRateCode = useRateCode;
    }
    public String getUseDose() {
        return useDose;
    }

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

@ -747,7 +747,6 @@ public class YlzMedicalRelationDO extends UuidIdentityEntity {
        this.medType = medType;
    }
    @Transient
    public String getCaty() {
        return caty;
    }
@ -756,7 +755,6 @@ public class YlzMedicalRelationDO extends UuidIdentityEntity {
        this.caty = caty;
    }
    @Transient
    public String getAtddrNo() {
        return atddrNo;
    }
@ -765,7 +763,6 @@ public class YlzMedicalRelationDO extends UuidIdentityEntity {
        this.atddrNo = atddrNo;
    }
    @Transient
    public String getDrName() {
        return drName;
    }
@ -774,7 +771,6 @@ public class YlzMedicalRelationDO extends UuidIdentityEntity {
        this.drName = drName;
    }
    @Transient
    public String getVisitMsgid() {
        return visitMsgid;
    }

+ 4 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/a4endpoint/MedicineOrderDrugsEndpoint.java

@ -58,10 +58,12 @@ public class MedicineOrderDrugsEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取患者待结算--个人信息、挂号接口封装", notes = "挂号接口封装")
    public Envelop getSettlementInfoFirst(
            @ApiParam(name = "recipe_no", value = "recipe_no")
            @RequestParam(value = "recipe_no", required = true) String recipe_no){
            @RequestParam(value = "recipe_no", required = true) String recipe_no,
            @ApiParam(name = "card_sn", value = "卡识别码")
            @RequestParam(value = "card_sn", required = false) String card_sn){
        try {
            return success("操作成功", medOrderService.getSettlementInfoFirst(recipe_no));
            return success("操作成功", medOrderService.getSettlementInfoFirst(recipe_no,card_sn));
        } catch (Exception e) {
           e.printStackTrace();
            return Envelop.getError(e.getMessage());

+ 36 - 15
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedOrderService.java

@ -207,7 +207,7 @@ public class MedOrderService {
     * @throws Exception
     */
    @Transactional(rollbackFor = Exception.class)
    public com.alibaba.fastjson.JSONArray getSettlementInfoFirst(String recipe_no) throws Exception {
    public com.alibaba.fastjson.JSONArray getSettlementInfoFirst(String recipe_no,String card_sn) throws Exception {
        JSONArray result = new JSONArray();
        YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByLog_no(recipe_no);
        if (null==ylzMedicalRelationDO){
@ -268,6 +268,21 @@ public class MedOrderService {
            JSONObject dataDetail = new JSONObject();
            inputDetail.put("mdtrt_cert_type","03");
            inputDetail.put("mdtrt_cert_no",cardNo);
            if (StringUtils.isNotBlank(card_sn)){
                inputDetail.put("card_sn",card_sn);
            }else {
                sql = " select dict_code,dict_value from wlyy_hospital_sys_dict where dict_name='ylz_card_sn' ";
                List<Map<String,Object>> AnalogFlags = jdbcTemplate.queryForList(sql);
                String AnalogFlag = "0";
                if (AnalogFlags.size()>0){
                    AnalogFlag = AnalogFlags.get(0).get("dict_code").toString();
                }
                if ("1".equals(AnalogFlag)) {//获取调式模拟数据
                    inputDetail.put("card_sn",AnalogFlags.get(0).get("dict_value").toString());
                }else {
                    throw new Exception("卡识别码未传入");
                }
            }
            input.put("data",inputDetail);
            dataDetail.put("input",input);
            dataDetail.put("net_data",netData);
@ -398,6 +413,8 @@ public class MedOrderService {
        JSONObject resultTmp = new JSONObject();
        resultTmp.put("needCharge",true);
        DecimalFormat format = new DecimalFormat("#.00");
        System.out.println("readcardResult:"+readcardResult);
        System.out.println("registerResult:"+registerResult);
        if (null==ylzMedicalRelationDO){
            throw new Exception("未找到该处方待结算记录");
@ -430,14 +447,15 @@ public class MedOrderService {
        JSONObject readcardObject = JSONObject.parseObject(readcardResult);
        if ("0000".equals(readcardObject.getString("retCode"))){
            JSONObject outPutObj = readcardObject.getJSONObject("output");
            JSONObject dataObj = readcardObject.getJSONObject("data");
            JSONObject outPutObj = dataObj.getJSONObject("output");
            JSONObject baseinfo = outPutObj.getJSONObject("baseinfo");
            JSONObject insuinfo = outPutObj.getJSONObject("insuinfo");
            JSONArray insuinfo = outPutObj.getJSONArray("insuinfo");
            String psn_no = baseinfo.getString("psn_no");//人员编码
            String balc = insuinfo.getDouble("balc").toString();//余额
            String insutype = insuinfo.getString("insutype");//险种类型
            String insuplc_admdvs = insuinfo.getString("insuplc_admdvs");//参保地医保区划
            String balc = insuinfo.getJSONObject(0).getDouble("balc").toString();//余额
            String insutype = insuinfo.getJSONObject(0).getString("insutype");//险种类型
            String insuplc_admdvs = insuinfo.getJSONObject(0).getString("insuplc_admdvs");//参保地医保区划
            ylzMedicalRelationDO.setPsnNo(psn_no);
            ylzMedicalRelationDO.setAccountBalance(balc);
            ylzMedicalRelationDO.setInsuranceType(insutype);
@ -458,7 +476,8 @@ public class MedOrderService {
            JSONObject registerObject = JSONObject.parseObject(registerResult);
            if ("0000".equals(registerObject.getString("retCode"))){
                JSONObject outPutObj = registerObject.getJSONObject("output");
                JSONObject dataObj = registerObject.getJSONObject("data");
                JSONObject outPutObj = dataObj.getJSONObject("output");
                JSONObject data = outPutObj.getJSONObject("data");
                String mdtrt_id = data.getString("mdtrt_id");//就诊id
                ylzMedicalRelationDO.setHisSerial(mdtrt_id);
@ -520,7 +539,7 @@ public class MedOrderService {
                Double medfee_sumamt = ylzMedicalMxDOSTmp.stream().mapToDouble(e-> Double.valueOf(e.getTotalMoney())).sum();
                String str = format.format(medfee_sumamt);
                dataInfo.put("medfee_sumamt",Double.parseDouble(str));//医疗费总额-数值型16,2
                dataInfo.put("medfee_sumamt",Double.parseDouble(str)+"");//医疗费总额-数值型16,2
                dataInfo.put("psn_setlway",ylzMedicalMxDOSTmp.get(0).getPsnSetlway()); //个人结算方式
                dataInfo.put("mdtrt_id",ylzMedicalRelationDO.getHisSerial());    //就诊 ID
                dataInfo.put("chrg_bchno",key);  //收费批次号
@ -537,7 +556,7 @@ public class MedOrderService {
                for (YlzMedicalIcdDO tmp:ylzMedicalIcdDOS){
                    JSONObject diseinfoTmp = new JSONObject();
                    diseinfoTmp.put("diag_type",tmp.getDiseaseType()); //诊断类别
                    diseinfoTmp.put("diag_srt_no",Integer.valueOf(tmp.getDiseaseOrder()));  //诊断排序号
                    diseinfoTmp.put("diag_srt_no",Integer.valueOf(tmp.getDiseaseOrder())+"");  //诊断排序号
                    diseinfoTmp.put("diag_code",tmp.getDiseaseCodeIcd10());    //诊断代码
                    diseinfoTmp.put("diag_name",tmp.getDiseaseNameIcd10());    //诊断名称
                    diseinfoTmp.put("diag_dept",tmp.getDiagDept());    //诊断科室
@ -558,12 +577,12 @@ public class MedOrderService {
                    feedetailTmp.put("fee_ocur_time",DateUtil.dateToStrLong(tmp.getActgDate())); //费用发生时间yyyy-MM-dd HH:mm:ss
                    feedetailTmp.put("med_list_codg",tmp.getItemCode()); //医疗目录编码
                    feedetailTmp.put("medins_list_codg",tmp.getHisItemCode()); //医药机构目录编码
                    feedetailTmp.put("det_item_fee_sumamt",Double.valueOf(tmp.getTotalMoney())); //明细项目费用总额-数值型16,2
                    feedetailTmp.put("cnt",Double.valueOf(tmp.getAmount())); //数量-数值型16,4
                    feedetailTmp.put("pric",Double.valueOf(tmp.getPrice())); //单价-数值型16,6
                    feedetailTmp.put("det_item_fee_sumamt",Double.valueOf(tmp.getTotalMoney())+""); //明细项目费用总额-数值型16,2
                    feedetailTmp.put("cnt",Double.valueOf(tmp.getAmount())+""); //数量-数值型16,4
                    feedetailTmp.put("pric",Double.valueOf(tmp.getPrice())+""); //单价-数值型16,6
                    feedetailTmp.put("bilg_dept_codg",tmp.getBilgDeptCodg()); //开单科室编码
                    feedetailTmp.put("bilg_dept_name",tmp.getBilgDeptName()); //开单科室名称
                    feedetailTmp.put("bilg_dr_codg",tmp.getBilgDrCodg()); //开单医生编码
                    feedetailTmp.put("bilg_dr_codg",ylzMedicalRelationDO.getAtddrNo()); //开单医生编码
                    feedetailTmp.put("bilg_dr_name",tmp.getBilgDrName()); //开单医师姓名
                    feedetailTmp.put("hosp_appr_flag",tmp.getHospApprFlag()); //医院审批标志
                    feedetailTmp.put("rxno",tmp.getRxno()); //单据号
@ -651,7 +670,7 @@ public class MedOrderService {
                    for (YlzMedicalMxDO tmp:ylzMedicalMxDOSTmp){
                        JSONObject outputResultTmp = new JSONObject();
                        outputResultTmp.put("feedetl_sn",tmp.getHisDetailSn());//费用明细流水号
                        outputResultTmp.put("det_item_fee_sumamt",Double.valueOf(tmp.getTotalMoney()));//明细项目费用总额-数值型16,2
                        outputResultTmp.put("det_item_fee_sumamt",Double.valueOf(tmp.getTotalMoney())+"");//明细项目费用总额-数值型16,2
                        outputResultTmp.put("cnt",Double.valueOf(tmp.getAmount()));//数量-数值型16,4
                        outputResultTmp.put("pric",Double.valueOf(tmp.getPrice()));//单价-数值型16,6
                        outputResultTmp.put("pric_uplmt_amt",50.00);//定价上限金额-数值型16,6
@ -709,7 +728,8 @@ public class MedOrderService {
                for (int i=0;i<chargeResultArr.size();i++){
                    JSONObject chargeResultTmp = chargeResultArr.getJSONObject(i);
                    if ("0000".equals(chargeResultTmp.getString("retCode"))){
                        JSONObject output = chargeResultTmp.getJSONObject("output");
                        JSONObject dataObj = chargeResultTmp.getJSONObject("data");
                        JSONObject output = dataObj.getJSONObject("output");
                        JSONObject setlinfo = output.getJSONObject("setlinfo");
                        personCash += setlinfo.getDouble("psn_cash_pay");
                        personAccount += setlinfo.getDouble("acct_pay");
@ -947,6 +967,7 @@ public class MedOrderService {
                                                ylzMedicalMxDO.setBilgDrName(SETTLE_DETAIL_OBJ.getString("APPLY_OPERATOR_NAME"));
                                                ylzMedicalMxDO.setHospApprFlag(SETTLE_DETAIL_OBJ.getString("hosp_appr_flag"));
                                                ylzMedicalMxDO.setRxno(SETTLE_DETAIL_OBJ.getString("APPLY_NO"));
                                                ylzMedicalMxDO.setPsnSetlway(SETTLE_DETAIL_OBJ.getString("psn_setlway"));
                                                ylzMedicailMxDao.save(ylzMedicalMxDO);
                                                mxDOList.add(ylzMedicalMxDO);
                                            }

+ 8 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicineOrderService.java

@ -2366,7 +2366,14 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
                            shipmentLog.setEquName(mediicinedevice.getEquName());
                            shipmentLog.setEquNum(mediicinedevice.getEquNum());
                            shipmentLog.setDosForm(mediicinedrugs.getDosForm());
                            shipmentLog.setUseRate(mediicineorderdetail.getUseRate());
                            shipmentLog.setUseRateCode(mediicineorderdetail.getUseRate());
                            if (org.apache.commons.lang.StringUtils.isNotBlank(mediicineorderdetail.getUseRate())) {
                                String sql = " select dict_value from wlyy_hospital_sys_dict where dict_name='drug_use_rate' and dict_code='"+mediicineorderdetail.getUseRate()+"' ";
                                List<String> useRates = jdbcTemplate.queryForList(sql,String.class);
                                if (useRates.size()>0){
                                    shipmentLog.setUseRate(useRates.get(0));
                                }
                            }
                            shipmentLog.setUseDose(mediicineorderdetail.getUseDose());
                            shipmentLog.setUseWay(mediicineorderdetail.getUseWay());
                            shipmentLog = shipmentLogDao.save(shipmentLog);