Sfoglia il codice sorgente

绩效结果考核申报问题修改;代码优化;

hlf 1 anno fa
parent
commit
1b24cb1a9f

+ 39 - 20
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DeptAssessmentDeclarationController.java

@@ -436,13 +436,13 @@ public class DeptAssessmentDeclarationController {
 	 * @param startTime  开始时间
 	 * @param endTime    结束时间
 	 * @param deptId     部门主键
-	 * @param employeeId 人员主键
+	 * @param employeeNo 人员编号
 	 */
 	@GetMapping(value = "/statisticalSummary")
 	public R statisticalSummary(@RequestParam(value = "startTime") String startTime,
 								@RequestParam(value = "endTime") String endTime,
 								@RequestParam(value = "deptId") String deptId,
-								@RequestParam(value = "employeeId") String employeeId) {
+								@RequestParam(value = "employeeNo") String employeeNo) {
 		List<SummaryInformationDTO> summaryInformationDTOList = new ArrayList<>();
 		String[] startTimeArr = new String[2];
 		String[] endTimeArr = new String[2];
@@ -469,12 +469,13 @@ public class DeptAssessmentDeclarationController {
 			EvaluationDept evaluationDept = evaluationDeptService.getOne(qwDept);
 			List<DeptAssessmentDeclarationContent> deptAssessmentDeclarationContentList = deptAssessmentDeclarationContentService.detailsList(deptAssessmentDeclaration.getId());
 			for (DeptAssessmentDeclarationContent deptAssessmentDeclarationContent : deptAssessmentDeclarationContentList) {
-				if (StringUtils.isNotEmpty(employeeId)) {
-					if (employeeId.equals(deptAssessmentDeclarationContent.getEmployeeId())) {
+				if (StringUtils.isNotEmpty(employeeNo)) {
+					if (employeeNo.equals(deptAssessmentDeclarationContent.getEmployeeNo())) {
 						SummaryInformationDTO summaryInformationDTO = new SummaryInformationDTO();
 						summaryInformationDTO.setEmployeeNo(deptAssessmentDeclarationContent.getEmployeeNo());
 						summaryInformationDTO.setEmployeeName(deptAssessmentDeclarationContent.getEmployeeName());
 						summaryInformationDTO.setSuggestedValue(deptAssessmentDeclarationContent.getSuggestedValue());
+						summaryInformationDTO.setDeclarationMonth(deptAssessmentDeclaration.getDeclarationMonth());
 						summaryInformationDTO.setReportingDepartment(deptAssessmentDeclaration.getDeptName());
 						summaryInformationDTO.setDeclarationLevel(deptAssessmentDeclaration.getRatingGrade());
 						if (null != evaluationDept) {
@@ -487,6 +488,7 @@ public class DeptAssessmentDeclarationController {
 					summaryInformationDTO.setEmployeeNo(deptAssessmentDeclarationContent.getEmployeeNo());
 					summaryInformationDTO.setEmployeeName(deptAssessmentDeclarationContent.getEmployeeName());
 					summaryInformationDTO.setSuggestedValue(deptAssessmentDeclarationContent.getSuggestedValue());
+					summaryInformationDTO.setDeclarationMonth(deptAssessmentDeclaration.getDeclarationMonth());
 					summaryInformationDTO.setReportingDepartment(deptAssessmentDeclaration.getDeptName());
 					summaryInformationDTO.setDeclarationLevel(deptAssessmentDeclaration.getRatingGrade());
 					if (null != evaluationDept) {
@@ -499,10 +501,13 @@ public class DeptAssessmentDeclarationController {
 		List<SummaryInformationDTO> list = new ArrayList<>();
 		Map<String, List<SummaryInformationDTO>> map = summaryInformationDTOList.stream().collect(Collectors.groupingBy(SummaryInformationDTO::getEmployeeNo));
 		map.forEach((key, value) -> {
-			for (SummaryInformationDTO summaryInformationDTO : value) {
-				summaryInformationDTO.setDeclarationsNumber(String.valueOf(value.size()));
-			}
-			list.addAll(value);
+			Map<Integer, List<SummaryInformationDTO>> map1 = value.stream().collect(Collectors.groupingBy(SummaryInformationDTO::getDeclarationMonth));
+			map1.forEach((key1, value1) -> {
+				for (SummaryInformationDTO summaryInformationDTO : value1) {
+					summaryInformationDTO.setDeclarationsNumber(String.valueOf(value1.size()));
+				}
+				list.addAll(value1);
+			});
 		});
 		list.sort(Comparator.comparing(SummaryInformationDTO::getSerialNumber, Comparator.nullsLast(Integer::compareTo)));
 		return R.ok().data(list);
@@ -514,7 +519,7 @@ public class DeptAssessmentDeclarationController {
 	 * @param startTime  开始时间
 	 * @param endTime    结束时间
 	 * @param deptId     部门主键
-	 * @param employeeId 人员主键
+	 * @param employeeNo 人员编号
 	 * @param response   response
 	 * @throws Exception 异常
 	 */
@@ -522,7 +527,7 @@ public class DeptAssessmentDeclarationController {
 	public void generateStatisticalSummaryReports(@RequestParam(value = "startTime") String startTime,
 												  @RequestParam(value = "endTime") String endTime,
 												  @RequestParam(value = "deptId") String deptId,
-												  @RequestParam(value = "employeeId") String employeeId,
+												  @RequestParam(value = "employeeNo") String employeeNo,
 												  HttpServletResponse response) throws Exception {
 		response.setContentType("application/vnd.ms-excel;charset=UTF-8");
 		response.setHeader("Content-disposition", "attachment; filename=".concat(URLEncoder.encode("绩效结果考核申报汇总表.xlsx", "UTF-8")));
@@ -555,12 +560,13 @@ public class DeptAssessmentDeclarationController {
 			EvaluationDept evaluationDept = evaluationDeptService.getOne(qwDept);
 			List<DeptAssessmentDeclarationContent> deptAssessmentDeclarationContentList = deptAssessmentDeclarationContentService.detailsList(deptAssessmentDeclaration.getId());
 			for (DeptAssessmentDeclarationContent deptAssessmentDeclarationContent : deptAssessmentDeclarationContentList) {
-				if (StringUtils.isNotEmpty(employeeId)) {
-					if (employeeId.equals(deptAssessmentDeclarationContent.getEmployeeId())) {
+				if (StringUtils.isNotEmpty(employeeNo)) {
+					if (employeeNo.equals(deptAssessmentDeclarationContent.getEmployeeNo())) {
 						SummaryInformationDTO summaryInformationDTO = new SummaryInformationDTO();
 						summaryInformationDTO.setEmployeeNo(deptAssessmentDeclarationContent.getEmployeeNo());
 						summaryInformationDTO.setEmployeeName(deptAssessmentDeclarationContent.getEmployeeName());
 						summaryInformationDTO.setSuggestedValue(deptAssessmentDeclarationContent.getSuggestedValue());
+						summaryInformationDTO.setDeclarationMonth(deptAssessmentDeclaration.getDeclarationMonth());
 						summaryInformationDTO.setReportingDepartment(deptAssessmentDeclaration.getDeptName());
 						summaryInformationDTO.setDeclarationLevel(deptAssessmentDeclaration.getRatingGrade());
 						if (null != evaluationDept) {
@@ -573,6 +579,7 @@ public class DeptAssessmentDeclarationController {
 					summaryInformationDTO.setEmployeeNo(deptAssessmentDeclarationContent.getEmployeeNo());
 					summaryInformationDTO.setEmployeeName(deptAssessmentDeclarationContent.getEmployeeName());
 					summaryInformationDTO.setSuggestedValue(deptAssessmentDeclarationContent.getSuggestedValue());
+					summaryInformationDTO.setDeclarationMonth(deptAssessmentDeclaration.getDeclarationMonth());
 					summaryInformationDTO.setReportingDepartment(deptAssessmentDeclaration.getDeptName());
 					summaryInformationDTO.setDeclarationLevel(deptAssessmentDeclaration.getRatingGrade());
 					if (null != evaluationDept) {
@@ -585,10 +592,13 @@ public class DeptAssessmentDeclarationController {
 		List<SummaryInformationDTO> list = new ArrayList<>();
 		Map<String, List<SummaryInformationDTO>> map = summaryInformationDTOList.stream().collect(Collectors.groupingBy(SummaryInformationDTO::getEmployeeNo));
 		map.forEach((key, value) -> {
-			for (SummaryInformationDTO summaryInformationDTO : value) {
-				summaryInformationDTO.setDeclarationsNumber(String.valueOf(value.size()));
-			}
-			list.addAll(value);
+			Map<Integer, List<SummaryInformationDTO>> map1 = value.stream().collect(Collectors.groupingBy(SummaryInformationDTO::getDeclarationMonth));
+			map1.forEach((key1, value1) -> {
+				for (SummaryInformationDTO summaryInformationDTO : value1) {
+					summaryInformationDTO.setDeclarationsNumber(String.valueOf(value1.size()));
+				}
+				list.addAll(value1);
+			});
 		});
 		list.sort(Comparator.comparing(SummaryInformationDTO::getSerialNumber, Comparator.nullsLast(Integer::compareTo)));
 		ExcelUtils.createCollectExcel(list, startTimeArr[0], startTimeArr[1], endTimeArr[0], endTimeArr[1], response.getOutputStream());
@@ -602,11 +612,20 @@ public class DeptAssessmentDeclarationController {
 	 */
 	@GetMapping(value = "/participantsNumber/{id}")
 	public R participantsNumber(@PathVariable String id) {
-		QueryWrapper<DeptAssessmentDeclarationContent> qw = new QueryWrapper<>();
+		QueryWrapper<DeptAssessmentDeclarationComplete> qwComplete = new QueryWrapper<>();
 		if (StringUtils.isNotEmpty(id)) {
-			qw.lambda().like(DeptAssessmentDeclarationContent::getAssessmentDeclarationId, id);
+			qwComplete.lambda().eq(DeptAssessmentDeclarationComplete::getAssessmentDeclarationId, id);
+		}
+		int countComplete = deptAssessmentDeclarationCompleteService.list(qwComplete).size();
+		if (countComplete > 0) {
+			QueryWrapper<DeptAssessmentDeclarationContent> qwContent = new QueryWrapper<>();
+			if (StringUtils.isNotEmpty(id)) {
+				qwContent.lambda().eq(DeptAssessmentDeclarationContent::getAssessmentDeclarationId, id);
+			}
+			int countContent = deptAssessmentDeclarationContentService.list(qwContent).size();
+			return R.ok().data(countContent);
+		} else {
+			return R.error("未添加工作完成情况!");
 		}
-		int count = deptAssessmentDeclarationContentService.list(qw).size();
-		return R.ok().data(count);
 	}
 }

+ 2 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/dto/request/SummaryInformationDTO.java

@@ -16,6 +16,8 @@ public class SummaryInformationDTO {
 	private String employeeName;
 	//推荐系数
 	private String suggestedValue;
+	//申报月份
+	private Integer declarationMonth;
 	//申报次数
 	private String declarationsNumber;
 	//申报部门

+ 14 - 7
ims-service/ims-eval/src/main/java/com/ims/eval/util/ExcelUtils.java

@@ -271,9 +271,10 @@ public class ExcelUtils {
 		sheet.setColumnWidth(4, 256 * 20);
 		sheet.setColumnWidth(5, 256 * 20);
 		sheet.setColumnWidth(6, 256 * 20);
+		sheet.setColumnWidth(7, 256 * 20);
 
 		//设置合并单元格
-		sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 6));
+		sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 7));
 
 		// 设置标题
 		Row titleRow = sheet.createRow(0);
@@ -299,13 +300,16 @@ public class ExcelUtils {
 		Cell suggestedValueHeader = headerRow.createCell(3);
 		suggestedValueHeader.setCellValue("评定系数");
 		suggestedValueHeader.setCellStyle(headerStyle);
-		Cell declarationsNumberHeader = headerRow.createCell(4);
+		Cell declarationMonthHeader = headerRow.createCell(4);
+		declarationMonthHeader.setCellValue("申报月份");
+		declarationMonthHeader.setCellStyle(headerStyle);
+		Cell declarationsNumberHeader = headerRow.createCell(5);
 		declarationsNumberHeader.setCellValue("申报次数");
 		declarationsNumberHeader.setCellStyle(headerStyle);
-		Cell reportingDepartmentHeader = headerRow.createCell(5);
+		Cell reportingDepartmentHeader = headerRow.createCell(6);
 		reportingDepartmentHeader.setCellValue("申报部门");
 		reportingDepartmentHeader.setCellStyle(headerStyle);
-		Cell declarationLevelHeader = headerRow.createCell(6);
+		Cell declarationLevelHeader = headerRow.createCell(7);
 		declarationLevelHeader.setCellValue("评定级别");
 		declarationLevelHeader.setCellStyle(headerStyle);
 
@@ -327,13 +331,16 @@ public class ExcelUtils {
 			Cell suggestedValueCell = row.createCell(3);
 			suggestedValueCell.setCellValue(summaryInformationDTOList.get(i).getSuggestedValue());
 			suggestedValueCell.setCellStyle(cellStyle);
-			Cell declarationsNumberCell = row.createCell(4);
+			Cell declarationMonthCell = row.createCell(4);
+			declarationMonthCell.setCellValue(summaryInformationDTOList.get(i).getDeclarationMonth());
+			declarationMonthCell.setCellStyle(cellStyle);
+			Cell declarationsNumberCell = row.createCell(5);
 			declarationsNumberCell.setCellValue(summaryInformationDTOList.get(i).getDeclarationsNumber());
 			declarationsNumberCell.setCellStyle(cellStyle);
-			Cell reportingDepartmentCell = row.createCell(5);
+			Cell reportingDepartmentCell = row.createCell(6);
 			reportingDepartmentCell.setCellValue(summaryInformationDTOList.get(i).getReportingDepartment());
 			reportingDepartmentCell.setCellStyle(cellStyle);
-			Cell declarationLevelCell = row.createCell(6);
+			Cell declarationLevelCell = row.createCell(7);
 			declarationLevelCell.setCellValue(summaryInformationDTOList.get(i).getDeclarationLevel());
 			declarationLevelCell.setCellStyle(cellStyle);
 			rowIndex++;