From 53af97c5cf578d8feab2b22faa79e3b7a61f4ca8 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 11 七月 2024 21:39:31 +0800
Subject: [PATCH] 1、通信中间件增加机构tag; 2、生成新模块pipIrr-mwTest-rtu

---
 pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java
index 59f32ed..6ad9ae6 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java
@@ -70,9 +70,23 @@
         }
 
         Long intakeId = valve.getIntakeId();
+        String intakeName = valve.getIntakeName();
         Long vcId = valve.getVcId();
+        Boolean forceOpen = valve.getForceOpen();
         Long operator = valve.getOperator();
         Long comId = idLongGenerator.generate();
+
+        if(intakeId == null && intakeName == null) {
+            return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_INTAKE.getMessage());
+        }
+
+        // intakeName鎹ntakeId
+        if(intakeId == null) {
+            intakeId = commandSv.getIntakeIdByName(intakeName);
+            if(intakeId == null) {
+                return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_INTAKE.getMessage());
+            }
+        }
 
         /**
          * 濡傛灉鍐滄埛閫夋嫨浜嗚櫄鎷熷崱锛屽垯浣跨敤璇ヨ櫄鎷熷崱
@@ -96,8 +110,10 @@
         if (vc == null) {
             return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_VC.getMessage());
         }
-        if (vc.getInUse() == 1) {
-            return BaseResponseUtils.buildErrorMsg(WechatResultCode.IN_USE_VC_CANNOT_OPEN_VALVE.getMessage());
+
+        // 铏氭嫙鍗$姸鎬佷负浣跨敤涓紝涓斾笉鏄己鍒跺紑闃�鏃舵彁绀�
+        if (vc.getInUse() == 1 && !forceOpen) {
+            return BaseResponseUtils.buildCodeMsg(WechatResultCode.IN_USE_VC_CANNOT_OPEN_VALVE.getCode(), WechatResultCode.IN_USE_VC_CANNOT_OPEN_VALVE.getMessage());
         }
 
         // 鑾峰彇姘翠环

--
Gitblit v1.8.0