监督执法修改

This commit is contained in:
pengjie 2023-08-03 19:19:24 +08:00
parent 0ee8eb2c10
commit 09ddc2d6e9
2 changed files with 15 additions and 8 deletions

View File

@ -33,25 +33,24 @@ public class InspectQuestionExamineServiceImpl extends ServiceImpl<InspectQuesti
@Override
public boolean examine(InspectQuestionExamine inspectQuestionExamine) {
Integer level = inspectQuestionExamine.getExamineState() == 1 ? inspectQuestionExamine.getLevel() : 1;
// 修改问题状态
LambdaUpdateWrapper<InspectQuestion> wrapperQuestion = Wrappers.<InspectQuestion>lambdaUpdate();
wrapperQuestion.set(InspectQuestion::getState, inspectQuestionExamine.getExamineState() == 1 ? 3 : 4);
wrapperQuestion.set(InspectQuestion::getLevel, level);
wrapperQuestion.set(InspectQuestion::getLevel, inspectQuestionExamine.getLevel());
wrapperQuestion.eq(InspectQuestion::getId, inspectQuestionExamine.getInspectQuestionId());
inspectQuestionService.update(wrapperQuestion);
// 查询是否全部整改完成
InspectQuestion inspectQuestion = inspectQuestionService.getById(inspectQuestionExamine.getInspectQuestionId());
List<InspectQuestion> inspectQuestions = inspectQuestionService.list(Wrappers.<InspectQuestion>lambdaQuery().eq(InspectQuestion::getRecordId, inspectQuestion.getRecordId()));
Integer state = 3;
if (inspectQuestions.stream().filter(i -> i.getState() == 3).collect(Collectors.toList()).size() == inspectQuestions.size()) {
if (inspectQuestions.stream().filter(i -> i.getState() == 3 && i.getLevel() == 2).collect(Collectors.toList()).size() == inspectQuestions.size()) {
state = 4;
} else if (inspectQuestions.stream().filter(i -> i.getState() < 3).collect(Collectors.toList()).size() == 0) {
state = 5;
}
if (state != 3) {
LambdaUpdateWrapper<InspectRecord> recordWrapper = Wrappers.<InspectRecord>lambdaUpdate();
recordWrapper.set(InspectRecord::getLevel, level);
recordWrapper.set(InspectRecord::getLevel, inspectQuestionExamine.getLevel());
recordWrapper.set(InspectRecord::getState, state);
recordWrapper.eq(InspectRecord::getId, inspectQuestion.getRecordId());
inspectRecordService.update(recordWrapper);
@ -63,8 +62,18 @@ public class InspectQuestionExamineServiceImpl extends ServiceImpl<InspectQuesti
public boolean saveInfo(InspectQuestionExamine inspectQuestionExamine) {
LambdaUpdateWrapper<InspectQuestion> wrapperQuestion = Wrappers.<InspectQuestion>lambdaUpdate();
wrapperQuestion.set(InspectQuestion::getState, 2);
wrapperQuestion.set(InspectQuestion::getLevel, 1);
wrapperQuestion.eq(InspectQuestion::getId, inspectQuestionExamine.getInspectQuestionId());
inspectQuestionService.update(wrapperQuestion);
InspectQuestion inspectQuestion = inspectQuestionService.getById(inspectQuestionExamine.getInspectQuestionId());
List<InspectQuestion> inspectQuestions = inspectQuestionService.list(Wrappers.<InspectQuestion>lambdaQuery().eq(InspectQuestion::getRecordId, inspectQuestion.getRecordId()));
if (inspectQuestions.stream().filter(i -> i.getState() == 2 || i.getState() == 3).collect(Collectors.toList()).size() == inspectQuestions.size()) {
LambdaUpdateWrapper<InspectRecord> recordWrapper = Wrappers.<InspectRecord>lambdaUpdate();
recordWrapper.set(InspectRecord::getLevel, 1);
recordWrapper.set(InspectRecord::getState, 3);
recordWrapper.eq(InspectRecord::getId, inspectQuestion.getRecordId());
inspectRecordService.update(recordWrapper);
}
return this.save(inspectQuestionExamine);
}
}

View File

@ -145,7 +145,6 @@ public class InspectRecordServiceImpl extends ServiceImpl<InspectRecordMapper, I
// 审批通过---闭合
Integer questionState = 4;
Integer questionExamineState = 2;
Integer level = 1;
String suggest = "驳回";
if (inspectRecord.getState() == 4) {
List<Integer> list = Arrays.asList(1,4);
@ -157,12 +156,11 @@ public class InspectRecordServiceImpl extends ServiceImpl<InspectRecordMapper, I
questionState = 3;
questionExamineState = 1;
suggest = "同意";
level = inspectRecord.getLevel();
}
// 修改问题状态
LambdaUpdateWrapper<InspectQuestion> wrapperQuestion = Wrappers.<InspectQuestion>lambdaUpdate();
wrapperQuestion.set(InspectQuestion::getState, questionState);
wrapperQuestion.set(InspectQuestion::getLevel, level);
wrapperQuestion.set(InspectQuestion::getLevel, inspectRecord.getLevel());
wrapperQuestion.eq(InspectQuestion::getRecordId, inspectRecord.getId());
wrapperQuestion.eq(InspectQuestion::getState, inspectRecord.getLevel() == 1 ? 2 : 3);
boolean flag = inspectQuestionService.update(wrapperQuestion);
@ -174,7 +172,7 @@ public class InspectRecordServiceImpl extends ServiceImpl<InspectRecordMapper, I
LambdaUpdateWrapper<InspectQuestionExamine> wrapper = Wrappers.<InspectQuestionExamine>lambdaUpdate();
wrapper.set(InspectQuestionExamine::getExamineState, questionExamineState);
wrapper.set(InspectQuestionExamine::getSuggest, suggest);
wrapper.set(InspectQuestionExamine::getLevel, level);
wrapper.set(InspectQuestionExamine::getLevel, inspectRecord.getLevel());
wrapper.in(InspectQuestionExamine::getInspectQuestionId, questionId);
wrapper.eq(InspectQuestionExamine::getExamineState, 0);
inspectQuestionExamineService.update(wrapper);