From 6a94451b8c17ee4fd19c44bb3d7d2011f83e806b Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期二, 14 十一月 2023 16:45:53 +0800
Subject: [PATCH] 锁数值类型更改
---
ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java | 22 ++++++++++++----------
ard-work/src/main/java/com/ruoyi/sy/domain/ArdSyCarLock.java | 4 ++--
ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java | 4 ++--
ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttOnceCallback.java | 8 ++++----
4 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/sy/domain/ArdSyCarLock.java b/ard-work/src/main/java/com/ruoyi/sy/domain/ArdSyCarLock.java
index fc42f6a..833ccfd 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/domain/ArdSyCarLock.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/domain/ArdSyCarLock.java
@@ -10,7 +10,7 @@
private String imgPositionTop;
private String imgPositionLeft;
private String relay;
- private String relayInfo;
+ private Integer relayInfo;
private String currents;
- private String currentInfo;
+ private Double currentInfo;
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java b/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java
index d3faf70..44b3f46 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java
@@ -448,7 +448,7 @@
for (int j = 0; j < ardSyCarLocks.size(); j++) {
ArdSyCarLock ardSyCarLock = ardSyCarLocks.get(j);
String currents = ardSyCarLock.getCurrents();
- String currentInfo = ardSyCarLock.getCurrentInfo();
+ Double currentInfo = ardSyCarLock.getCurrentInfo();
//鐢垫祦鍊间负4.0鏄叧閿佺姸鎬�
if(currentInfo.equals(4.00)){
lockCloseNum += 1;
@@ -465,7 +465,7 @@
mqttOnce.publishCar("carId",ardSyCarRtu.getTopicPublish(),String.valueOf(new JSONObject(map)),"寮�閿侊細"+currents);
while(true){
ArdSyCarLock ardSyCarLock1 = lockService.getCurrentInfo(ardSyCarRtu.getId(),currents);
- String currentInfo1 = ardSyCarLock1.getCurrentInfo();
+ Double currentInfo1 = ardSyCarLock1.getCurrentInfo();
if(currentInfo1.equals(4.00)){
lockCloseNum +=1;
break;
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java
index 0dd636a..2df708a 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java
@@ -197,21 +197,23 @@
@Override
public List<ArdSyCarLock> data(String msg) {
- String pattern = "0.00"; // 鎸囧畾淇濈暀涓や綅灏忔暟鐨勬牸寮�
- DecimalFormat decimalFormat = new DecimalFormat(pattern); //
+// String pattern = "0.00"; // 鎸囧畾淇濈暀涓や綅灏忔暟鐨勬牸寮�
+// DecimalFormat decimalFormat = new DecimalFormat(pattern); //
JSONObject jsonObject = JSONObject.parseObject(msg);
List<ArdSyCarLock> lockList = new ArrayList<>();
ArdSyCarLock ardSyCarLock1 = new ArdSyCarLock();
ardSyCarLock1.setRelay("A01");
- ardSyCarLock1.setRelayInfo(String.valueOf(jsonObject.getInteger("A01")));
+// ardSyCarLock1.setRelayInfo(String.valueOf(jsonObject.getInteger("A01")));
+ ardSyCarLock1.setRelayInfo(jsonObject.getInteger("A01"));
ardSyCarLock1.setCurrents("C01");
- ardSyCarLock1.setCurrentInfo(decimalFormat.format(jsonObject.getDouble("C01")));
+// ardSyCarLock1.setCurrentInfo(decimalFormat.format(jsonObject.getDouble("C01")));
+ ardSyCarLock1.setCurrentInfo(jsonObject.getDouble("C01"));
lockList.add(ardSyCarLock1);
ArdSyCarLock ardSyCarLock2 = new ArdSyCarLock();
ardSyCarLock2.setRelay("A02");
- ardSyCarLock2.setRelayInfo(String.valueOf(jsonObject.getInteger("A02")));
+ ardSyCarLock2.setRelayInfo(jsonObject.getInteger("A02"));
ardSyCarLock2.setCurrents("C02");
- ardSyCarLock2.setCurrentInfo(decimalFormat.format(jsonObject.getDouble("C02")));
+ ardSyCarLock2.setCurrentInfo(jsonObject.getDouble("C02"));
lockList.add(ardSyCarLock2);
return lockList;
}
@@ -255,7 +257,7 @@
for (int j = 0; j < ardSyCarLocks.size(); j++) {
ArdSyCarLock ardSyCarLock = ardSyCarLocks.get(j);
String currents = ardSyCarLock.getCurrents();
- String currentInfo = ardSyCarLock.getCurrentInfo();
+ Double currentInfo = ardSyCarLock.getCurrentInfo();
//鐢垫祦鍊间负4.0鏄叧閿佺姸鎬�
if(currentInfo.equals(4.00)){
lockCloseNum += 1;
@@ -276,7 +278,7 @@
}
while(true){
ArdSyCarLock ardSyCarLock1 = getCurrentInfo(ardSyCarRtu.getId(),currents);
- String currentInfo1 = ardSyCarLock1.getCurrentInfo();
+ Double currentInfo1 = ardSyCarLock1.getCurrentInfo();
if(currentInfo1.equals(4.00)){
lockCloseNum +=1;
break;
@@ -305,12 +307,12 @@
queryWrapper.eq("car_id",lockTypeParam.getCarId());
ArdSyCarRtu ardSyCarRtu = rtuMapper.selectOne(queryWrapper);
ArdSyCarLock ardSyCarLock = lockMapper.selectById(lockTypeParam.getLockId());
- String relay = ardSyCarLock.getRelayInfo();
+ Integer relay = ardSyCarLock.getRelayInfo();
if(relay.equals("1")){
AjaxResult.error(0,"璇ラ攣澶勪簬瑙e皝鐘舵��,杩滅▼鏃犳硶鎿嶆帶,璇峰厛鎵ц鏂藉皝鎿嶄綔!");
}
String key = "";
- String currentInfo = ardSyCarLock.getCurrentInfo();
+ Double currentInfo = ardSyCarLock.getCurrentInfo();
if(currentInfo.equals("C01")){
key = "D03";
}else if(currentInfo.equals("C02")){
diff --git a/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttOnceCallback.java b/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttOnceCallback.java
index e469e7f..98675bc 100644
--- a/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttOnceCallback.java
+++ b/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttOnceCallback.java
@@ -87,15 +87,15 @@
for (int i = 0; i < ardSyCarLocks.size(); i++) {
ArdSyCarLock ardSyCarLockData = ardSyCarLocks.get(i);
String relay = ardSyCarLockData.getRelay();
- String relayInfo = ardSyCarLockData.getRelayInfo();
+ Integer relayInfo = ardSyCarLockData.getRelayInfo();
String current = ardSyCarLockData.getCurrents();
- String currentInfo = ardSyCarLockData.getCurrentInfo();
+ Double currentInfo = ardSyCarLockData.getCurrentInfo();
for (int j = 0; j < ardSyCarLockList.size(); j++) {
ArdSyCarLock lock = ardSyCarLockList.get(j);
String relay1 = lock.getRelay();
String current1 = lock.getCurrents();
- String relayInfo1 = lock.getRelayInfo();
- String currentInfo1 = lock.getCurrentInfo();
+ Integer relayInfo1 = lock.getRelayInfo();
+ Double currentInfo1 = lock.getCurrentInfo();
Boolean upd = false;
if(relay.equals(relay1)){
if(!relayInfo.equals(relayInfo1)){
--
Gitblit v1.9.3