Commit fad5cb1b by 谢海旭

v1.76.0 车辆运行状态时长计算问题修复

1 parent be501126
...@@ -153,6 +153,8 @@ public class DeviceServiceImpl implements DeviceService { ...@@ -153,6 +153,8 @@ public class DeviceServiceImpl implements DeviceService {
} }
List<DeviceLocation> locationList = deviceLocationMapper.selectBySns(snsMap.keySet()); List<DeviceLocation> locationList = deviceLocationMapper.selectBySns(snsMap.keySet());
List<Device> devices = deviceMapper.selectBySns(snsMap.keySet());
Map<String, Device> snDeviceMap = devices.stream().collect(Collectors.toMap(Device::getSn, device -> device));
Map<String, DeviceLocation> loginDtoMap = locationList.stream().collect(Collectors.toMap(DeviceLocation::getSn, location -> location)); Map<String, DeviceLocation> loginDtoMap = locationList.stream().collect(Collectors.toMap(DeviceLocation::getSn, location -> location));
...@@ -161,6 +163,12 @@ public class DeviceServiceImpl implements DeviceService { ...@@ -161,6 +163,12 @@ public class DeviceServiceImpl implements DeviceService {
if (deviceLogin == null) { if (deviceLogin == null) {
return; return;
} }
Date stayStatusUpdatetime = deviceLogin.getStayStatusUpdatetime();
if (Objects.isNull(stayStatusUpdatetime)) {
deviceLogin.setStayStatusUpdatetime(snDeviceMap.get(sn).getActivateTime());
}
statusModels.add(DeviceUtils.parseDeviceStatus(deviceLogin, deviceType, offlineTime)); statusModels.add(DeviceUtils.parseDeviceStatus(deviceLogin, deviceType, offlineTime));
}); });
return statusModels; return statusModels;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!