From c70b92da60c0d00625da5fc2369b475e69e0b88e Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 22 八月 2024 11:36:41 +0800
Subject: [PATCH] 1、完善代码和application.yml配置文件,去掉不用的引入文件; 2、init-config.xml配置中增加属性 enable,相应解析类也增加了解析与判断; 3、凡是有Server的应用,加载资源方式改为用springboot的工具类加载; 4、通信协议相关的扫描注解功能实现改为采用reflections-0.10.2,以实现可以在jar包情况下能够扫描类(.class)注解。

---
 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/IntakeControllerCtrl.java |   37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/IntakeControllerCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/IntakeControllerCtrl.java
index 252376c..fe3ca1a 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/IntakeControllerCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/IntakeControllerCtrl.java
@@ -113,17 +113,18 @@
         if (rec_addController == 0) {
             return BaseResponseUtils.buildFail(ProjectResultCode.BIND_FAIL.getMessage());
         }
+//        if (remarks != null || remarks !=""){
+//            // 淇敼缁戝畾璁板綍
+//            PrIntakeController prIntakeController = new PrIntakeController();
+//            prIntakeController.setRemarks(remarks);
+//            prIntakeController.setIntakeid(intakeId);
+//
+//            Integer rec = Optional.ofNullable(intakeControllerSv.updateBindRecord(prIntakeController)).orElse(0);
+//            if (rec == 0) {
+//                return BaseResponseUtils.buildFail(ProjectResultCode.BIND_FAIL.getMessage());
+//            }
+//        }
 
-
-        // 淇敼缁戝畾璁板綍
-        PrIntakeController prIntakeController = new PrIntakeController();
-        prIntakeController.setRemarks(remarks);
-        prIntakeController.setIntakeid(intakeId);
-
-        Integer rec = Optional.ofNullable(intakeControllerSv.updateBindRecord(prIntakeController)).orElse(0);
-        if (rec == 0) {
-            return BaseResponseUtils.buildFail(ProjectResultCode.BIND_FAIL.getMessage());
-        }
 
         // 鏍规嵁娴佹氮鎺у埗鍣ㄧ紪鍙峰垹闄ゆ祦娴帶鍒跺櫒璁板綍
         intakeControllerSv.deleteTrampController(trampControllerId);
@@ -176,13 +177,23 @@
         Date operateTime = new Date();
         prIntakeController.setOperatedt(operateTime);
         prIntakeController.setOperatetype((byte) 2);
+        prIntakeController.setRemarks("瑙g粦");
         Integer rec = Optional.ofNullable(intakeControllerSv.addRecord(prIntakeController)).orElse(0);
         if (rec == 0) {
             return BaseResponseUtils.buildFail(ProjectResultCode.BIND_FAIL.getMessage());
         }
-
-        // 鍒犻櫎鎺у埗鍣ㄥ閿�
-        Integer rec_deleteIntakeId = Optional.ofNullable(controllerSv.deleteIntakeId(po.getControllerId())).orElse(0);
+        //娣诲姞鍒版祦娴帶鍒跺櫒
+        PrController ControllerList = controllerSv.getByControllerId(po.getControllerId());
+        PrControllerTramp prControllerTramp = new PrControllerTramp();
+        prControllerTramp.setRtuAddr(ControllerList.getRtuAddr());
+        prControllerTramp.setProtocol(ControllerList.getProtocol());
+        prControllerTramp.setFindDt(new Date());
+        Integer rec_addControllerTramp = Optional.ofNullable(intakeControllerSv.addTrampController(prControllerTramp)).orElse(0);
+        if (rec_addControllerTramp == 0) {
+            return BaseResponseUtils.buildFail(ProjectResultCode.ADD_TRAMP_CONTROLLER_FAIL.getMessage());
+        }
+        // 鍒犻櫎鎺у埗鍣�
+        Integer rec_deleteIntakeId = Optional.ofNullable(controllerSv.deleteControllerByIdTwo(po.getControllerId())).orElse(0);
         if (rec_deleteIntakeId == 0) {
             return BaseResponseUtils.buildFail(ProjectResultCode.BIND_FAIL.getMessage());
         }

--
Gitblit v1.8.0