Commit abdc2f8d by 杨林龙

添加异常日志

1 parent 4bce0607
...@@ -34,15 +34,20 @@ public class DeviceLocationService { ...@@ -34,15 +34,20 @@ public class DeviceLocationService {
*/ */
public void saveOrUpdateDeviceLocationData(Collection<DeviceLocationDto> deviceLocationDtoList) { public void saveOrUpdateDeviceLocationData(Collection<DeviceLocationDto> deviceLocationDtoList) {
for (DeviceLocationDto deviceLocationDto : deviceLocationDtoList) { for (DeviceLocationDto deviceLocationDto : deviceLocationDtoList) {
DeviceLocation locationBySn = deviceLocationMapper.getDeviceLocationBySn(deviceLocationDto.getSn()); try {
if (ObjectUtil.isNull(locationBySn)) { DeviceLocation locationBySn = deviceLocationMapper.getDeviceLocationBySn(deviceLocationDto.getSn());
DeviceLocation deviceLocation = new DeviceLocation(); if (ObjectUtil.isNull(locationBySn)) {
BeanUtils.copyProperties(deviceLocationDto, deviceLocation); DeviceLocation deviceLocation = new DeviceLocation();
deviceLocation.setCreatedTime(new Date()); BeanUtils.copyProperties(deviceLocationDto, deviceLocation);
deviceLocationMapper.insertSelective(deviceLocation); deviceLocation.setCreatedTime(new Date());
} else { deviceLocationMapper.insertSelective(deviceLocation);
mergeData(locationBySn, deviceLocationDto); } else {
deviceLocationMapper.updateByPrimaryKeySelective(locationBySn); mergeData(locationBySn, deviceLocationDto);
deviceLocationMapper.updateByPrimaryKeySelective(locationBySn);
}
} catch (Exception e) {
log.error("设备号:" + deviceLocationDto.getSn() + "查询异常===" + e.getMessage());
e.printStackTrace();
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!