From 5ba25cb53dab2ef0f8052a93796ef67a8a2ee820 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 10 六月 2025 14:53:49 +0800
Subject: [PATCH] 代码提交

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java |   87 +++++++++++++++++++++++++++++++++++++------
 1 files changed, 75 insertions(+), 12 deletions(-)

diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
index 263b9a5..6ec2cc4 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
@@ -24,8 +24,10 @@
 import cn.lihu.jh.module.ecg.enums.QueueStatusEnum;
 import cn.lihu.jh.module.ecg.feign.FeeConfirmFeignService;
 import cn.lihu.jh.module.ecg.service.queue.QueueServiceTxFunctions;
-import cn.lihu.jh.module.ecg.webservice.client.JHFWWebServiceClient;
+import cn.lihu.jh.module.ecg.webservice.WebServiceClient;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.validation.annotation.Validated;
@@ -73,8 +75,11 @@
     @Resource
     CheckTypeMapper checkTypeMapper;
 
-    @Resource
-    private JHFWWebServiceClient jhfwWebServiceClient;
+    @Autowired
+    private WebServiceClient webServiceClient;
+
+    @Value("${spring.profiles.active}")
+    private String active;
 
 
     @Override
@@ -156,6 +161,20 @@
             procAffinityWhenRoutineFinish(firstOnStageQueueItem.getPatId(), checkTypeDO.getAffinityCheckTypes());
         }
 
+        //妫�鏌ュ畬鎴愬悗锛屾鏃舵鏌ョ櫥璁板啓鎴愪簡锛岄渶瑕佸皢杩欎釜鍥炲啓缁欓泦鎴愬钩鍙�(绾夸笂鐜鎵嶅洖鍐�)
+        if (active.equals("prod")) {
+            AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo());
+            ApplicationTemplate app = new ApplicationTemplate();
+            String action = "S0405";
+            String message = app.getXML(createReqVO.getApplyNo(), "3", "妫�鏌ョ櫥璁�", createReqVO.getOperater(), appointmentDO.getPatDeptCode(), appointmentDO.getPatDeptDesc(), appointmentDO.getPatWardCode(), appointmentDO.getPatWardDesc(), appointmentDO.getPatBedNo(), appointmentDO.getEpisodeId(), "" + appointmentDO.getBookSrc(), appointmentDO.getPatId(), appointmentDO.getPatName());
+            String s = webServiceClient.callJHFWTYRK(action, "", message);
+            log.info("routineFinishWebServiceClient鐨勮繑鍥炲�间负锛歿}", s);
+            if (s.contains("鏇存柊鎴愬姛")) {
+                //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3
+                appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3");
+            }
+        }
+
         return CommonResult.success(rent_id);
     }
 
@@ -180,14 +199,19 @@
             throw exception(DEVICE_NOT_FREE);
         }
 
-//        //璁惧棰嗗彇瀹屾垚鍚庯紝姝ゆ椂妫�鏌ョ櫥璁板啓鎴愪簡锛岄渶瑕佸皢杩欎釜鍥炲啓缁欓泦鎴愬钩鍙�
-//        String action = "S0405";
-//        String message = "";
-
-
-//        jhfwWebServiceClient.callJHFWTYRK(action, message);
-
-
+        //璁惧棰嗗彇瀹屾垚鍚庯紝姝ゆ椂妫�鏌ョ櫥璁板啓鎴愪簡锛岄渶瑕佸皢杩欎釜鍥炲啓缁欓泦鎴愬钩鍙�(绾夸笂鐜鎵嶅洖鍐�)
+        if (active.equals("prod")) {
+            AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo());
+            ApplicationTemplate app = new ApplicationTemplate();
+            String action = "S0405";
+            String message = app.getXML(createReqVO.getApplyNo(), "3", "妫�鏌ョ櫥璁�", createReqVO.getOperater(), appointmentDO.getPatDeptCode(), appointmentDO.getPatDeptDesc(), appointmentDO.getPatWardCode(), appointmentDO.getPatWardDesc(), appointmentDO.getPatBedNo(), appointmentDO.getEpisodeId(), "" + appointmentDO.getBookSrc(), appointmentDO.getPatId(), appointmentDO.getPatName());
+            String s = webServiceClient.callJHFWTYRK(action, "", message);
+            log.info("webservice鐨勮繑鍥炲�间负锛歿}", s);
+            if (s.contains("鏇存柊鎴愬姛")) {
+                //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3
+                appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3");
+            }
+        }
         List<Integer> jobTypeList = new ArrayList<Integer>();
         jobTypeList.add(DevRentStateEnum.RECEIVED.getState());
         jobTypeList.add(DevRentStateEnum.RECEIVED_CANCELLED.getState());
@@ -446,6 +470,19 @@
             createReqVO.setState(DevRentStateEnum.ROUTINE_CANCELLED.getState());
             updateDevRent(createReqVO);
 
+            if (active.equals("prod")) {
+                AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo());
+                ApplicationTemplate app = new ApplicationTemplate();
+                String action = "S0405";
+                String message = app.getXML(createReqVO.getApplyNo(), "4", "鍙栨秷妫�鏌�", createReqVO.getOperater(), appointmentDO.getPatDeptCode(), appointmentDO.getPatDeptDesc(), appointmentDO.getPatWardCode(), appointmentDO.getPatWardDesc(), appointmentDO.getPatBedNo(), appointmentDO.getEpisodeId(), "" + appointmentDO.getBookSrc(), appointmentDO.getPatId(), appointmentDO.getPatName());
+                String s = webServiceClient.callJHFWTYRK(action, "", message);
+                log.info("routineFinishWebServiceClient鐨勮繑鍥炲�间负锛歿}", s);
+                if (s.contains("鏇存柊鎴愬姛")) {
+                    //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3
+                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4");
+                }
+            }
+
             JobRecordSaveReqVO jobRecordSaveReqVO = new JobRecordSaveReqVO();
             jobRecordSaveReqVO.setRentId(rent_id);
             jobRecordSaveReqVO.setDevId(null);
@@ -506,6 +543,20 @@
             createReqVO.setState(DevRentStateEnum.RECEIVED_CANCELLED.getState());
             updateDevRent(createReqVO);
 
+            if (active.equals("prod")) {
+                AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo());
+                ApplicationTemplate app = new ApplicationTemplate();
+                String action = "S0405";
+                String message = app.getXML(createReqVO.getApplyNo(), "4", "鍙栨秷妫�鏌�", createReqVO.getOperater(), appointmentDO.getPatDeptCode(), appointmentDO.getPatDeptDesc(), appointmentDO.getPatWardCode(), appointmentDO.getPatWardDesc(), appointmentDO.getPatBedNo(), appointmentDO.getEpisodeId(), "" + appointmentDO.getBookSrc(), appointmentDO.getPatId(), appointmentDO.getPatName());
+                String s = webServiceClient.callJHFWTYRK(action, "", message);
+                log.info("routineFinishWebServiceClient鐨勮繑鍥炲�间负锛歿}", s);
+                if (s.contains("鏇存柊鎴愬姛")) {
+                    //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3
+                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4");
+                }
+            }
+
+
             JobRecordSaveReqVO jobRecordSaveReqVO = new JobRecordSaveReqVO();
             jobRecordSaveReqVO.setRentId(rent_id);
             jobRecordSaveReqVO.setDevId(null);
@@ -565,6 +616,19 @@
             createReqVO.setId(rent_id);
             createReqVO.setState(DevRentStateEnum.INSTALL_CANCELLED.getState());
             updateDevRent(createReqVO);
+
+            if (active.equals("prod")) {
+                AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo());
+                ApplicationTemplate app = new ApplicationTemplate();
+                String action = "S0405";
+                String message = app.getXML(createReqVO.getApplyNo(), "4", "鍙栨秷妫�鏌�", createReqVO.getOperater(), appointmentDO.getPatDeptCode(), appointmentDO.getPatDeptDesc(), appointmentDO.getPatWardCode(), appointmentDO.getPatWardDesc(), appointmentDO.getPatBedNo(), appointmentDO.getEpisodeId(), "" + appointmentDO.getBookSrc(), appointmentDO.getPatId(), appointmentDO.getPatName());
+                String s = webServiceClient.callJHFWTYRK(action, "", message);
+                log.info("routineFinishWebServiceClient鐨勮繑鍥炲�间负锛歿}", s);
+                if (s.contains("鏇存柊鎴愬姛")) {
+                    //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3
+                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4");
+                }
+            }
 
             JobRecordSaveReqVO jobRecordSaveReqVO = new JobRecordSaveReqVO();
             jobRecordSaveReqVO.setRentId(rent_id);
@@ -886,6 +950,5 @@
 
         return "01";
     }
-
 }
 

--
Gitblit v1.9.3