|
@@ -238,6 +238,7 @@ public class MajorServiceImpl extends ServiceImpl<MajorMapper, Major> implements
|
|
|
.eq(WorkFlowNodeInstance::getBusinessId, id)
|
|
|
.eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
|
WorkFlowNodeInstance allotNode = exists.stream().filter(x -> x.getSequence().equals(1) && x.getState().equals(NodeStateEnum.FINISHED.name())).findFirst().orElse(null);
|
|
|
+
|
|
|
if (allotNode!=null){
|
|
|
ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"业务部已分单,无法撤回。若需撤回请联系当前节点待办人退回流程。");
|
|
|
return Boolean.FALSE;
|
|
@@ -245,15 +246,14 @@ public class MajorServiceImpl extends ServiceImpl<MajorMapper, Major> implements
|
|
|
try {
|
|
|
WorkFlowNodeInstance instance = exists.stream().filter(x -> x.getState().equals(NodeStateEnum.PENDING.name())).findFirst().get();
|
|
|
//撤回时,当前节点有可能是下单加点和分单节点。如果不是下单节点,就找到分单节点状态改为pending。sequence:0 代表下单节点
|
|
|
- if (!instance.getSequence().equals(0)){
|
|
|
- WorkFlowNodeInstance openNode = exists.stream().filter(x -> x.getSequence().equals(0)).findFirst().get();
|
|
|
- List<WorkFlowNodeInstance> others = exists.stream().filter(x -> !x.getSequence().equals(0)).collect(Collectors.toList());
|
|
|
- for (WorkFlowNodeInstance workFlowNodeInstance: others){
|
|
|
- workFlowNodeInstanceService.removeById(workFlowNodeInstance.getId());
|
|
|
- }
|
|
|
- openNode.setState(NodeStateEnum.PENDING.name());
|
|
|
- workFlowNodeInstanceService.updateById(openNode);
|
|
|
+
|
|
|
+ WorkFlowNodeInstance openNode = exists.stream().filter(x -> x.getSequence().equals(0) && !x.getNodeId().equals(262L)).findFirst().get();
|
|
|
+ List<WorkFlowNodeInstance> others = exists.stream().filter(x -> !x.getId().equals(openNode.getId())).collect(Collectors.toList());
|
|
|
+ for (WorkFlowNodeInstance workFlowNodeInstance: others){
|
|
|
+ workFlowNodeInstanceService.removeById(workFlowNodeInstance.getId());
|
|
|
}
|
|
|
+ openNode.setState(NodeStateEnum.PENDING.name());
|
|
|
+ workFlowNodeInstanceService.updateById(openNode);
|
|
|
} catch (Exception e) {
|
|
|
ErrorCode.throwBusinessException(ErrorCode.DATA_NOT_EXISTS);
|
|
|
}
|