diff --git a/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsEnterpriseStandardServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsEnterpriseStandardServiceImpl.java index 4391adb5..300309b1 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsEnterpriseStandardServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsEnterpriseStandardServiceImpl.java @@ -224,6 +224,7 @@ public class LawsEnterpriseStandardServiceImpl extends ServiceImpl errImportList = new ArrayList<>(); // 验证文件是否为压缩格式file.getContentType()).contains("xls") if (!Objects.requireNonNull(file.getOriginalFilename()).contains("xls")) { throw new JeroBootException("文件格式不正确,请上传Excel。"); @@ -248,7 +249,11 @@ public class LawsEnterpriseStandardServiceImpl extends ServiceImpl data.getStandardType().startsWith("企业标准")).collect(Collectors.toList()); + log.info("企标相关数据条数:{}", datalist.size()); // 获取当前时间戳(毫秒) long endTime = System.currentTimeMillis(); // 计算执行时间(毫秒) @@ -263,10 +268,16 @@ public class LawsEnterpriseStandardServiceImpl extends ServiceImpl updateList = new ArrayList<>(); for (ESAuthAll data : datalist) { - LawsEnterpriseStandard es = esMap.get(data.getStandardId()); - if (es != null) { - es.setGradeClassification("1"); - updateList.add(es); + try { + LawsEnterpriseStandard es = esMap.get(data.getStandardId()); + if (es != null) { + es.setGradeClassification("1"); + updateList.add(es); + } else { + throw new JeroBootException("未找到该企标,标准编号:" + data.getStandardNumber() + ",标准名称:" + data.getStandardName()); + } + } catch (Exception e) { + errImportList.add(data); } } // 批量更新 @@ -275,6 +286,11 @@ public class LawsEnterpriseStandardServiceImpl extends ServiceImpl