|
@@ -87,7 +87,7 @@ public class AssetsNodeHandler extends WorkNodeProcessable {
|
|
|
//2.根据出具的产品类型 确定需要哪些节点
|
|
|
Map<String, List<WorkflowNodeEnum>> assetsNecessaryNodes = CallbackEnum.NecessaryNode.getByProduction(MainBusinessEnum.ASSET_BUSINESS.name(),
|
|
|
production);
|
|
|
- nextWorkNode = workNodeService.getNextWorkNodeByBusiness(currentInstanceNode.getFlowId(), MainBusinessEnum.ASSET_BUSINESS, currentInstanceNode.getNodeCode(), assetsNecessaryNodes,null);
|
|
|
+ nextWorkNode = workNodeService.getNextWorkNodeByBusiness(currentInstanceNode.getFlowId(), MainBusinessEnum.ASSET_BUSINESS, currentInstanceNode.getNodeCode(), assetsNecessaryNodes, null);
|
|
|
break;
|
|
|
// 校验资产四审
|
|
|
case CHECK_ASSET_FOURTH_CHECK_REPORT:
|
|
@@ -158,13 +158,19 @@ public class AssetsNodeHandler extends WorkNodeProcessable {
|
|
|
public boolean goBack(WorkNodeCommit commit) {
|
|
|
Long instanceNodeId = commit.getInstanceNodeId();
|
|
|
WorkFlowNodeInstance currentNode = workFlowNodeInstanceMapper.getInstanceNodeInfoById(instanceNodeId);
|
|
|
- //判断是否是审核节点退回到撰写节点
|
|
|
- List<String> writeNodes = Arrays.asList(new String[]{REVIEW_STATEMENT.name(), CHECK_REPORT.name()});
|
|
|
- if (writeNodes.contains(currentNode.getNodeCode())) {
|
|
|
+ // 用于判断是否是审核节点退回到撰写节点
|
|
|
+ List<String> checkNodes = Arrays.asList(REVIEW_STATEMENT.name(), CHECK_REPORT.name());
|
|
|
+
|
|
|
+ // 用于判断是否是复审节点进行退回操作
|
|
|
+ List<String> reCheckNodes = Arrays.asList(REEXAMINE_STATEMENT.name(), RECHECK_REPORT.name());
|
|
|
+
|
|
|
+ if (checkNodes.contains(currentNode.getNodeCode())) { // 审核节点退回到撰写节点
|
|
|
//将上一个节点状态改为PENDING
|
|
|
workFlowNodeInstanceService.update(new LambdaUpdateWrapper<WorkFlowNodeInstance>()
|
|
|
.set(WorkFlowNodeInstance::getState, PENDING)
|
|
|
.eq(WorkFlowNodeInstance::getBusinessId, currentNode.getBusinessId())
|
|
|
+ // 如果subId和minId都不为空,有可能意见书开始就已经流程分叉,所以需要判断一下subId
|
|
|
+ .eq(ObjectUtil.isNotNull(currentNode.getBusinessSubId()) && ObjectUtil.isNotNull(currentNode.getBusinessMinId()), WorkFlowNodeInstance::getBusinessSubId, currentNode.getBusinessSubId())
|
|
|
.eq(WorkFlowNodeInstance::getFlowId, currentNode.getFlowId())
|
|
|
.eq(WorkFlowNodeInstance::getSequence, (currentNode.getSequence() - 1))
|
|
|
.eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
@@ -172,11 +178,45 @@ public class AssetsNodeHandler extends WorkNodeProcessable {
|
|
|
workFlowNodeInstanceService.delete(instanceNodeId);
|
|
|
|
|
|
//删除当前节点的待处理的任务记录
|
|
|
- workTaskRecordService.remove(new LambdaQueryWrapper<WorkTaskRecord>().eq(WorkTaskRecord::getInstanceId,instanceNodeId));
|
|
|
+ workTaskRecordService.remove(new LambdaQueryWrapper<WorkTaskRecord>().eq(WorkTaskRecord::getInstanceId, instanceNodeId));
|
|
|
+
|
|
|
+ //添加日志
|
|
|
+ return addWorkflowLog(commit, currentNode);
|
|
|
+ } else if (reCheckNodes.contains(currentNode.getNodeCode())) { // 复审节点退回跳过审核节点直接到撰写节点
|
|
|
+
|
|
|
+ // 获取上一个审核节点的信息(审核节点可能会流程分叉,所以还要判断subId和minId)
|
|
|
+ WorkFlowNodeInstance skipNode = workFlowNodeInstanceService.getOne(new LambdaQueryWrapper<WorkFlowNodeInstance>()
|
|
|
+ .eq(WorkFlowNodeInstance::getBusinessId, currentNode.getBusinessId())
|
|
|
+ .eq(ObjectUtil.isNotNull(currentNode.getBusinessSubId()), WorkFlowNodeInstance::getBusinessSubId, currentNode.getBusinessSubId())
|
|
|
+ .eq(ObjectUtil.isNotNull(currentNode.getBusinessMinId()), WorkFlowNodeInstance::getBusinessMinId, currentNode.getBusinessMinId())
|
|
|
+ .eq(WorkFlowNodeInstance::getFlowId, currentNode.getFlowId())
|
|
|
+ .eq(WorkFlowNodeInstance::getSequence, (currentNode.getSequence() - 1))
|
|
|
+ .eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
|
+
|
|
|
+ // 将上一个审核节点删除
|
|
|
+ workFlowNodeInstanceService.delete(skipNode.getId());
|
|
|
+ // 将上一个审核节点的任务删除
|
|
|
+ workTaskRecordService.remove(new LambdaQueryWrapper<WorkTaskRecord>().eq(WorkTaskRecord::getInstanceId, skipNode.getId()));
|
|
|
+
|
|
|
+ //将上上个撰写节点状态改为PENDING
|
|
|
+ workFlowNodeInstanceService.update(new LambdaUpdateWrapper<WorkFlowNodeInstance>()
|
|
|
+ .set(WorkFlowNodeInstance::getState, PENDING)
|
|
|
+ .eq(WorkFlowNodeInstance::getBusinessId, currentNode.getBusinessId())
|
|
|
+ // 如果subId和minId都不为空,有可能意见书开始就已经流程分叉,所以需要判断一下subId
|
|
|
+ .eq(ObjectUtil.isNotNull(currentNode.getBusinessSubId()) && ObjectUtil.isNotNull(currentNode.getBusinessMinId()), WorkFlowNodeInstance::getBusinessSubId, currentNode.getBusinessSubId())
|
|
|
+ .eq(WorkFlowNodeInstance::getFlowId, currentNode.getFlowId())
|
|
|
+ .eq(WorkFlowNodeInstance::getSequence, (currentNode.getSequence() - 2))
|
|
|
+ .eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
|
+
|
|
|
+ //删除当前节点
|
|
|
+ workFlowNodeInstanceService.delete(instanceNodeId);
|
|
|
+
|
|
|
+ //删除当前节点的待处理的任务记录
|
|
|
+ workTaskRecordService.remove(new LambdaQueryWrapper<WorkTaskRecord>().eq(WorkTaskRecord::getInstanceId, instanceNodeId));
|
|
|
|
|
|
//添加日志
|
|
|
- return addWorkflowLog(commit,currentNode);
|
|
|
- }else {
|
|
|
+ return addWorkflowLog(commit, currentNode);
|
|
|
+ } else {
|
|
|
return super.goBack(commit);
|
|
|
}
|
|
|
}
|