From bd7edb8e72b3f81b49f563089e33f2cd7eccd4c4 Mon Sep 17 00:00:00 2001
From: yxFwq <1>
Date: 星期六, 23 十一月 2024 16:44:43 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/JarThread.java | 5 +++++
src/main/resources/mapper/BasJarMapper.xml | 1 +
src/main/java/com/zy/core/model/protocol/JarProtocol.java | 8 ++++++++
src/main/java/com/zy/asrs/entity/BasJar.java | 8 ++++++++
4 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/asrs/entity/BasJar.java b/src/main/java/com/zy/asrs/entity/BasJar.java
index 5ec2df0..bbdaa48 100644
--- a/src/main/java/com/zy/asrs/entity/BasJar.java
+++ b/src/main/java/com/zy/asrs/entity/BasJar.java
@@ -8,6 +8,7 @@
import lombok.Data;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
+import java.util.Date;
@Data
@TableName("asr_bas_jar")
@@ -167,6 +168,13 @@
@TableField("jar_pressure")
private Float jarPressure;
+ /**
+ * 淇濇俯鏃堕棿
+ */
+ @ApiModelProperty(value= "淇濇俯鏃堕棿")
+ @TableField("holding_time")
+ private Date holdingTime;
+
public BasJar() {}
public BasJar(Integer jarNo,Integer region,Integer jarCode,Integer staNo,Integer jarStatus,Integer jarCount,Integer jarErr,String leftDoor,String rightDoor,String leftInEnable,String leftOutEnable,String autoing,Integer jarMode,String rightInEnable,String rightOutEnable) {
diff --git a/src/main/java/com/zy/core/model/protocol/JarProtocol.java b/src/main/java/com/zy/core/model/protocol/JarProtocol.java
index 2b391e3..bebf57a 100644
--- a/src/main/java/com/zy/core/model/protocol/JarProtocol.java
+++ b/src/main/java/com/zy/core/model/protocol/JarProtocol.java
@@ -7,6 +7,8 @@
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
+import java.util.Date;
+
/**
* Created by vincent on 2024/6/21
*/
@@ -111,6 +113,9 @@
public Float jarTemperature;
public Float jarPressure;
+ public boolean holdingSign = false;
+ public Short upStatus = 0;
+
/**
@@ -153,6 +158,9 @@
basJar.setAutoing(autoing?"Y":"N");
basJar.setJarTemperature(jarTemperature);
basJar.setJarPressure(jarPressure);
+ if (holdingSign){
+ basJar.setHoldingTime(new Date());
+ }
return basJar;
}
diff --git a/src/main/java/com/zy/core/thread/JarThread.java b/src/main/java/com/zy/core/thread/JarThread.java
index 3b2b223..6442301 100644
--- a/src/main/java/com/zy/core/thread/JarThread.java
+++ b/src/main/java/com/zy/core/thread/JarThread.java
@@ -178,6 +178,11 @@
jarProtocol.setAutoing(siemensS7Net.getByteTransform().TransInt16(result.Content, 12) == 2);//鑷姩
+ if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){
+ jarProtocol.setHoldingSign(!jarProtocol.getStatus().equals(jarProtocol.getUpStatus()));
+ }
+
+ jarProtocol.setUpStatus(jarProtocol.getStatus());
//
// jarProtocol.setMode(2);//妯″紡
// jarProtocol.setStatus((short)6);//鐘舵��
diff --git a/src/main/resources/mapper/BasJarMapper.xml b/src/main/resources/mapper/BasJarMapper.xml
index 37ea04b..f86f4bf 100644
--- a/src/main/resources/mapper/BasJarMapper.xml
+++ b/src/main/resources/mapper/BasJarMapper.xml
@@ -26,6 +26,7 @@
<result column="burial" property="burial" />
<result column="jar_temperature" property="jarTemperature" />
<result column="jar_pressure" property="jarPressure" />
+ <result column="holding_time" property="holdingTime" />
</resultMap>
--
Gitblit v1.9.1