From 46fab8daeed497e8529e7070712ceca9b04ee0f7 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期五, 11 七月 2025 19:38:39 +0800
Subject: [PATCH] 代码提交

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java |   62 ++++++++-----------------------
 1 files changed, 16 insertions(+), 46 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 5d9f40e..81ea577 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
@@ -25,6 +25,9 @@
 import cn.lihu.jh.module.ecg.feign.FeeConfirmFeignService;
 import cn.lihu.jh.module.ecg.service.queue.QueueServiceTxFunctions;
 import cn.lihu.jh.module.ecg.webservice.WebServiceClient;
+import cn.lihu.jh.module.infra.dal.dataobject.config.ConfigDO;
+import cn.lihu.jh.module.infra.dal.mysql.config.ConfigMapper;
+import cn.lihu.jh.module.infra.service.config.ConfigService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -76,11 +79,11 @@
     @Resource
     CheckTypeMapper checkTypeMapper;
 
+    @Resource
+    private ConfigService configService;
+
     @Autowired
     private WebServiceClient webServiceClient;
-
-    @Value("${spring.profiles.active}")
-    private String active;
 
 
     @Override
@@ -163,7 +166,8 @@
         }
 
         //妫�鏌ュ畬鎴愬悗锛屾鏃舵鏌ョ櫥璁板啓鎴愪簡锛岄渶瑕佸皢杩欎釜鍥炲啓缁欓泦鎴愬钩鍙�(绾夸笂鐜鎵嶅洖鍐�)
-        if (active.equals("prod")) {
+        ConfigDO configDO = configService.getConfigByKey("ecg.back.data");
+        if (configDO.getValue().equals("1")) {
             if (createReqVO.getCheckType() != 100 && createReqVO.getCheckType() != 1000 && createReqVO.getCheckType() != 1100 && createReqVO.getCheckType() != 1400 && createReqVO.getCheckType() != 1500) {
                 AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo());
                 ApplicationTemplate app = new ApplicationTemplate();
@@ -175,15 +179,6 @@
                     //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3
                     appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3", new Date());
                 }
-            } else {
-                //妫�鏌ョ被鍨嬫槸搴婅竟鐨勬垨甯歌鐨勶紝闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚7
-                appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null);
-            }
-        } else {
-            if (createReqVO.getCheckType() != 100 && createReqVO.getCheckType() != 1000 && createReqVO.getCheckType() != 1100 && createReqVO.getCheckType() != 1400 && createReqVO.getCheckType() != 1500) {
-                //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3
-                appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null);
-
             } else {
                 //妫�鏌ョ被鍨嬫槸搴婅竟鐨勬垨甯歌鐨勶紝闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚7
                 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null);
@@ -215,7 +210,8 @@
         }
 
         //璁惧棰嗗彇瀹屾垚鍚庯紝姝ゆ椂妫�鏌ョ櫥璁板啓鎴愪簡锛岄渶瑕佸皢杩欎釜鍥炲啓缁欓泦鎴愬钩鍙�(绾夸笂鐜鎵嶅洖鍐�)
-        if (active.equals("prod")) {
+        ConfigDO configDO = configService.getConfigByKey("ecg.back.data");
+        if (configDO.getValue().equals("1")) {
             AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo());
             ApplicationTemplate app = new ApplicationTemplate();
             String action = "S0405";
@@ -226,9 +222,6 @@
                 //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3
                 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3", new Date());
             }
-        } else {
-            appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3", new Date());
-
         }
         List<Integer> jobTypeList = new ArrayList<Integer>();
         jobTypeList.add(DevRentStateEnum.RECEIVED.getState());
@@ -488,7 +481,8 @@
             createReqVO.setState(DevRentStateEnum.ROUTINE_CANCELLED.getState());
             updateDevRent(createReqVO);
 
-            if (active.equals("prod")) {
+            ConfigDO configDO = configService.getConfigByKey("ecg.back.data");
+            if (configDO.getValue().equals("1")) {
                 if (cancelReqVO.getCheckType() != 100 && cancelReqVO.getCheckType() != 1000 && cancelReqVO.getCheckType() != 1100 && cancelReqVO.getCheckType() != 1400 && cancelReqVO.getCheckType() != 1500) {
                     AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo());
                     ApplicationTemplate app = new ApplicationTemplate();
@@ -500,15 +494,6 @@
                         //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3
                         appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null);
                     }
-                } else {
-                    //妫�鏌ョ被鍨嬫槸搴婅竟鐨勬垨甯歌鐨勶紝闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚7
-                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null);
-                }
-            } else {
-                if (cancelReqVO.getCheckType() != 100 && cancelReqVO.getCheckType() != 1000 && cancelReqVO.getCheckType() != 1100 && cancelReqVO.getCheckType() != 1400 && cancelReqVO.getCheckType() != 1500) {
-                    //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3
-                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null);
-
                 } else {
                     //妫�鏌ョ被鍨嬫槸搴婅竟鐨勬垨甯歌鐨勶紝闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚7
                     appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null);
@@ -580,7 +565,8 @@
             createReqVO.setState(DevRentStateEnum.RECEIVED_CANCELLED.getState());
             updateDevRent(createReqVO);
 
-            if (active.equals("prod")) {
+            ConfigDO configDO = configService.getConfigByKey("ecg.back.data");
+            if (configDO.getValue().equals("1")) {
                 AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo());
                 ApplicationTemplate app = new ApplicationTemplate();
                 String action = "S0405";
@@ -590,15 +576,6 @@
                 if (s.contains("鏇存柊鎴愬姛")) {
                     //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3
                     appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null);
-                }
-            } else {
-                if (cancelReqVO.getCheckType() != 100 && cancelReqVO.getCheckType() != 1000 && cancelReqVO.getCheckType() != 1100 && cancelReqVO.getCheckType() != 1400 && cancelReqVO.getCheckType() != 1500) {
-                    //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3
-                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null);
-
-                } else {
-                    //妫�鏌ョ被鍨嬫槸搴婅竟鐨勬垨甯歌鐨勶紝闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚7
-                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null);
                 }
             }
 
@@ -663,7 +640,8 @@
             createReqVO.setState(DevRentStateEnum.INSTALL_CANCELLED.getState());
             updateDevRent(createReqVO);
 
-            if (active.equals("prod")) {
+            ConfigDO configDO = configService.getConfigByKey("ecg.back.data");
+            if (configDO.getValue().equals("1")) {
                 AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo());
                 ApplicationTemplate app = new ApplicationTemplate();
                 String action = "S0405";
@@ -673,14 +651,6 @@
                 if (s.contains("鏇存柊鎴愬姛")) {
                     //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3
                     appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null);
-                }
-            } else {
-                //杩欓噷鏄祴璇曟湰鍦颁慨鏀�
-                if (cancelReqVO.getCheckType() != 100 && cancelReqVO.getCheckType() != 1000 && cancelReqVO.getCheckType() != 1100 && cancelReqVO.getCheckType() != 1400 && cancelReqVO.getCheckType() != 1500) {
-                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null);
-
-                } else {
-                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null);
                 }
             }
 

--
Gitblit v1.9.3