Commit abdc2f8d by 杨林龙

添加异常日志

1 parent 4bce0607
......@@ -34,15 +34,20 @@ public class DeviceLocationService {
*/
public void saveOrUpdateDeviceLocationData(Collection<DeviceLocationDto> deviceLocationDtoList) {
for (DeviceLocationDto deviceLocationDto : deviceLocationDtoList) {
DeviceLocation locationBySn = deviceLocationMapper.getDeviceLocationBySn(deviceLocationDto.getSn());
if (ObjectUtil.isNull(locationBySn)) {
DeviceLocation deviceLocation = new DeviceLocation();
BeanUtils.copyProperties(deviceLocationDto, deviceLocation);
deviceLocation.setCreatedTime(new Date());
deviceLocationMapper.insertSelective(deviceLocation);
} else {
mergeData(locationBySn, deviceLocationDto);
deviceLocationMapper.updateByPrimaryKeySelective(locationBySn);
try {
DeviceLocation locationBySn = deviceLocationMapper.getDeviceLocationBySn(deviceLocationDto.getSn());
if (ObjectUtil.isNull(locationBySn)) {
DeviceLocation deviceLocation = new DeviceLocation();
BeanUtils.copyProperties(deviceLocationDto, deviceLocation);
deviceLocation.setCreatedTime(new Date());
deviceLocationMapper.insertSelective(deviceLocation);
} else {
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!