From 6b268e3e7ee7e71d4dcb7760b005242679a1608f Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期四, 25 一月 2024 15:23:55 +0800
Subject: [PATCH] 2024-01-25 朱宝民 优化获取用户信息接口

---
 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java |   50 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java
index 9a98da4..9ff24a4 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java
@@ -1,7 +1,10 @@
 package com.dy.pipIrrProject.controller;
 
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONArray;
 import com.dy.common.webUtil.QueryResultVo;
 import com.dy.pipIrrGlobal.daoPr.PrControllerMapper;
+import com.dy.pipIrrGlobal.daoPr.PrIntakeMapper;
 import com.dy.pipIrrGlobal.pojoPr.PrController;
 import com.dy.pipIrrGlobal.voPr.VoController;
 import lombok.extern.slf4j.Slf4j;
@@ -12,6 +15,7 @@
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 
 /**
  * @author ZhuBaoMin
@@ -25,6 +29,9 @@
 public class ControllerSv {
     @Autowired
     private PrControllerMapper prControllerMapper;
+
+    @Autowired
+    private PrIntakeMapper prIntakeMapper;
 
     /**
      * 鏍规嵁鎸囧畾鑾峰彇鎺у埗鍣ㄨ褰�
@@ -65,12 +72,12 @@
     }
 
     /**
-     * 鏍规嵁鎺у埗鍣ㄧ紪鍙疯幏鍙栨帶鍒跺櫒鍒楄〃
-     * @param controllerCode
+     * 鏍规嵁鎺у埗鍣ㄥ湴鍧�鑾峰彇鎺у埗鍣ㄥ垪琛�
+     * @param rtuAddr
      * @return
      */
-    public List<Map<String, Object>> getControllersByCode(String controllerCode) {
-        return prControllerMapper.getControllersByCode(controllerCode);
+    public List<Map<String, Object>> getControllersByAddr(String rtuAddr) {
+        return prControllerMapper.getControllersByAddr(rtuAddr);
     }
 
     /**
@@ -94,7 +101,42 @@
         return rsVo ;
     }
 
+    /**
+     * 鏍规嵁鎺у埗鍣ㄧ紪鍙疯幏鍙栨湭鍒犻櫎鐨勬帶鍒跺櫒鏁伴噺
+     * @param controllerId
+     * @return
+     */
     public Integer getRecordCountOfController(Long controllerId) {
         return prControllerMapper.getRecordCountOfController(controllerId);
     }
+    /**
+     * 鏍规嵁鎺у埗鍣ㄧ紪鍙疯幏鍙栧凡缁戝畾璁板綍鏁�
+     * @param controllerId
+     * @return
+     */
+    public Integer getBindedCount(Long controllerId) {
+        return prControllerMapper.getBindedCount(controllerId);
+    }
+
+    /**
+     * 鏍规嵁涓婚敭鍒犻櫎澶栭敭
+     * @param controllerId
+     * @return
+     */
+    public Integer deleteIntakeId(Long controllerId) {
+        return prControllerMapper.deleteIntakeId(controllerId);
+    }
+
+    /**
+     * 鑾峰彇鏈粦鎺у埗鍣ㄧ殑鍙栨按鍙e垪琛�
+     * @return
+     */
+    public JSONArray getNoBindingIntakes() {
+        List<Map<String, Object>> list = Optional.ofNullable(prIntakeMapper.getNoBindingIntakes()).orElse(new ArrayList<>());
+        JSONArray array= null;
+        if(list.size() > 0) {
+            array= JSONArray.parseArray(JSON.toJSONString(list));
+        }
+        return array;
+    }
 }

--
Gitblit v1.8.0