重启逻辑更新
This commit is contained in:
parent
4cd4a6ee4e
commit
655fb876c2
|
@ -152,8 +152,8 @@ public class IotReceiveServiceImpl implements IotReceiveService {
|
||||||
if (!isOpen) {
|
if (!isOpen) {
|
||||||
// 若当前数据点的上报时间和设备内上次上报的时间不一样,但是定位一样,则重启设备
|
// 若当前数据点的上报时间和设备内上次上报的时间不一样,但是定位一样,则重启设备
|
||||||
log.info("当前定位:{},{},上次定位:{},{}", sys.getLon(), sys.getLat(), device.getLongitude(), device.getLatitude());
|
log.info("当前定位:{},{},上次定位:{},{}", sys.getLon(), sys.getLat(), device.getLongitude(), device.getLatitude());
|
||||||
if (at.isAfter(device.getLastLocationTime()) && MathUtils.equals(device.getLongitude(), sys.getLon()) && MathUtils.equals(device.getLatitude(), sys.getLat())) {
|
if (at.isAfter(device.getLastLocationTime()) && MathUtils.equalsFixed(device.getLongitude(), sys.getLon(), 8) && MathUtils.equalsFixed(device.getLatitude(), sys.getLat(), 8)) {
|
||||||
String reason = String.format("设备不同时间的两次定位一样,重启设备。定位:%s,%s", sys.getLon(), sys.getLat());
|
String reason = String.format("设备不同时间的两次定位一样,重启设备。新定位:%s,%s,旧定位:%s,%s", sys.getLon(), sys.getLat(), device.getLongitude(), device.getLatitude());
|
||||||
deviceIotService.reboot(device, reason, true);
|
deviceIotService.reboot(device, reason, true);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user