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