From c4d56f4a2c7687739f3bf0f43bcc1f35c9bbeb8b Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 14 五月 2025 15:18:44 +0800
Subject: [PATCH] 1、表阀一体协议解析同步新版本;2、默认设备是表阀一体(0x02)
---
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/common/ComSv.java | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 48 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/common/ComSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/common/ComSv.java
index 8fc35f5..c9fc53e 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/common/ComSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/common/ComSv.java
@@ -1,12 +1,19 @@
package com.dy.pipIrrRemote.monitor.common;
+import com.alibaba.fastjson2.JSONArray;
+import com.alibaba.fastjson2.JSONObject;
import com.dy.pipIrrGlobal.command.CommandSv;
+import com.dy.pipIrrGlobal.daoPr.PrCommonIntakesMapper;
import com.dy.pipIrrGlobal.daoPr.PrControllerMapper;
import com.dy.pipIrrGlobal.daoRm.RmCommandHistoryMapper;
+import com.dy.pipIrrGlobal.pojoPr.PrCommonIntakes;
import com.dy.pipIrrGlobal.pojoPr.PrController;
import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory;
+import com.dy.pipIrrGlobal.voRm.VoUnclosedParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
/**
* @Author: liurunyu
@@ -19,6 +26,8 @@
protected PrControllerMapper prControllerDao ;
@Autowired
protected RmCommandHistoryMapper rmCommandHistoryDao ;
+ @Autowired
+ private PrCommonIntakesMapper prCommonIntakesDao;
public PrController getRtu(Long intakeId){
return this.getRtu(prControllerDao, intakeId);
@@ -45,4 +54,43 @@
Long operator) {
return this.saveComHistoryPo(rmCommandHistoryDao, comId, protocol, commandCode, commandName, intakeId, rtuAddr, param, operator) ;
}
+
+
+ /**
+ * 娣诲姞甯哥敤鍙栨按鍙f垨鏇存柊浣跨敤淇℃伅
+ * @param operatorId
+ * @param intakeId
+ * @return
+ */
+ public PrCommonIntakes addOrUpdateOftenUseIntake(Long operatorId, Long intakeId) {
+ PrCommonIntakes po = prCommonIntakesDao.selectByOperatorAndIntake(operatorId, intakeId);
+ if(po == null) {
+ po = new PrCommonIntakes();
+ po.setOperatorId(operatorId);
+ po.setIntakeId(intakeId);
+ po.setLastUsedTime(new Date());
+ po.setUsageCount(1);
+ prCommonIntakesDao.insert(po);
+ }else{
+ po.setLastUsedTime(new Date());
+ po.setUsageCount(po.getUsageCount() + 1);
+ prCommonIntakesDao.updateByPrimaryKeySelective(po);
+ }
+ return po ;
+ }
+
+
+ /**
+ * 鏍规嵁鍙栨按鍙D鑾峰彇璇ュ彇姘村彛鏈叧闃�鍙傛暟锛屽钩鍙伴�夋嫨鍙栨按鍙e叧闃�浣跨敤
+ * @param intakeId
+ * @return
+ */
+ public VoUnclosedParam selectUncloseParam(Long intakeId, String rtuAddr) {
+ JSONArray jsonArr = new JSONArray();
+ JSONObject jsonObj = new JSONObject();
+ jsonObj.put("rtuAddr", rtuAddr);
+ jsonObj.put("isOnLine", true);
+ jsonArr.add(jsonObj);
+ return rmCommandHistoryDao.getUncloseParam(jsonArr.toJSONString(), intakeId);
+ }
}
--
Gitblit v1.8.0