From 656aa4f953eb52502a6414965e46642c31b6e8ee Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 29 四月 2025 15:33:09 +0800
Subject: [PATCH] 设备会在多种功能码上报数据中携带报警与状态数据,这样数据库保存设备报警与状态数据可能很多,为此修改逻辑,当前实现为一设备一个小时内只保存一条报警与状态数据。
---
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java
index 46a4c3b..6bbaac0 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java
@@ -47,6 +47,7 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import java.util.*;
@@ -258,6 +259,7 @@
* @param automaticClose
* @return
*/
+ @Transactional(rollbackFor = Exception.class)
public Map planedOpenTimedClose(AutomaticClose automaticClose, Long planId, Byte operatetype, Date startTime, Integer duration) {
Long intakeId = automaticClose.getIntakeId();
Long vcId = automaticClose.getVcId();
@@ -417,6 +419,7 @@
BaseResponse<Boolean> result = dealWithCommandResult(myParam);
// 濡傛灉鍛戒护鎵ц澶辫触锛屽垯鍐嶆鎵ц鍛戒护
if(!result.isSuccess()) {
+ myParam.setComId(new IDLongGenerator().generate());
result = dealWithCommandResult(myParam);
}
@@ -621,6 +624,7 @@
BaseResponse<Boolean> result = dealWithCommandResult(myParam);
// 濡傛灉鍛戒护鎵ц澶辫触锛屽垯鍐嶆鎵ц鍛戒护
if(!result.isSuccess()) {
+ myParam.setComId(new IDLongGenerator().generate());
result = dealWithCommandResult(myParam);
}
@@ -685,6 +689,7 @@
* @param operatetype
* @return
*/
+ @Transactional(rollbackFor = Exception.class)
public Map closeWx(ValveClose valve, Long planId, Byte operatetype) {
String rtuAddr = valve.getRtuAddr();
String vcNum = valve.getVcNum();
@@ -716,6 +721,7 @@
irIntakeOperate.setOperateType(operatetype);
irIntakeOperate.setCommandId(comId);
irIntakeOperate.setIntakeId(intakeId);
+ irIntakeOperate.setCommandResult((byte)1);
Long id = addIntakeOperate(irIntakeOperate);
if(id == null) {
@@ -797,6 +803,7 @@
BaseResponse<Boolean> result = dealWithCommandResult(myParam);
// 濡傛灉鍛戒护鎵ц澶辫触锛屽垯鍐嶆鎵ц鍛戒护
if(!result.isSuccess()) {
+ myParam.setComId(new IDLongGenerator().generate());
result = dealWithCommandResult(myParam);
}
--
Gitblit v1.8.0