Procházet zdrojové kódy

绩效结果考核申报驳回修改信息问题

hlf před 10 měsíci
rodič
revize
fc0c7a5222

+ 20 - 5
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,7 +159,26 @@ public class DeptAssessmentDeclarationController {
 	@PostMapping(value = "/modify")
 	public R modify(@RequestBody DeptAssessmentDeclaration deptAssessmentDeclaration) {
 		try {
-			boolean b = deptAssessmentDeclarationService.updateById(deptAssessmentDeclaration);
+			boolean b = false;
+			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(deptAssessmentDeclaration.getDeptId())) {
+					qw.lambda().eq(DeptAssessmentDeclaration::getDeptId, deptAssessmentDeclaration.getDeptId());
+				}
+				if (null != deptAssessmentDeclaration.getAnnual()) {
+					qw.lambda().eq(DeptAssessmentDeclaration::getAnnual, deptAssessmentDeclaration.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);
+				}
+			}
 			if (b) {
 				return R.ok().data(b);
 			} else {