From e9582af916d019c4695b0aaf9665039be1bd6ea1 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期日, 14 一月 2024 14:43:50 +0800
Subject: [PATCH] 开关锁
---
ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarLockServiceImpl.java | 14 ++++++++------
ard-work/src/main/java/com/ruoyi/utils/qymqtt/AutoMqtt.java | 2 +-
ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java | 2 +-
3 files changed, 10 insertions(+), 8 deletions(-)
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 c3486d2..c01a4fe 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
@@ -80,7 +80,7 @@
/*String carName = MapUtil.getStrVal(gpsMap, "carName","");//鑾峰彇杞︾墝鍙�
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(sdf.format(new Date()));*/
- log.debug(String.format(" ---->鏀跺埌瀹氫綅鏁版嵁:%s",JSON.toJSONString(gpsMap)));
+ log.debug(String.format(" ---->----鏀跺埌瀹氫綅鏁版嵁濡備笅:%s",JSON.toJSONString(gpsMap)));
String carId = (String)gpsMap.get("carId");
((ArdSyCarDayServiceImpl)SpringUtils.getBean("ardSyCarDayServiceImpl")).insertArdSyCarDay(carId);//鏂板杞﹁締涓婃姤鏃堕棿
Map<String,Object> result = ((ArdSyCarServiceImpl)SpringUtils.getBean("ardSyCarServiceImpl")).getArdSyCarAndDeptByCarId(carId);//鏌ヨ杞﹁締鍙婇儴闂�
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 66331fa..190dc44 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
@@ -375,15 +375,17 @@
// MqttCustomerClient mqttCustomerClient = new MqttCustomerClient();
// mqttCustomerClient.connect(lockTypeParam.getCarId()+"change"+UUID.randomUUID());
// mqttCustomerClient.pushlish(ardSyCarRtu.getTopicPublish(),mapString);
- try {
- while(true){
- TimeUnit.SECONDS.sleep(5);
+ int min = lockTypeParam.getNum() -5; int max = lockTypeParam.getNum() +5;
+ while(true){
+ ArdSyCarLock ardSyCarLockLoop = lockMapper.selectById(lockTypeParam.getLockId());
+ Double currentInfo = ardSyCarLockLoop.getCurrentInfo();
+ int d = (int) ((int)(currentInfo*150/138.3 - 4)/0.16);
+ if(d >= min && d <= max){
break;
}
- } catch (InterruptedException e) {
- e.printStackTrace();
+// TimeUnit.SECONDS.sleep(5);
}
- return AjaxResult.success("寮�鍏抽攣鍛戒护鍙戦�佹垚鍔�,鍙戦�佽繘搴︿负"+lockTypeParam.getNum());
+ return AjaxResult.success("寮�鍏抽攣鎴愬姛,杩涘害涓�"+lockTypeParam.getNum());
}
@Override
diff --git a/ard-work/src/main/java/com/ruoyi/utils/qymqtt/AutoMqtt.java b/ard-work/src/main/java/com/ruoyi/utils/qymqtt/AutoMqtt.java
index ab3a4f8..a945fb0 100644
--- a/ard-work/src/main/java/com/ruoyi/utils/qymqtt/AutoMqtt.java
+++ b/ard-work/src/main/java/com/ruoyi/utils/qymqtt/AutoMqtt.java
@@ -36,7 +36,7 @@
EmqClient emqClient = new EmqClient(carId+"mqttSubscribe"+UUID.randomUUID());
emqClient.connect();
emqClient.subscribe(subscribe, QosEnum.QoS2);
- log.info("璁㈤槄涓婚锛�"+subscribe);
+ log.debug("璁㈤槄涓婚锛�"+subscribe);
}catch (Exception e) {
e.printStackTrace();
}
--
Gitblit v1.9.3