Commit 96edab64 by 罗志长

fix: 设备状态

parent e62fb0ce
...@@ -1320,9 +1320,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -1320,9 +1320,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if (!isSuccess) { if (!isSuccess) {
return; return;
} }
RedisUtil.set(key, faultState);
this.update(new UpdateWrapper<PlatDevice>().lambda() this.update(new UpdateWrapper<PlatDevice>().lambda()
.set(PlatDevice::getStatus, "abnormal").eq(PlatDevice::getOriDeviceId, deviceId)); .set(PlatDevice::getStatus, "abnormal").eq(PlatDevice::getOriDeviceId, deviceId));
RedisUtil.set(key, faultState);
log.info("设备:{} 故障处理, 设置故障", deviceId); log.info("设备:{} 故障处理, 设置故障", deviceId);
} }
} else { } else {
...@@ -1331,9 +1331,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -1331,9 +1331,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if (!isSuccess) { if (!isSuccess) {
return; return;
} }
RedisUtil.delete(key);
this.update(new UpdateWrapper<PlatDevice>().lambda() this.update(new UpdateWrapper<PlatDevice>().lambda()
.set(PlatDevice::getStatus, "online").eq(PlatDevice::getOriDeviceId, deviceId)); .set(PlatDevice::getStatus, "online").eq(PlatDevice::getOriDeviceId, deviceId));
RedisUtil.delete(key);
log.info("设备:{} 故障处理, 恢复正常", deviceId); log.info("设备:{} 故障处理, 恢复正常", deviceId);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment