Commit ca390aa1 by 黄小葱

修改bug,增加打印日志

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