zjh
2024-06-13 962d1b2fb12dd90a661748c952825b8cebdcb35d
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java
@@ -63,7 +63,7 @@
    //对接his总接口  注册挂号接诊申请单操作
    @Transactional
    public void HisApiMethods(TjCustomer customer, Long orderId) {
    public AjaxResult HisApiMethods(TjCustomer customer, Long orderId) {
        Date dates = new Date();
        final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss");
@@ -161,8 +161,10 @@
                        LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
                        lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintestapply");
                        HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper);
                        hisApiGetMethodService.save(object4, "Outpintestapply", hisApiConfig);
                        hisApiGetMethodService.save(object4, "Outpintestapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dto)));
                    }else {
                        return AjaxResult.success();
                    }
                    //门诊检查申请
                    OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto();
@@ -218,8 +220,10 @@
                        LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
                        lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpinexamapply");
                        HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper);
                        hisApiGetMethodService.save(jsonObject, "Outpinexamapply", hisApiConfig);
                        hisApiGetMethodService.save(jsonObject, "Outpinexamapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(outpinexamapplyDto)));
                    }else {
                        return AjaxResult.success();
                    }
                    //门诊治疗处置申请
@@ -274,21 +278,23 @@
                        map.put("cardId", customer.getCardId());
                        JSONObject jsonObject = JSONUtil.parseObj(map);
                        LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
                        lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpinmedapply");
                        lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintreatapply");
                        HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper);
                        hisApiGetMethodService.save(jsonObject, "Outpinmedapply", hisApiConfig);
                        hisApiGetMethodService.save(jsonObject, "Outpintreatapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dao)));
                    }else {
                        return AjaxResult.error();
                    }
                    return AjaxResult.success();
                }
            }
        }
        return AjaxResult.error();
    }
    //退费后取消接诊作废申请单等操作
    @Transactional
    public void ZfHisApiMethods(TjCustomer customer, TjOrder order) {
    public boolean ZfHisApiMethods(TjCustomer customer, TjOrder order) {
        Date dates = new Date();
        final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss");
@@ -299,28 +305,58 @@
        String zlsqdh = orderService.getHuoQuZlsqdh(order.getCardId());
        //作废门诊检查申请
        AjaxResult result = controller.Outpindelexamapply(order.getCardId(), "00029", jcsqdh);
        String result1 = getAjaxResult(result);
        JSONObject object = getJSONObject(result1);
        String code = object.getStr("ResultCode");
        if (code.equals("0")) {
            orderService.delHuoQuJcsqdh(order.getCardId());
        //2.1.6.5 作废门诊检查申请
        if (null !=jcsqdh){
            AjaxResult result = controller.Outpindelexamapply(order.getCardId(), "00029", jcsqdh);
            String result1 = getAjaxResult(result);
            JSONObject object = getJSONObject(result1);
            String code = object.getStr("ResultCode");
            if (code.equals("0")) {
                orderService.delHuoQuJcsqdh(order.getCardId());
            }else {
                return false;
            }
        }
        //作废门诊申请
        AjaxResult ajaxResult = controller.Outpindeltestapply(order.getCardId(), "00029", jysqdh);
        String result2 = getAjaxResult(ajaxResult);
        JSONObject object1 = getJSONObject(result2);
        String code1 = object1.getStr("ResultCode");
        if (code1.equals("0")) {
            orderService.delHuoQuJysqdh(order.getCardId());
        //2.1.6.3 作废门诊检验申请
        AjaxResult ajaxResult =null;
        String result2 =null;
        JSONObject object1 =null;
        String code1 =null;
        if(null !=jysqdh){
             ajaxResult = controller.Outpindeltestapply(order.getCardId(), "00029", jysqdh);
             result2 = getAjaxResult(ajaxResult);
             object1 = getJSONObject(result2);
             code1 = object1.getStr("ResultCode");
            if (code1.equals("0")) {
                orderService.delHuoQuJysqdh(order.getCardId());
            }else {
                return false;
            }
        }
        controller.Outpinunconapply(order.getCardId(), date, "00029");
        controller.Outpindelmedapply(order.getCardId(), "00029", zlsqdh);
        //2.1.6.9 作废门诊治疗处置申请
        if(null !=zlsqdh){
            ajaxResult = controller.Outpintdelreatapply(order.getCardId(), "00029", zlsqdh);
            result2 = getAjaxResult(ajaxResult);
            object1 = getJSONObject(result2);
            code1 = object1.getStr("ResultCode");
            if (!code1.equals("0")){
                return false;
            }
        }
        //2.1.3 门诊医生取消接诊
        ajaxResult = controller.Outpinunconapply(order.getCardId(), date, "00029");
        result2 = getAjaxResult(ajaxResult);
        object1 = getJSONObject(result2);
        code1 = object1.getStr("ResultCode");
        if (!code1.equals("0")){
            return false;
        }
        return true;
    }