Browse Source

优化 撤回判断逻辑

master
PoffyZhang 1 year ago
parent
commit
11801db075
2 changed files with 13 additions and 5 deletions
  1. +7
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java
  2. +6
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java

+ 7
- 2
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java View File

@@ -22,6 +22,7 @@ import org.flowable.engine.history.HistoricActivityInstance;
import org.flowable.engine.history.HistoricProcessInstance;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -96,15 +97,19 @@ public class WithDrawHandle {

Boolean isAndOr = Boolean.FALSE;

//还有种情况是 会签 或签 并且在当前节点 并且已经通过
//当前节点是 会签|或签的情况
if(CollUtil.isNotEmpty(thisAndOr)){
for(ProgressNode n : thisAndOr){
if(Objects.nonNull(n.getFinishTime())){
//当前会签 有审批过的 那么上个会签|或签 无论如何 就不可能可以撤回了
beforeAndOr = Collections.emptyList();
}
//找到了 当前的操作人 在当前的 会签|或签 中 并且已经审批了
if(n.getUserId().equals(user.getEmployeeCode()) &&
Objects.nonNull(n.getFinishTime())){
beforeProgressNode = n;
//说明当前操作人 在上个会签或者或签节点
isAndOr = Boolean.TRUE;
break;
}
}
}


+ 6
- 3
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -181,9 +181,12 @@ public class TodoCenterManage {
List<ProcessTaskVo> todoList = processTaskService.getUserTodoList(req);
//有退回待办的
List<ProcessTaskVo> backList = processTaskService.getBackTodoList(req);

List<ProcessTaskVo> list = Stream.concat(todoList.stream(),backList.stream()).collect(Collectors.toList());
list.stream().filter(Objects::nonNull).sorted(Comparator.comparing(ProcessTaskVo::getTaskCreateTime).reversed());
//合并 并且排序
List<ProcessTaskVo> list = Stream.concat(todoList.stream(),backList.stream())
.filter(Objects::nonNull)
.sorted(Comparator.comparing(ProcessTaskVo::getTaskCreateTime)
.reversed())
.collect(Collectors.toList());

if (CollUtil.isEmpty(list)) {
return PageVo.empty();


Loading…
Cancel
Save