Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

全业务考评 8 месяцев назад
Родитель
Сommit
ddcd827e25

+ 26 - 7
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DeptAssessmentDeclarationController.java

@@ -18,7 +18,6 @@ import com.ims.eval.entity.dto.request.PostUserDTO;
 import com.ims.eval.entity.dto.request.SummaryInformationDTO;
 import com.ims.eval.entity.dto.result.R;
 import com.ims.eval.service.*;
-import com.ims.eval.service.custom.PostService;
 import com.ims.eval.service.custom.PostUserService;
 import com.ims.eval.util.ExcelUtil;
 import com.ims.eval.util.ExcelUtils;
@@ -62,9 +61,6 @@ public class DeptAssessmentDeclarationController {
 	private IUserService userService;
 
 	@Resource
-	private PostService postService;
-
-	@Resource
 	private PostUserService postUserService;
 
 	@Resource
@@ -163,11 +159,34 @@ public class DeptAssessmentDeclarationController {
 	@PostMapping(value = "/modify")
 	public R modify(@RequestBody DeptAssessmentDeclaration deptAssessmentDeclaration) {
 		try {
-			boolean b = deptAssessmentDeclarationService.updateById(deptAssessmentDeclaration);
+			boolean b = false;
+			if (null != deptAssessmentDeclaration.getDeclarationMonth()) {
+				DeptAssessmentDeclaration od = deptAssessmentDeclarationService.getById(deptAssessmentDeclaration.getId());
+				if (od.getDeclarationMonth().equals(deptAssessmentDeclaration.getDeclarationMonth())) {
+					b = deptAssessmentDeclarationService.updateById(deptAssessmentDeclaration);
+				} else {
+					QueryWrapper<DeptAssessmentDeclaration> qw = new QueryWrapper<>();
+					if (StringUtils.isNotEmpty(od.getDeptId())) {
+						qw.lambda().eq(DeptAssessmentDeclaration::getDeptId, od.getDeptId());
+					}
+					if (null != od.getAnnual()) {
+						qw.lambda().eq(DeptAssessmentDeclaration::getAnnual, od.getAnnual());
+					}
+					if (null != deptAssessmentDeclaration.getDeclarationMonth()) {
+						qw.lambda().eq(DeptAssessmentDeclaration::getDeclarationMonth, deptAssessmentDeclaration.getDeclarationMonth());
+					}
+					List<DeptAssessmentDeclaration> assessmentDeclarationList = deptAssessmentDeclarationService.list(qw);
+					if (assessmentDeclarationList.size() == 0) {
+						b = deptAssessmentDeclarationService.updateById(deptAssessmentDeclaration);
+					}
+				}
+			} else {
+				b = deptAssessmentDeclarationService.updateById(deptAssessmentDeclaration);
+			}
 			if (b) {
 				return R.ok().data(b);
 			} else {
-				return R.error("修改失败!");
+				return R.error("修改失败或月份重复!");
 			}
 		} catch (CustomException e) {
 			return R.customError(e.getMessage()).data("失败!");
@@ -668,7 +687,7 @@ public class DeptAssessmentDeclarationController {
 		boolean b = false;
 		JSONObject jsonArr = userService.getLoginNameByUserInfo(employeeNo, request);
 		JSONObject data = (JSONObject) jsonArr.get("data");
-		if ("操作成功".equals(String.valueOf(data.get("msg")))) {
+		if (!data.isEmpty()){
 			DeptAssessmentDeclaration deptAssessmentDeclaration = deptAssessmentDeclarationService.getById(id);
 			if (null != deptAssessmentDeclaration) {
 				deptAssessmentDeclaration.setSeconderId(String.valueOf(data.get("id")));

+ 12 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/controller/PerformanceBenchmarkingManageController.java

@@ -0,0 +1,12 @@
+package com.ims.eval.controller;
+
+/**
+ * @author hlf
+ * @date 2024/3/21 15:58
+ * 文件说明:业绩对标管理
+ */
+public class PerformanceBenchmarkingManageController {
+
+
+
+}