Commit d599a6e9 by 刘宇峰

修复obd设备类型错误bug

1 parent 570d4f8e
......@@ -105,13 +105,21 @@ public class MonitorServiceImpl implements MonitorService {
String startTime = trackRequest.getStartTime();
String endTime = trackRequest.getEndTime();
Device device = deviceService.getBySn(sn);
DeviceTypeRelationEnum dtre = DeviceTypeRelationEnum.findByDeviceCode("gps");
if (device != null) {
//查询数据库设备类型,
dtre = DeviceTypeRelationEnum.findByBizDeviceType(device.getDeviceType());
}
Integer locationType = trackRequest.getLocationType();
List<GpsLocation> gpsBsData = null;
// 0:gps; 1:基站
if (locationType == 0) {
gpsBsData = gpsBsLocationService.getLastGpsBsHistoryBySn(sn, DeviceTypeRelationEnum.findByDeviceCode("gps"), startTime, endTime);
gpsBsData = gpsBsLocationService.getLastGpsBsHistoryBySn(sn, dtre, startTime, endTime);
} else {
gpsBsData = gpsBsLocationService.getBaseStationPoint(sn, DeviceTypeRelationEnum.findByDeviceCode("gps"), startTime, endTime);
gpsBsData = gpsBsLocationService.getBaseStationPoint(sn, dtre, startTime, endTime);
}
if (CollectionUtils.isEmpty(gpsBsData)) {
return resList;
......@@ -147,7 +155,7 @@ public class MonitorServiceImpl implements MonitorService {
String startTime = trackRequest.getStartTime();
String endTime = trackRequest.getEndTime();
StayPointRecord[] recordArr = mileComponent.listStayPointQuery(sn, DateUtils.parse(startTime), DateUtils.parse(endTime));
for (StayPointRecord record: recordArr) {
for (StayPointRecord record : recordArr) {
retList.add(handleStayPointRecord(sn, record));
}
return retList;
......@@ -188,6 +196,7 @@ public class MonitorServiceImpl implements MonitorService {
/**
* 设备离线状态
*
* @param deviceLocationBo
* @param offlineTime
* @return
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!