From 16158b89f0223db6a4501e5263f6d2817b562b09 Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期五, 14 六月 2024 13:40:36 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

---
 pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandSv.java |   90 +++++++++++++++++++++++++++++----------------
 1 files changed, 58 insertions(+), 32 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandSv.java
index 7482f9d..58b3bf7 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandSv.java
@@ -5,19 +5,22 @@
 import com.alibaba.fastjson2.JSONObject;
 import com.dy.common.mw.protocol.Command;
 import com.dy.common.webUtil.QueryResultVo;
-import com.dy.pipIrrGlobal.daoPr.PrControllerMapper;
+import com.dy.pipIrrGlobal.command.ComSupport;
 import com.dy.pipIrrGlobal.daoPr.PrIntakeMapper;
+import com.dy.pipIrrGlobal.daoPr.PrIntakeVcMapper;
+import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper;
 import com.dy.pipIrrGlobal.daoRm.RmCommandHistoryMapper;
 import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper;
 import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory;
 import com.dy.pipIrrGlobal.voPr.VoOnLineIntake;
+import com.dy.pipIrrGlobal.voRm.VoUnclosedParam;
 import com.dy.pipIrrGlobal.voRm.VoUnclosedValve;
-import com.dy.pipIrrRemote.common.qo.OnLineIntakesQO;
+import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.dubbo.common.utils.PojoUtils;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -34,17 +37,26 @@
 @RequiredArgsConstructor
 public class CommandSv extends ComSupport {
     private final RmCommandHistoryMapper rmCommandHistoryMapper;
-    private final PrControllerMapper prControllerMapper;
     private final SeVirtualCardMapper seVirtualCardMapper;
     private final PrIntakeMapper prIntakeMapper;
+    private final PrWaterPriceMapper prWaterPriceMapper;
+    private final PrIntakeVcMapper prIntakeVcMapper;
 
     /**
-     * 鏍规嵁鍙栨按鍙D鑾峰彇闃�鎺у櫒鍦板潃
-     * @param intakeId 鍙栨按鍙D
-     * @return 闃�鎺у櫒鍦板潃
+     * 铏氭嫙鍗D鎹㈣櫄鎷熷崱瀵硅薄
+     * @param vcId
+     * @return
      */
-    public String getRtuAddrByIntakeId(Long intakeId) {
-        return prControllerMapper.getRtuAddrByIntakeId(intakeId);
+    public VoVirtualCard getVcById(Long vcId) {
+        return seVirtualCardMapper.getVcById(vcId);
+    }
+
+    /**
+     * 鑾峰彇姘翠环
+     * @return
+     */
+    public Double getPrice() {
+        return prWaterPriceMapper.getPrice();
     }
 
     /**
@@ -52,9 +64,9 @@
      * @param po 鍛戒护鏃ュ織瀵硅薄
      * @return 瀛楃涓茬被鍨嬬殑涓婚敭
      */
-    public String insert(RmCommandHistory po) {
+    public Long insert(RmCommandHistory po) {
         rmCommandHistoryMapper.insert(po);
-        return (po.getId()).toString();
+        return po.getId();
     }
 
     /**
@@ -66,21 +78,12 @@
         return rmCommandHistoryMapper.updateByPrimaryKeySelective(po);
     }
 
-
     /**
-     * 鏍规嵁鎿嶄綔鍛業D鑾峰彇鏈叧闃�璁板綍
+     * 鏍规嵁鎿嶄綔鍛業D鑾峰彇鏈叧闃�璁板綍锛堝寘鍚湪绾挎儏鍐碉級
      * @param operator
      * @return
      */
     public List<VoUnclosedValve> getUnclosedValves(Long operator) {
-        return rmCommandHistoryMapper.getUnclosedValves(operator);
-    }
-
-    /**
-     * 鑾峰彇鍙栨按鍙e垪琛�
-     * @return
-     */
-    public QueryResultVo<List<VoOnLineIntake>> selectOnLineIntakes(OnLineIntakesQO qo) {
         Command com = new Command() ;
         com.id = Command.defaultId;
         com.code = "LCD0001";
@@ -100,20 +103,43 @@
                 jsonArray.add(jsonObject);
             }
 
-            qo.setOnLineMap(jsonArray.toJSONString());
-            Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ;
-            Long itemTotal = prIntakeMapper.getOnLineIntakesCount(params);
-
-            QueryResultVo<List<VoOnLineIntake>> rsVo = new QueryResultVo<>() ;
-            rsVo.pageSize = qo.pageSize ;
-            rsVo.pageCurr = qo.pageCurr ;
-            rsVo.calculateAndSet(itemTotal, params);
-            rsVo.obj = prIntakeMapper.getOnLineIntakes(params);
-            return rsVo;
+            System.out.println(jsonArray);
+            List<VoUnclosedValve> res = rmCommandHistoryMapper.getUnclosedValves(jsonArray.toJSONString(), operator);
+            if(res != null) {
+                return res;
+            } else {
+                return new ArrayList<>();
+            }
         } else {
             QueryResultVo<List<VoOnLineIntake>> rsVo = new QueryResultVo<>();
-            return rsVo;
+            return new ArrayList<>();
         }
     }
 
+    /**
+     * 淇敼鍛戒护鏃ュ織璁板綍锛屽洖璋冩姤閿欐椂灏嗗懡浠よ褰曠殑鎵ц缁撴灉鏀逛负澶辫触
+     * @param po
+     * @return
+     */
+    public Integer updateCommandResult(RmCommandHistory po) {
+        return rmCommandHistoryMapper.updateByPrimaryKeySelective(po);
+    }
+
+    /**
+     * 鏍规嵁鍙栨按鍙D鑾峰彇涓庝箣缁戝畾铏氭嫙鍗D
+     * @param intakeId
+     * @return
+     */
+    public Long getVcIdByIntakeId(Long intakeId) {
+        return prIntakeVcMapper.getVcIdByIntakeId(intakeId);
+    }
+
+    /**
+     * 鏍规嵁鍙栨按鍙D鑾峰彇璇ュ彇姘村彛鏈叧闃�鍙傛暟锛屽钩鍙伴�夋嫨鍙栨按鍙e叧闃�浣跨敤
+     * @param intakeId
+     * @return
+     */
+    public VoUnclosedParam getUncloseParam(Long intakeId) {
+        return rmCommandHistoryMapper.getUncloseParam(intakeId);
+    }
 }

--
Gitblit v1.8.0