瀏覽代碼

功能完善

hlf 6 月之前
父節點
當前提交
ce82ce785b

+ 7 - 5
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationRuleServiceImpl.java

@@ -432,7 +432,8 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
 				int startRows = 1;
 				//获取输入流
 				InputStream is = file.getInputStream();
-				List<OrganizationEvaluationRule> organizationEvaluationRuleList = new ArrayList<>();
+				List<OrganizationEvaluationRule> organizationEvaluationRuleListUp = new ArrayList<>();
+				List<OrganizationEvaluationRule> organizationEvaluationRuleListSa = new ArrayList<>();
 				//Excel导入导出的单元类
 				List<String[]> strings = ExcelUtil.readData(fileType, startRows, true, is);
 				//遍历Excel表每一行的数据
@@ -457,7 +458,7 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
 						organizationEvaluationRule.setScjyWeight(Double.parseDouble(str[6]));
 						organizationEvaluationRule.setQqWeight(Double.parseDouble(str[7]));
 						organizationEvaluationRule.setJjWeight(Double.parseDouble(str[8]));
-						organizationEvaluationRuleList.add(organizationEvaluationRule);
+						organizationEvaluationRuleListUp.add(organizationEvaluationRule);
 					} else {
 						List<OrganizationStructure> organizationStructureList = organizationStructureService.getList2("", null, "");
 						OrganizationStructure organizationStructure = organizationStructureList.stream().filter(item -> item.getId().equals(str[0])).findFirst().orElse(null);
@@ -482,11 +483,12 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
 						organizationEvaluationRule.setQqWeight(Double.parseDouble(str[6]));
 						organizationEvaluationRule.setJjWeight(Double.parseDouble(str[7]));
 						organizationEvaluationRule.setYear(str[4]);
-						organizationEvaluationRuleList.add(organizationEvaluationRule);
+						organizationEvaluationRuleListSa.add(organizationEvaluationRule);
 					}
 				}
-				boolean b = super.saveOrUpdateBatch(organizationEvaluationRuleList);
-				if (b) {
+				boolean a = super.updateBatchById(organizationEvaluationRuleListUp);
+				boolean b = super.saveBatch(organizationEvaluationRuleListSa);
+				if (a && b) {
 					return R.ok().data(b);
 				} else {
 					return R.error("导入失败!");