|
|
|
|
@ -49,19 +49,25 @@ public class ApplyCompletionAction implements Action {
|
|
|
|
|
//validator.validate(verifyData);
|
|
|
|
|
// 新增审批数据
|
|
|
|
|
Negative negative = negativeService.getById(actionDto.getNegativeId()); |
|
|
|
|
updateNegative(actionDto.getNegativeId(), verifyData, negative); |
|
|
|
|
updateNegative(negative, verifyData); |
|
|
|
|
doneWork(actionDto.getWorkId()); |
|
|
|
|
addWork(actionDto.getNegativeId(), actionDto.getWorkId(), |
|
|
|
|
// 是否是本级办理
|
|
|
|
|
negative.getIsSecondHandle() ? RoleCodeEnum.FIRST_ADMIN.getCode() : RoleCodeEnum.SECOND_ADMIN.getCode(), |
|
|
|
|
negative); |
|
|
|
|
|
|
|
|
|
addApprove(negative); |
|
|
|
|
LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>() |
|
|
|
|
.set(Negative::getFlowKey, negative.getIsSecondHandle() ? FlowNodeEnum.FIRST_APPROVE.getKey() : FlowNodeEnum.SECOND_APPROVE.getKey()) |
|
|
|
|
// 当前处理对象
|
|
|
|
|
.set(Negative::getCurrentProcessingObject, negative.getIsSecondHandle() ? "市局专班" : String.format("%s专班", negative.getHandleSecondDepartName())); |
|
|
|
|
negativeService.update(updateWrapper); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void updateNegative(String negativeId, VerifyData verifyData, Negative negative) { |
|
|
|
|
public void updateNegative(Negative negative, VerifyData verifyData) { |
|
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
|
LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>() |
|
|
|
|
.eq(Negative::getId, negativeId) |
|
|
|
|
.set(Negative::getFlowKey, negative.getIsSecondHandle() ? FlowNodeEnum.FIRST_APPROVE.getKey() : FlowNodeEnum.SECOND_APPROVE.getKey()) |
|
|
|
|
.eq(Negative::getId, negative.getId()) |
|
|
|
|
.set(Negative::getUpdTime, now) |
|
|
|
|
.set(Negative::getProcessingStatus, ProcessingStatusEnum.approval.name()) |
|
|
|
|
.set(Negative::getCheckStatus, verifyData.getCheckStatus()) |
|
|
|
|
@ -71,9 +77,7 @@ public class ApplyCompletionAction implements Action {
|
|
|
|
|
.set(Negative::getIsRectifyName, verifyData.getIsRectifyName()) |
|
|
|
|
.set(Negative::getAccountabilityTarget, verifyData.getAccountabilityTarget()) |
|
|
|
|
.set(Negative::getCaseNumber, verifyData.getCaseNumber()) |
|
|
|
|
.set(Negative::getRectifyDesc, verifyData.getRectifyDesc()) |
|
|
|
|
// 当前处理对象
|
|
|
|
|
.set(Negative::getCurrentProcessingObject, negative.getIsSecondHandle() ? "市局专班" : String.format("%s专班", negative.getHandleSecondDepartName())); |
|
|
|
|
.set(Negative::getRectifyDesc, verifyData.getRectifyDesc()); |
|
|
|
|
// 未整改
|
|
|
|
|
if (IsRectifyEnum.NOT.getValue().equals(verifyData.getIsRectifyCode())) { |
|
|
|
|
updateWrapper.set(Negative::getRectifyRestrictionDays, verifyData.getRectifyRestrictionDays()); |
|
|
|
|
@ -82,21 +86,25 @@ public class ApplyCompletionAction implements Action {
|
|
|
|
|
|
|
|
|
|
if (!verifyData.getBlames().isEmpty()) { |
|
|
|
|
List<NegativeProblemRelation> problemRelations = new ArrayList<>(); |
|
|
|
|
List<NegativeBlame> negativeBlames = verifyData.getBlames().stream().map(item -> { |
|
|
|
|
List<VerifyData.Blame> blames = verifyData.getBlames(); |
|
|
|
|
if (AccountabilityTargetEnum.PERSONAL.getValue().equals(verifyData.getAccountabilityTarget())) { |
|
|
|
|
blames = verifyData.getBlames().stream().filter(item -> BlameType.personal.name().equals(item.getType())).toList(); |
|
|
|
|
}else if (AccountabilityTargetEnum.DEPARTMENT.getValue().equals(verifyData.getAccountabilityTarget())) { |
|
|
|
|
blames = verifyData.getBlames().stream().filter(item -> BlameType.department.name().equals(item.getType())).toList(); |
|
|
|
|
} |
|
|
|
|
List<NegativeBlame> negativeBlames = blames.stream().map(item -> { |
|
|
|
|
NegativeBlame negativeBlame = new NegativeBlame(); |
|
|
|
|
BeanUtil.copyProperties(item, negativeBlame); |
|
|
|
|
if(verifyData != null && verifyData.getBlameLeaders() != null) { |
|
|
|
|
List<VerifyData.BlameLeader> blameLeaders = verifyData.getBlameLeaders().stream() |
|
|
|
|
.filter(leader -> leader.getBlameIdCodes().contains(item.getBlameIdCode())) |
|
|
|
|
.toList(); |
|
|
|
|
if(!blameLeaders.isEmpty()) { |
|
|
|
|
BeanUtil.copyProperties(blameLeaders.get(0), negativeBlame); |
|
|
|
|
} |
|
|
|
|
List<VerifyData.BlameLeader> blameLeaders = verifyData.getBlameLeaders().stream() |
|
|
|
|
.filter(leader -> leader.getBlameIdCodes().contains(item.getBlameIdCode())) |
|
|
|
|
.toList(); |
|
|
|
|
if(!blameLeaders.isEmpty()) { |
|
|
|
|
BeanUtil.copyProperties(blameLeaders.get(0), negativeBlame); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
negativeBlame |
|
|
|
|
.setBlameId(IdUtil.getSnowflakeNextIdStr()) |
|
|
|
|
.setNegativeId(negativeId) |
|
|
|
|
.setNegativeId(negative.getId()) |
|
|
|
|
.setCrtTime(now) |
|
|
|
|
.setUpdTime(now); |
|
|
|
|
|
|
|
|
|
@ -105,18 +113,18 @@ public class ApplyCompletionAction implements Action {
|
|
|
|
|
BeanUtil.copyProperties(problem, problemRelation); |
|
|
|
|
problemRelation.setId(IdUtil.fastSimpleUUID()); |
|
|
|
|
problemRelation.setBlameId(negativeBlame.getBlameId()); |
|
|
|
|
problemRelation.setNegativeId(negativeId); |
|
|
|
|
problemRelation.setNegativeId(negative.getId()); |
|
|
|
|
return problemRelation; |
|
|
|
|
}).toList()); |
|
|
|
|
return negativeBlame; |
|
|
|
|
}).toList(); |
|
|
|
|
// 先删除
|
|
|
|
|
negativeBlameService.remove(negativeId); |
|
|
|
|
negativeBlameService.remove(negative.getId()); |
|
|
|
|
// 新增涉及人员
|
|
|
|
|
negativeBlameService.saveBatch(negativeBlames); |
|
|
|
|
// 新增涉及人员问题类型
|
|
|
|
|
// 先删除
|
|
|
|
|
negativeProblemRelationService.remove(negativeId); |
|
|
|
|
negativeProblemRelationService.remove(negative.getId()); |
|
|
|
|
if (!problemRelations.isEmpty()) { |
|
|
|
|
// 新增
|
|
|
|
|
negativeProblemRelationService.saveBatch(problemRelations); |
|
|
|
|
@ -124,26 +132,30 @@ public class ApplyCompletionAction implements Action {
|
|
|
|
|
} |
|
|
|
|
if (!verifyData.getFiles().isEmpty()) { |
|
|
|
|
// 先删除
|
|
|
|
|
fileService.remove(negativeId); |
|
|
|
|
fileService.remove(negative.getId()); |
|
|
|
|
// 新增
|
|
|
|
|
fileService.saveBatch(verifyData.getFiles(), negativeId); |
|
|
|
|
fileService.saveBatch(verifyData.getFiles(), negative.getId()); |
|
|
|
|
} |
|
|
|
|
aproveService.remove(negativeId); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void addApprove(Negative negative) { |
|
|
|
|
aproveService.remove(negative.getId()); |
|
|
|
|
|
|
|
|
|
// 不是二级机构本级办理
|
|
|
|
|
if (!negative.getIsSecondHandle()) { |
|
|
|
|
NegativeApprove approve1 = new NegativeApprove() |
|
|
|
|
.setNegativeId(negativeId) |
|
|
|
|
.setNegativeId(negative.getId()) |
|
|
|
|
.setActionKey(FlowActionEnum.SECOND_APPROVE.getKey()) |
|
|
|
|
.setCreateTime(now); |
|
|
|
|
.setCreateTime(LocalDateTime.now()); |
|
|
|
|
aproveService.save(approve1); |
|
|
|
|
} |
|
|
|
|
// 三级审批 所队一>二級机构一>市局
|
|
|
|
|
if (!ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow())) { |
|
|
|
|
NegativeApprove approve2 = new NegativeApprove() |
|
|
|
|
.setNegativeId(negativeId) |
|
|
|
|
.setNegativeId(negative.getId()) |
|
|
|
|
.setActionKey(FlowActionEnum.FIRST_APPROVE.getKey()) |
|
|
|
|
.setCreateTime(now); |
|
|
|
|
.setCreateTime(LocalDateTime.now()); |
|
|
|
|
aproveService.save(approve2); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|