Commit ca390aa1 by 黄小葱

修改bug,增加打印日志

1 parent 49c84434
...@@ -57,7 +57,7 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> { ...@@ -57,7 +57,7 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> {
* @param sn * @param sn
* @return * @return
*/ */
Vehicle findVehicleInfoBySn(@Param("sn") String sn); List<Vehicle> findVehicleInfoBySn(@Param("sn") String sn);
/** /**
* 车辆监控树-搜索车辆设备信息 * 车辆监控树-搜索车辆设备信息
......
...@@ -185,17 +185,21 @@ public class VehicleMonitorSevice { ...@@ -185,17 +185,21 @@ public class VehicleMonitorSevice {
*/ */
public List<VehicleLocationBo> getVehicleLocation(String sns, String deviceCode) { public List<VehicleLocationBo> getVehicleLocation(String sns, String deviceCode) {
List<VehicleLocationBo> retVehilceBoList = new ArrayList<>(); List<VehicleLocationBo> retVehilceBoList = new ArrayList<>();
long begin = System.currentTimeMillis();
List<DeviceLocationBo> deviceLocationBos = monitorApiService.listDeviceMonitorInfo(sns, deviceCode); List<DeviceLocationBo> deviceLocationBos = monitorApiService.listDeviceMonitorInfo(sns, deviceCode);
log.info("use time:" + (System.currentTimeMillis() - begin));
if (deviceLocationBos == null) { if (deviceLocationBos == null) {
return retVehilceBoList; return retVehilceBoList;
} }
log.info("查找到设备定位的数据个数:" + deviceLocationBos.size());
//整合查询车辆数据 //整合查询车辆数据
for (DeviceLocationBo deviceBo : deviceLocationBos) { for (DeviceLocationBo deviceBo : deviceLocationBos) {
VehicleLocationBo vehicleBo = new VehicleLocationBo(); VehicleLocationBo vehicleBo = new VehicleLocationBo();
BeanUtils.copyProperties(deviceBo, vehicleBo); BeanUtils.copyProperties(deviceBo, vehicleBo);
String sn = deviceBo.getSn(); String sn = deviceBo.getSn();
Vehicle vehicle = vehicleMapper.findVehicleInfoBySn(sn); List<Vehicle> vehicleList = vehicleMapper.findVehicleInfoBySn(sn);
if (vehicle != null) { if (CollectionUtils.isNotEmpty(vehicleList) && vehicleList.size() == 1) {
Vehicle vehicle = vehicleList.get(0);
vehicleBo.setVin(vehicle.getVin()); vehicleBo.setVin(vehicle.getVin());
vehicleBo.setOwnerName(vehicle.getOwnerName()); vehicleBo.setOwnerName(vehicle.getOwnerName());
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!