From ff584d153492ea746690cf8e05c2b859f170ae0b Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期三, 07 八月 2024 18:10:47 +0800
Subject: [PATCH] zjh 2024/08/07-1

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java |   44 ++++++++++++++++++++++----------------------
 1 files changed, 22 insertions(+), 22 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 5e97d13..bce6b5c 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
@@ -14,6 +14,7 @@
 import com.ltkj.system.service.ISysConfigService;
 import com.ltkj.system.service.ISysDeptService;
 import jdk.nashorn.internal.runtime.logging.Logger;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
@@ -28,6 +29,7 @@
  * */
 
 @Component
+@Slf4j
 public class HisApiMethod {
     @Autowired
     private HisApiMethodService controller;
@@ -73,10 +75,10 @@
 
     //瀵规帴his鎬绘帴鍙�  娉ㄥ唽鎸傚彿鎺ヨ瘖鐢宠鍗曟搷浣�
     @Logger
-    public AjaxResult HisApiMethods(TjCustomer customer, Long orderId) {
+    public AjaxResult HisApiMethods(TjCustomer customer,TjOrder tjOrder) {
         String jzh=null;
         try {
-            TjOrder tjOrder = orderService.getById(orderId);
+//            TjOrder tjOrder = orderService.getById(orderId);
             Date dates = new Date();
             final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss");
             OutpinregapplyDto outpinregapplyDto = new OutpinregapplyDto();
@@ -109,7 +111,14 @@
                     hisApiGetMethodService.save(object4, "Outpinregapply", hisApiConfig, JSONUtil.toJsonStr(BeanUtil.beanToMap(outpinregapplyDto)));
 
                     //闂ㄨ瘖鍖荤敓鎺ヨ瘖
-                    controller.Outpinconapply(hisRegistrationId, date, "00029");
+                    AjaxResult result = controller.Outpinconapply(hisRegistrationId, date, "00029");
+                    String result3 = getAjaxResult(result);
+                    JSONObject object2 = getJSONObject(result3);
+                    String code2 = object2.getStr("ResultCode");
+                    if (!code2.equals("0")) {
+                        return AjaxResult.error(object2.getStr("ResultContent"));
+                    }
+                    log.info("his鎺ュ彛-----鍖荤敓鎺ヨ瘖鎴愬姛!");
                     if(null != tjOrder.getTjCategory() && !tjOrder.getTjCategory().equals("13")){
                       customer.setCardId(hisRegistrationId);
                     }else {
@@ -147,7 +156,7 @@
                 dto.setSfqj("0");
                 dto.setJzqk(9);
                 controller.Outpinimpapply(dto);
-                return tijianshenqing(customer, date,tjOrder.getCardId());
+                return AjaxResult.success();
             }
             return AjaxResult.error();
         } catch (Exception e) {
@@ -158,7 +167,7 @@
 
 
     //浣撴瀵筯is鐢宠鍗曡皟鐢ㄦ柟娉�
-    private AjaxResult tijianshenqing(TjCustomer customer, String date,String cardId) {
+    public AjaxResult tijianshenqing(TjCustomer customer, String date,String cardId) {
         //妫�楠岀敵璇�
         OutpintestapplyDto dto = new OutpintestapplyDto();
         dto.setHisRegistrationId(cardId);
@@ -553,11 +562,11 @@
             String result1 = getAjaxResult(result);
             JSONObject object = getJSONObject(result1);
             String code = object.getStr("ResultCode");
-            if(null !=code && code.equals("200")){
-                JSONArray resultData = object.getJSONArray("ResultData");
-                Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0);
-                String cfh = resultDatasss.get("cfh").toString();
-
+            if(null !=code && code.equals("0")){
+                JSONObject resultData = object.getJSONObject("ResultData");
+//                Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0);
+                String cfh = resultData.getStr("cfh");
+                log.info("鑽搧鐢宠鍚庣殑澶勬柟鍙锋槸: "+cfh+"  outpinmedicapplyDetilsDtos 閲岄潰鐨勫�间负: "+outpinmedicapplyDetilsDtos.toString());
                 for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) {
                     TjCf cf=new TjCf();
                     cf.setCardId(cardId);
@@ -661,7 +670,7 @@
                 String result1 = getAjaxResult(result);
                 JSONObject object = getJSONObject(result1);
                 String code = object.getStr("ResultCode");
-                if(null !=code && code.equals("200")){
+                if(null !=code && code.equals("0")){
                     cfService.delCfByCardId(cfh);
                 }
             }
@@ -751,7 +760,7 @@
                             String result1 = getAjaxResult(result);
                             JSONObject object = getJSONObject(result1);
                             String code = object.getStr("ResultCode");
-                            if(null !=code && code.equals("200")){
+                            if(null !=code && code.equals("0")){
                                 cfService.delCfByCardId(cfh);
                             }
                         }
@@ -792,9 +801,6 @@
                 if (code.equals("0")) {
                     orderService.delHuoQuJcsqdh(jzh);
                 }
-//                else {
-//                    return false;
-//                }
             }
 
         }
@@ -816,9 +822,6 @@
                 if (code1.equals("0")) {
                     orderService.delHuoQuJysqdh(jzh);
                 }
-//                else {
-//                    return false;
-//                }
             }
         }
 
@@ -842,7 +845,7 @@
                 String result1 = getAjaxResult(result);
                 JSONObject object = getJSONObject(result1);
                 String code = object.getStr("ResultCode");
-                if(null !=code && code.equals("200")){
+                if(null !=code && code.equals("0")){
                     cfService.delCfByCardId(cfh);
                 }
             }
@@ -854,9 +857,6 @@
         result2 = getAjaxResult(ajaxResult);
         object1 = getJSONObject(result2);
         code1 = object1.getStr("ResultCode");
-//        if (!code1.equals("0")) {
-//            return false;
-//        }
         return true;
     }
 

--
Gitblit v1.8.0