소스 검색

Merge remote-tracking branch 'origin/master'

master
niohe·erbao 1 년 전
부모
커밋
3202e3c9f6
1개의 변경된 파일42개의 추가작업 그리고 2개의 파일을 삭제
  1. +42
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java

+ 42
- 2
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java 파일 보기

@@ -65,6 +65,7 @@ import org.flowable.bpmn.model.*;
import org.flowable.engine.HistoryService;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.runtime.ActivityInstance;
import org.mockito.internal.matchers.CompareTo;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@@ -122,7 +123,27 @@ public class TodoCenterManage {
}
List<String> instCodes = userTodoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList());

Map<String, ProcessTaskVo> taskVoMap = userTodoList.stream().collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v));
List<ProcessTaskVo> resList = new ArrayList<>();
List<String> instList = new ArrayList<>();
for (ProcessTaskVo processTaskVo : userTodoList) {
Map<String, ProcessTaskVo> map = resList.stream().collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v));
if (instList.contains(processTaskVo.getInstanceId())){
// 比较两个processTaskVo的endTime,保留最后处理的
ProcessTaskVo vo = map.get(processTaskVo.getInstanceId());
int compare = processTaskVo.getTaskEndTime().compareTo(vo.getTaskEndTime());
if (compare > 0){
instList.remove(processTaskVo.getInstanceId());
resList.remove(vo);
}else {
continue;
}
}
instList.add(processTaskVo.getInstanceId());
resList.add(processTaskVo);
}

Map<String, ProcessTaskVo> taskVoMap = resList.stream().collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v));

//2.再分页查询项目信息
ProjectListReq projectListReq = new ProjectListReq();
projectListReq.setInstCodes(instCodes);
@@ -620,10 +641,29 @@ public class TodoCenterManage {
if (CollUtil.isEmpty(userIdoList)) {
return PageVo.empty();
}

List<String> instCodes = userIdoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList());
Map<String, ProcessTaskVo> taskVoMap = userIdoList.stream().collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v));

List<ProcessTaskVo> resList = new ArrayList<>();
List<String> instList = new ArrayList<>();
for (ProcessTaskVo processTaskVo : userIdoList) {
Map<String, ProcessTaskVo> map = resList.stream().collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v));
if (instList.contains(processTaskVo.getInstanceId())){
// 比较两个processTaskVo的endTime,保留最后处理的
ProcessTaskVo vo = map.get(processTaskVo.getInstanceId());
int compare = processTaskVo.getTaskEndTime().compareTo(vo.getTaskEndTime());
if (compare > 0){
instList.remove(processTaskVo.getInstanceId());
resList.remove(vo);
}else {
continue;
}
}
instList.add(processTaskVo.getInstanceId());
resList.add(processTaskVo);
}

Map<String, ProcessTaskVo> taskVoMap = resList.stream().collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v));
// 分页查询项目信息
ProjectListReq projectListReq = new ProjectListReq();
projectListReq.setInstCodes(instCodes);


불러오는 중...
취소
저장