Browse Source

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

hlf 9 months ago
parent
commit
d00c3f4b70

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

@@ -160,24 +160,28 @@ public class DeptAssessmentDeclarationController {
 	public R modify(@RequestBody DeptAssessmentDeclaration deptAssessmentDeclaration) {
 		try {
 			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) {
+			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(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);
+					}
 				}
+			} else {
+				b = deptAssessmentDeclarationService.updateById(deptAssessmentDeclaration);
 			}
 			if (b) {
 				return R.ok().data(b);