debug,设备刷新

This commit is contained in:
磷叶 2025-05-13 11:57:03 +08:00
parent b9cfc3ef88
commit b1059f807f
2 changed files with 17 additions and 5 deletions

View File

@ -15,6 +15,7 @@ import com.ruoyi.bst.area.service.AreaService;
import com.ruoyi.bst.area.utils.AreaUtil;
import com.ruoyi.bst.areaSub.domain.AreaSubVO;
import com.ruoyi.bst.areaSub.service.AreaSubService;
import com.ruoyi.bst.device.domain.Device;
import com.ruoyi.bst.device.domain.DeviceVO;
import com.ruoyi.bst.device.domain.enums.DeviceLockStatus;
import com.ruoyi.bst.device.domain.enums.DeviceQuality;
@ -76,6 +77,7 @@ public class IotReceiveServiceImpl implements IotReceiveService {
}
// 数据点推送
if (ReceiveType.DATA_POINT.getType().equals(msg.getType())) {
// 设备数据
if (IotConstants.DS_SYS.equals(msg.getDsId())) {
// 查询设备信息
DeviceVO device = deviceService.selectSimpleByMacForLocationLog(msg.getDevName());
@ -118,6 +120,16 @@ public class IotReceiveServiceImpl implements IotReceiveService {
// 处理定位日志
this.handleLocationLog(device);
}
// 软件版本
else if (IotConstants.DS_VER.equals(msg.getDsId())) {
Device data = new Device();
data.setVersion(msg.getValue().toString());
data.setMac(msg.getDevName());
int update = deviceIotService.updateIot(data);
if (update != 1) {
log.error("更新设备软件版本失败: {},版本:{}", msg.getDevName(), msg.getValue());
}
}
}
// 生命周期暂时不做需要测试
else if (ReceiveType.DEVICE_STATUS.getType().equals(msg.getType())) {

View File

@ -18,11 +18,11 @@
<dependencies>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-devtools</artifactId>-->
<!-- <optional>true</optional> &lt;!&ndash; 表示依赖不会传递 &ndash;&gt;-->
<!-- </dependency>-->
<!-- Mysql驱动包 -->
<dependency>