浏览代码

创建订单新增his病人id

wangjun 3 年之前
父节点
当前提交
abbfd1faa1

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

@ -11836,6 +11836,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                orderObj.put("openId",openId);
                orderObj.put("name",name);
                orderObj.put("idNo",cardNo);
                String hisPatientId=tasyNatService.getPatientHisId(cardNo,mediaCard);
                orderObj.put("hisPatientId",hisPatientId);
                orderObj.put("mediaCard",mediaCard);
                BigDecimal b = new BigDecimal(itemPrice);
                b=b.setScale(2, BigDecimal.ROUND_DOWN);
                System.out.println("amount"+b);

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

@ -337,6 +337,7 @@ public class TasyNatService {
        xml=xml.substring(xml.indexOf("<root>"),xml.lastIndexOf("]]"));
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        saveHttpLog("ChargenucleicBill",jsonObject.toString(),json,"ChargenucleicBill");
        logger.info("ChargenucleicBill json:"+json);
        return json;
    }
@ -541,7 +542,7 @@ public class TasyNatService {
            key2.put("color",wxTemplateConfigDO1.getKeyword6());
            key3.put("value",wxTemplateConfigDO1.getKeyword3());
            key3.put("color",wxTemplateConfigDO1.getKeyword6());
            key4.put("value",baseNatAppointmentD0.getDoctorName());
            key4.put("value",baseNatAppointmentD0.getChargeAmount());
            key4.put("color",wxTemplateConfigDO1.getKeyword6());
            key5.put("value",baseNatAppointmentD0.getVoucherNo());
            key5.put("color",wxTemplateConfigDO1.getKeyword6());
@ -799,6 +800,7 @@ public class TasyNatService {
        logger.info("QueryApplyInfo json:"+json);
        return json;
    }
    public void savePayStatusByHis(String patientId) throws Exception {
        List<BaseNatAppointmentDO> baseNatAppointmentDOList = baseNatAppointmentDao.findPayStatusByPatientId(patientId);
        for (BaseNatAppointmentDO baseNatAppointmentDO:baseNatAppointmentDOList){
@ -1000,4 +1002,36 @@ public class TasyNatService {
        result.put("msg","验证通过");
        return  result;
    }
    public String getPatientHisId(String idcard,String mediacard) throws Exception{
        String res = findHisPatientCard(idcard);
        JSONObject jsonObject = JSON.parseObject(res);
        if ("1".equalsIgnoreCase(jsonObject.getString("ReturnCode"))) {
            String patients=jsonObject.getString("patients");
            if (patients.contains("[")) {
                JSONArray jsonArray = JSON.parseArray(patients);
                if (jsonArray != null && jsonArray.size() > 0) {
                    for (int i = 0; i < jsonArray.size(); i++) {
                        JSONObject child = jsonArray.getJSONObject(i);
                        if (mediacard.equalsIgnoreCase(child.getString("CardNo"))) {
                            String Patientid = child.getString("Patientid");
                            return Patientid;
                        }
                    }
                }
            } else {
                try {
                    JSONObject jsonObject1 = JSONObject.parseObject(patients);
                    if (mediacard.equalsIgnoreCase(jsonObject1.getString("CardNo"))) {
                        String Patientid = jsonObject1.getString("Patientid");
                        return Patientid;
                    }
                } catch (Exception e) {
                   e.printStackTrace();
                }
            }
        }
        return "";
    }
}

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

@ -2258,6 +2258,9 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            if ("ChargenucleicBill".equalsIgnoreCase(api)){
                return success("操作成功",tasyNatService.ChargenucleicBill(jsonObject));
            }
            if ("QueryApplyInfo".equalsIgnoreCase(api)){
                return success("操作成功",tasyNatService.QueryApplyInfo(jsonObject.getString("realOrder")));
            }
            return success("");
        } catch (Exception e){
            return  failedException(e);
@ -2318,7 +2321,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                 @RequestParam(value = "traceNo", required = false) String traceNo,
                             @ApiParam(name = "msg", value = "msg", required = false)
                                 @RequestParam(value = "msg", required = false) String msg) throws Exception {
        System.out.println("进入回调code="+code);
        System.out.println(" "+code);
        System.out.println("进入回调orderNo="+orderNo);
        System.out.println("进入回调traceNo="+traceNo);
        System.out.println("进入回调msg="+msg);
@ -2343,8 +2346,14 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                JSONObject feeObj = JSONObject.parseObject(feeRes);
                                if (feeObj!=null){
                                    if ("1".equalsIgnoreCase(feeObj.getString("ReturnCode"))){
                                        String voucherNo = feeObj.getString("ApplyNo");
                                        baseNatAppointmentDO.setVoucherNo(voucherNo);
                                        JSONObject ApplyInfoObj = JSON.parseObject(feeObj.getString("ApplyInfo"));
                                        if (ApplyInfoObj!=null){
                                            String voucherNo = ApplyInfoObj.getString("ApplyNo");
                                            if(org.apache.commons.lang3.StringUtils.isNoneBlank(voucherNo)){
                                                System.out.println("ApplyNo:"+voucherNo);
                                                baseNatAppointmentDO.setVoucherNo(voucherNo);
                                            }
                                        }
                                    }else{
                                        return feeObj.getString("ReturnMsg");
                                    }