Browse Source

功能完善

hlf 5 months ago
parent
commit
c3ec2a3075

+ 6 - 5
ims-service/ims-eval/src/main/java/com/ims/eval/controller/CalculatorController.java

@@ -28,12 +28,13 @@ public class CalculatorController {
 	private IOrganizationEvaluationInfoService organizationEvaluationInfoService;
 
 	@GetMapping("/cron")
-	public R test(@RequestParam("id") String id){
-		boolean b = organizationEvaluationInfoService.calculationByEvaluationId("","",id,"");
-//		boolean b = scoreCalculationSchedule.doTask(id);
-		if (b){
+	public R test(@RequestParam(value = "id", required = false) String id,
+				  @RequestParam(value = "indicatorId", required = false) String indicatorId) {
+		boolean b = organizationEvaluationInfoService.calculationByEvaluationId("", indicatorId, id, "");
+		//boolean b = scoreCalculationSchedule.doTask(id);
+		if (b) {
 			return R.ok().data(b);
-		}else {
+		} else {
 			return R.error().data("计算失败!");
 		}
 	}

+ 1 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/controller/EvaluateRuleController.java

@@ -124,7 +124,7 @@ public class EvaluateRuleController {
 	}
 
 	/**
-	 * 导出
+	 * 导出-考评规则配置
 	 */
 	@GetMapping(value = "/exportExcel", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
 	public void exportExcel(@RequestParam(value = "binSection", required = false) String binSection,

+ 1 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/controller/MultipleBrandController.java

@@ -125,7 +125,7 @@ public class MultipleBrandController {
 	}
 
 	/**
-	 * 导出
+	 * 导出-单位营业收入
 	 */
 	@GetMapping(value = "/exportExcel", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
 	public void exportExcel(@RequestParam(value = "binSection", required = false) String binSection,

+ 1 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/controller/OrganizationEvaluationRuleController.java

@@ -172,7 +172,7 @@ public class OrganizationEvaluationRuleController {
 	}
 
 	/**
-	 * 导出
+	 * 导出-单位权重配置
 	 */
 	@GetMapping(value = "/exportExcel", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
 	public void exportExcel(@RequestParam(value = "organizationName", required = false) String organizationName,

+ 17 - 14
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationRuleServiceImpl.java

@@ -320,7 +320,7 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
 
 		// 创建表头
 		Row headerRow = sheet.createRow(0);
-		List<String> headers = Arrays.asList("单位名称", "考评周期", "考评规则", "是否考评", "考评年份", "生产经营权重", "前期权重", "基建权重");
+		List<String> headers = Arrays.asList("单位编码", "单位名称", "考评周期", "考评规则", "是否考评", "考评年份", "生产经营权重", "前期权重", "基建权重");
 		for (int i = 0; i < headers.size(); i++) {
 			Cell cell = headerRow.createCell(i);
 			cell.setCellValue(headers.get(i));
@@ -345,7 +345,8 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
 			Row row = sheet.createRow(rowIndex++);
 
 			// 设置其数据
-			row.createCell(0).setCellValue(organizationEvaluationRule.getOrganizationShortName());
+			row.createCell(0).setCellValue(organizationEvaluationRule.getOrganizationId());
+			row.createCell(1).setCellValue(organizationEvaluationRule.getOrganizationShortName());
 			if (null != organizationEvaluationRule.getEvaluationCycle()) {
 				if ("NDKP".equals(organizationEvaluationRule.getEvaluationCycle())) {
 					evaluationCycle = "年度考评";
@@ -354,9 +355,9 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
 				} else if ("YDKP".equals(organizationEvaluationRule.getEvaluationCycle())) {
 					evaluationCycle = "月度考评";
 				}
-				row.createCell(1).setCellValue(evaluationCycle);
+				row.createCell(2).setCellValue(evaluationCycle);
 			}
-			row.createCell(2).setCellValue(organizationEvaluationRule.getEvaluateRuleName());
+			row.createCell(3).setCellValue(organizationEvaluationRule.getEvaluateRuleName());
 			if (null != organizationEvaluationRule.getIsCheck()) {
 				String isCheck;
 				if (organizationEvaluationRule.getIsCheck()) {
@@ -364,12 +365,12 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
 				} else {
 					isCheck = "否";
 				}
-				row.createCell(3).setCellValue(isCheck);
+				row.createCell(4).setCellValue(isCheck);
 			}
-			row.createCell(4).setCellValue(organizationEvaluationRule.getYear());
-			row.createCell(5).setCellValue(organizationEvaluationRule.getScjyWeight());
-			row.createCell(6).setCellValue(organizationEvaluationRule.getQqWeight());
-			row.createCell(7).setCellValue(organizationEvaluationRule.getJjWeight());
+			row.createCell(5).setCellValue(organizationEvaluationRule.getYear());
+			row.createCell(6).setCellValue(organizationEvaluationRule.getScjyWeight());
+			row.createCell(7).setCellValue(organizationEvaluationRule.getQqWeight());
+			row.createCell(8).setCellValue(organizationEvaluationRule.getJjWeight());
 		}
 
 		// 自动调整列宽
@@ -402,7 +403,7 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
 
 		// 创建表头
 		Row headerRow = sheet.createRow(0);
-		List<String> headers = Arrays.asList("单位名称", "考评周期", "考评规则", "是否考评", "考评年份", "生产经营权重", "前期权重", "基建权重");
+		List<String> headers = Arrays.asList("单位编码", "单位名称", "考评周期", "考评规则", "是否考评", "考评年份", "生产经营权重", "前期权重", "基建权重");
 		for (int i = 0; i < headers.size(); i++) {
 			Cell cell = headerRow.createCell(i);
 			cell.setCellValue(headers.get(i));
@@ -444,9 +445,11 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
 					StringBuilder binStages = new StringBuilder();
 					for (String evaluateRuleName : evaluateRuleNames) {
 						EvaluateRule evaluateRule = evaluateRuleService.getEvaluateRuleByRuleName(evaluateRuleName, str[4]);
-						evaluateRuleIds.append(evaluateRule.getId());
-						binSections.append(evaluateRule.getBinSection());
-						binStages.append(evaluateRule.getBinStage());
+						if (null != evaluateRule) {
+							evaluateRuleIds.append(evaluateRule.getId());
+							binSections.append(evaluateRule.getBinSection());
+							binStages.append(evaluateRule.getBinStage());
+						}
 					}
 					OrganizationEvaluationRule obj = this.checkForExistence(str[0], toFullSpell(str[1]), binStages.toString(), binSections.toString(), str[4]);
 					if (null != obj) {
@@ -457,7 +460,7 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
 						organizationEvaluationRuleList.add(organizationEvaluationRule);
 					} else {
 						List<OrganizationStructure> organizationStructureList = organizationStructureService.getList2("", null, "");
-						OrganizationStructure organizationStructure = organizationStructureList.stream().filter(item -> item.getShortName().equals(str[0])).findFirst().orElse(null);
+						OrganizationStructure organizationStructure = organizationStructureList.stream().filter(item -> item.getId().equals(str[0])).findFirst().orElse(null);
 						if (null != organizationStructure) {
 							organizationEvaluationRule.setOrganizationName(organizationStructure.getName());
 							organizationEvaluationRule.setOrganizationId(organizationStructure.getId());