zjh
5 天以前 769f5f1c452560ab044fee905c1c514c9ca373bb
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java
@@ -133,7 +133,7 @@
            String code1 = object1.getStr("ResultCode");
            if (code1.equals("0")) {
                JSONArray resultDatas = object1.getJSONArray("ResultData");
                if (null != resultDatas && resultDatas.size() > 0) {
                if (null != resultDatas && !resultDatas.isEmpty()) {
                    Map<String, Object> resultDatasss = (Map<String, Object>) resultDatas.get(0);
                    String hisRegistrationId = resultDatasss.get("his_registration_id").toString();
                    jzh=hisRegistrationId;
@@ -2917,7 +2917,7 @@
        List<String> jysqdh = orderService.getHuoQuJysqdh(order.getCardId());
            //2.1.6.5 作废门诊检查申请
            if (null != jcsqdh && jcsqdh.size()>0) {
            if (null != jcsqdh && !jcsqdh.isEmpty()) {
                for (String s : jcsqdh) {
                    AjaxResult result = controller.Outpindelexamapply(order.getCardId(), ysbm, s);
                    String result1 = getAjaxResult(result);
@@ -3050,7 +3050,7 @@
                    List<String> jysqdh = orderService.getHuoQuBlJysqdh(order.getCardId(),bldh);
//                    }else {
//                        2.1.6.5 作废门诊检查申请
                        if (null != jcsqdh && jcsqdh.size()>0) {
                        if (null != jcsqdh && !jcsqdh.isEmpty()) {
                            for (String s : jcsqdh) {
                                AjaxResult result = controller.Outpindelexamapply(order.getCardId(), ysbm, s);
                                String result1 = getAjaxResult(result);
@@ -3065,7 +3065,7 @@
                        }
                        //2.1.6.3 作废门诊检验申请
                        if (null != jysqdh && jysqdh.size()>0) {
                        if (null != jysqdh && !jysqdh.isEmpty()) {
                            for (String s : jysqdh) {
                                ajaxResult = controller.Outpindeltestapply(order.getCardId(), ysbm, s);
                                result2 = getAjaxResult(ajaxResult);
@@ -3080,7 +3080,7 @@
                        }
                        //2.1.6.9 作废门诊治疗处置申请
                        if (null != zlsqdh && zlsqdh.size()>0) {
                        if (null != zlsqdh && !zlsqdh.isEmpty()) {
                            for (String s : zlsqdh) {
                                ajaxResult = controller.Outpintdelreatapply(order.getCardId(), ysbm, s);
                                result2 = getAjaxResult(ajaxResult);
@@ -3095,7 +3095,7 @@
                        }
                        //作废药品申请
                        if(null !=cfhs && cfhs.size()>0){
                        if(null !=cfhs && !cfhs.isEmpty()){
                            for (String cfh : cfhs) {
                                AjaxResult result = controller.Outpindelmedicapply(order.getCardId(), ysbm, cfh);
                                String result1 = getAjaxResult(result);
@@ -3204,6 +3204,111 @@
        return true;
    }
    public void ZfBlHisApiMethod(String tjh,String bldh) {
        TjOrder order = orderService.getOrderByTjNum(tjh);
        if(null !=order){
            String ysbm = configService.selectConfigByKey("request_default_ysbm");
            List<String> zlsqdh = orderService.getHuoQuBlZlsqdh(order.getCardId(),bldh);
            List<String> jcsqdh = orderService.getHuoQuBlJcsqdh(order.getCardId(),bldh);
            List<String> jysqdh = orderService.getHuoQuBlJysqdh(order.getCardId(),bldh);
            List<String> cfhs = cfService.getCfBlhs(order.getCardId(),bldh);
            AjaxResult ajaxResult = null;
            String result2 = null;
            JSONObject object1 = null;
            String code1 = null;
            log.info("查询前");
            TjCustomer customer1 = customerService.getById(order.getUserId());
            log.info("customer1 ->{}",customer1);
            List<String> bljcsqdhByPacs = orderService.getBljcsqdhByPacs(order.getCardId(), bldh);
            log.info("bljcsqdhByPacs ->{}",bljcsqdhByPacs);
            // 作废检查申请
            if (bljcsqdhByPacs != null && !bljcsqdhByPacs.isEmpty()){
                for (String sqdh : bljcsqdhByPacs) {
                    AjaxResult cancelPacsAjaxResult = pacsApiMethodService.updatePacsApply(sqdh, order.getCardId(), customer1.getCusName());
                    log.info("作废检查 pacs返回 ->{}",JSONUtil.toJsonStr(cancelPacsAjaxResult));
                    String result = cancelPacsAjaxResult.get("data").toString();
                    JSONObject object = JSONUtil.parseObj(result);
                    String code = object.getStr("ResultCode");
                    if(code.equals("1")){
                        orderService.delHuoQuBlJcsqdh(order.getCardId(),bldh);
                    }
                }
            }
            List<String> bljysqdhByLis = orderService.getBljysqdhByLis(order.getCardId(), bldh);
            log.info("bljysqdhByLis ->{}",bljysqdhByLis);
            // 作废检验申请
            if (bljysqdhByLis != null && !bljysqdhByLis.isEmpty()){
                for (String sqdh : bljysqdhByLis) {
                    AjaxResult cancelLisAjaxResult = lisApiMethod.cancel(sqdh, order.getCardId(), customer1.getCusName());
                    log.info("作废检验 lis返回 ->{}",JSONUtil.toJsonStr(cancelLisAjaxResult));
                    String result = cancelLisAjaxResult.get("data").toString();
                    JSONObject object = JSONUtil.parseObj(result);
                    String code= object.getStr("ResultCode");
                    if(code.equals("1")){
                        orderService.delHuoQuBlJysqdh(order.getCardId(),bldh);
                    }
                }
            }
            if (null != jcsqdh && !jcsqdh.isEmpty()) {
                for (String s : jcsqdh) {
                    AjaxResult result = controller.Outpindelexamapply(order.getCardId(), ysbm, s);
                    String result1 = getAjaxResult(result);
                    JSONObject object = getJSONObject(result1);
                    String code = object.getStr("ResultCode");
                    if (code.equals("0")) {
                        orderService.delHuoQuBlJcsqdh(order.getCardId(),bldh);
                    }
                }
            }
            //2.1.6.3 作废门诊检验申请
            if (null != jysqdh && !jysqdh.isEmpty()) {
                for (String s : jysqdh) {
                    ajaxResult = controller.Outpindeltestapply(order.getCardId(), ysbm, s);
                    result2 = getAjaxResult(ajaxResult);
                    object1 = getJSONObject(result2);
                    code1 = object1.getStr("ResultCode");
                    if (code1.equals("0")) {
                        orderService.delHuoQuBlJysqdh(order.getCardId(),bldh);
                    }
                }
            }
            //2.1.6.9 作废门诊治疗处置申请
            if (null != zlsqdh && !zlsqdh.isEmpty()) {
                for (String s : zlsqdh) {
                    ajaxResult = controller.Outpintdelreatapply(order.getCardId(), ysbm, s);
                    result2 = getAjaxResult(ajaxResult);
                    object1 = getJSONObject(result2);
                    code1 = object1.getStr("ResultCode");
                    if (code1.equals("0")) {
                        orderService.delHuoQuZlsqdh(order.getCardId(),bldh);
                    }
                }
            }
            //作废药品申请
            if(null !=cfhs && !cfhs.isEmpty()){
                for (String cfh : cfhs) {
                    AjaxResult result = controller.Outpindelmedicapply(order.getCardId(), ysbm, cfh);
                    String result1 = getAjaxResult(result);
                    JSONObject object = getJSONObject(result1);
                    String code = object.getStr("ResultCode");
                    if(null !=code && code.equals("0")){
                        cfService.delCfByCardId(cfh);
                    }
                }
            }
        }
    }
    //获取门诊结算记录
    @Transactional
    public void getHisMzJsJl(TjOrder order) {