From 769f5f1c452560ab044fee905c1c514c9ca373bb Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期四, 10 七月 2025 17:45:13 +0800
Subject: [PATCH] zjh20250710

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java |  117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 111 insertions(+), 6 deletions(-)

diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java
index 8285d91..c56b4a0 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java
+++ b/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) {

--
Gitblit v1.8.0