设备状态判断bug
This commit is contained in:
+1
-1
@@ -51,7 +51,7 @@ public class StCanteenEquipmentServiceImpl extends ServiceImpl<StCanteenEquipmen
|
||||
//对比设备心跳时间与当前时间, 如果时间差小于2分钟 , 视为在线
|
||||
long deviceTime = Long.parseLong((String) o);
|
||||
long now = new Date().getTime();
|
||||
if(now - deviceTime > oneMinuteMs){
|
||||
if(now - deviceTime < oneMinuteMs){
|
||||
equipment.setStatus("在线");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user