|
@@ -495,7 +495,7 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
device.setEnable(1);
|
|
device.setEnable(1);
|
|
device.setCreator(user.getUserName());
|
|
device.setCreator(user.getUserName());
|
|
device.setInstallTime(new Date());
|
|
device.setInstallTime(new Date());
|
|
-// try{
|
|
|
|
|
|
+ try{
|
|
this.save(device);
|
|
this.save(device);
|
|
String deviceCode = device.getDeviceCode();
|
|
String deviceCode = device.getDeviceCode();
|
|
Integer siteId = device.getSiteId();
|
|
Integer siteId = device.getSiteId();
|
|
@@ -504,17 +504,16 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
deviceStatus.setStatusTime(new Date());
|
|
deviceStatus.setStatusTime(new Date());
|
|
deviceStatus.setSiteId(siteId);
|
|
deviceStatus.setSiteId(siteId);
|
|
deviceStatusService.save(deviceStatus);
|
|
deviceStatusService.save(deviceStatus);
|
|
-// }catch (Exception e){
|
|
|
|
-// err="文件导入失败,第"+rot+"行数据导入失败";
|
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ err="文件导入失败,第"+rot+1+"行数据导入失败";
|
|
|
|
+ throw new BusinessException("文件导入失败,第"+rot+"行数据导入失败");
|
|
|
|
|
|
-// }
|
|
|
|
- err="文件导入失败,第"+rot+1+"行数据导入失败";
|
|
|
|
|
|
+ }
|
|
rot++;
|
|
rot++;
|
|
-// throw new BusinessException("文件导入失败,第"+rot+"行数据导入失败");
|
|
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
err="文件不能为空";
|
|
err="文件不能为空";
|
|
-// throw new BusinessException("文件不能为空");
|
|
|
|
|
|
+ throw new BusinessException("文件不能为空");
|
|
}
|
|
}
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|