Commit e1f25659 by 黄小葱

修改bug

1 parent f6ff7276
......@@ -78,12 +78,14 @@ public class DeviceUtils {
*/
public static void parseSourceStatus(DeviceStatusModel deviceStatus, Integer speed, long trackTime, long offlineTime) {
long now = System.currentTimeMillis();
if (now - trackTime > offlineTime) {
long onlineTime = 6 * 60 * 1000;
if (now - trackTime > onlineTime) {
//大于6分钟 有源在线
deviceStatus.setStatus(ConstantsDevice.DEVICE_STATUS_ONLINE);
deviceStatus.setStatusTime(DateUtils.formatTimeInSec((now - trackTime) / 1000));
return;
}
//否则 在6分钟内并且有速度 则为行驶中
if (speed != null && speed > 0) {
//行驶状态
deviceStatus.setStatus(ConstantsDevice.DEVICE_STATUS_DRIVING);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!