songwb 10 месяцев назад
Родитель
Сommit
01985e8be5

+ 3 - 2
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationServiceImpl.java

@@ -326,7 +326,8 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
 			//查询对应年度的目标责任书
 			List<DeptResponsibility> responsibilities = deptResponsibilityService.list("", organizationEvaluation.getCheckCycle(), organizationEvaluation.getYear(), "");
 			if (null == responsibilities || responsibilities.size() <= 0) {
-				throw new CustomException("该年度的目标责任书不存在");
+//				throw new CustomException();
+				return R.error("该年度的目标责任书不存在");
 			}
 			DeptResponsibility deptResponsibility = responsibilities.get(0);
 //
@@ -507,7 +508,7 @@ public class OrganizationEvaluationServiceImpl extends ServiceImpl<OrganizationE
 			//查询当前周期下对应的考评权重(需要考评的单位)
 			List<OrganizationEvaluationRule> evaluationRules = organizationEvaluationRuleService.getOrganizationEvaluationRuleByYearAndCycle(organizationType, checkCycle, year, "");
 			if (evaluationRules == null || evaluationRules.isEmpty()) {
-				throw new CustomException("单位权重未配置");
+				return R.error("单位权重未配置");
 			}
 
 			//判断组织id 是否有值;不为空只生成当前组织的数据

+ 3 - 5
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationRatingServiceImpl.java

@@ -64,7 +64,7 @@ public class OrganizationRatingServiceImpl extends ServiceImpl<OrganizationRatin
 	 * @return
 	 */
 	@Override
-	public R importExcel(MultipartFile file) {
+	public R importExcel(MultipartFile file,String binSection) {
 		if (file.isEmpty()) {
 			return R.error("上传文件为空!");
 		}
@@ -83,14 +83,12 @@ public class OrganizationRatingServiceImpl extends ServiceImpl<OrganizationRatin
 			List<String> ids = strings.stream().map(row -> row[row.length - 1]).collect(Collectors.toList());
 			List<OrganizationRating> organizationRatings = baseMapper.selectBatchIds(ids);
 			if (!binSection.equals(organizationRatings.get(0).getBinSection())) {
-				throw new CustomException("请导入" + binSection + "的数据");
+				return R.error("请导入" + binSection + "的数据");
 			}
 			//遍历Excel表每一行的数据
 			for (String[] str : strings) {
 				for (OrganizationRating or : organizationRatings) {
-					if (str[0].equals(or.getOrganizationShortName())&&str[3].equals(or.getYear())) {
-//					if (str[15].equals(or.getId())) {
-//						or.setOrganizationShortName(str[0]);
+					if (str[0].equals(or.getOrganizationShortName())&&str[2].equals(or.getYear())) {
 						or.setSafetyEnvProtection(str[3]);
 						or.setVeto(str[4]);
 						or.setNetProfit(str[5]);