|
@@ -173,7 +173,7 @@ public class TBaseDeviceController extends BaseController
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
int rowNum = sheet.getPhysicalNumberOfRows();
|
|
|
int failNumber = 0;
|
|
|
- for (int i = 1; i < rowNum; i++) {
|
|
|
+ aa:for (int i = 1; i < rowNum; i++) {
|
|
|
try {
|
|
|
logger.info("读取行数:" + i);
|
|
|
Row row = sheet.getRow(i);
|
|
@@ -190,13 +190,23 @@ public class TBaseDeviceController extends BaseController
|
|
|
if (j == 0) {
|
|
|
//装置名称
|
|
|
TBasePlant tBasePlant = tBasePlantService.selectTBasePlantByName(cellValue);
|
|
|
- if (tBasePlant == null) {return AjaxResult.success("未找到对应装置!请检查装置名称无误后重新提交!",0);}
|
|
|
+ if (tBasePlant == null) {
|
|
|
+ failNumber++;
|
|
|
+ logger.info("未找到装置");
|
|
|
+ failRow.add(i + 1);
|
|
|
+ continue aa;
|
|
|
+ }
|
|
|
plantId = tBasePlant.getPlantId();
|
|
|
entity.setPlantId(plantId);
|
|
|
} else if (j == 1) {
|
|
|
// 区域名称
|
|
|
TBaseRegion tBaseRegion = tBaseRegionService.selectTBaseRegionByName(cellValue, plantId);
|
|
|
- if (tBaseRegion == null) {return AjaxResult.success("未找到对应区域!请检查装置名称与区域名称无误后重新提交!",0);}
|
|
|
+ if (tBaseRegion == null) {
|
|
|
+ failNumber++;
|
|
|
+ logger.info("未找到区域");
|
|
|
+ failRow.add(i + 1);
|
|
|
+ continue aa;
|
|
|
+ }
|
|
|
entity.setRegionId(tBaseRegion.getRegionId());
|
|
|
} else if (j == 2) {
|
|
|
// 设备描述
|