From 293c3e580b68a67a53b6c16ee86bec4cdaeb5282 Mon Sep 17 00:00:00 2001 From: 18650502300 <18650502300@163.com> Date: Sat, 3 Aug 2024 17:33:37 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E5=85=B3=E9=97=AD=E6=97=A0=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=85=B3=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/receive/ReceiveController.java | 18 ++++++------------ .../java/com/ruoyi/system/domain/AsDevice.java | 3 +++ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/iot/receive/ReceiveController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/iot/receive/ReceiveController.java index 460e38f..ea28ff9 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/iot/receive/ReceiveController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/iot/receive/ReceiveController.java @@ -79,8 +79,6 @@ public class ReceiveController { private final Object lock = new Object(); - private boolean lockCommandSent = false; // 添加标志变量 - /** * 功能描述:第三方平台数据接收。

@@ -299,17 +297,13 @@ public class ReceiveController { // 优化轨迹,如果获取到的定位与最后一个定位相同,则不添加 optimizeRoute(jsonArray, newPoint,lon,lat,etOrder); - // 重置关锁命令发送标志 - lockCommandSent = false; }else{ - //当前无订单,并且不是管理员开锁的情况下,直接关锁 - if(!isAdminUnlocking.equals("1")){ - if (!lockCommandSent) { // 如果未发送过关锁命令 - log.info("当前无订单,并且不是管理员开锁的情况下,直接关锁--------" + logEntry.getDevName()); - asDeviceService.sendCommand(asDevice.getMac(), Token.getToken(), IotConstants.COMMAND_CLOSE + IotConstants.COMMAND_FREQUENCY_3600, "无订单关锁", null, null, msg); - lockCommandSent = true; // 设置标志为已发送 - } - } +// String isLocked = device.getIsLocked(); +// //当前无订单,并且不是管理员开锁的情况下,直接关锁 +// if(!isAdminUnlocking.equals("1") && !isLocked.equals("0") && !device.getStatus()){ +// log.info("当前无订单,并且不是管理员开锁的情况下,直接关锁--------" + logEntry.getDevName()); +// asDeviceService.sendCommand(asDevice.getMac(), Token.getToken(), IotConstants.COMMAND_CLOSE + IotConstants.COMMAND_FREQUENCY_3600, "无订单关锁", null, null, msg); +// } } } } diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/AsDevice.java b/electripper-system/src/main/java/com/ruoyi/system/domain/AsDevice.java index 7b7ea44..dedced1 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/domain/AsDevice.java +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/AsDevice.java @@ -180,6 +180,9 @@ public class AsDevice extends BaseEntityPlus implements Serializable { /** 是否是管理员开锁:0-否;1-是(用于控制运营区外是否断电判断) */ private String isAdminUnlocking; +// /** 是否已经发送过无订单关锁命令:0-否;1-是 */ +// private String isLocked; + /** 正在进行中的订单 */ @TableField(exist = false) private List etOrders;