|
|
@@ -9,6 +9,7 @@ import cn.hutool.core.util.StrUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.google.common.collect.Maps; |
|
|
|
import com.google.common.collect.Sets; |
|
|
|
import com.ningdatech.basic.exception.BizException; |
|
|
|
import com.ningdatech.basic.function.VUtils; |
|
|
@@ -146,9 +147,6 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
private final StatisticsService statisticsService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private TaskService taskService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 待办中心待我处理项目列表查询 |
|
|
|
* |
|
|
@@ -160,12 +158,6 @@ public class TodoCenterManage { |
|
|
|
// 获取登录用户ID |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
|
|
|
|
//测试 有多少个 |
|
|
|
TaskQuery taskQuery = taskService.createTaskQuery(); |
|
|
|
taskQuery.active() |
|
|
|
.taskCandidateOrAssigned(String.valueOf(userId)); |
|
|
|
List<Task> taskList = taskQuery.list(); |
|
|
|
|
|
|
|
// 查出项目库项目 |
|
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
|
BeanUtils.copyProperties(param, projectListReq); |
|
|
@@ -173,13 +165,17 @@ public class TodoCenterManage { |
|
|
|
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); |
|
|
|
// 再查出项目关联的流程实例ID |
|
|
|
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); |
|
|
|
if(CollUtil.isEmpty(projectIdList)){ |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.in(ProjectInst::getProjectId, projectIdList) |
|
|
|
.orderByDesc(ProjectInst::getProjectId)); |
|
|
|
Map<String, Project> projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p-> projectsMap.get(p.getProjectId()))); |
|
|
|
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
if(CollUtil.isEmpty(instCodes)){ |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
// 查出用户工作流 |
|
|
|
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); |
|
|
|
req.setInstCodes(instCodes); |
|
|
@@ -247,14 +243,16 @@ public class TodoCenterManage { |
|
|
|
Map<String, Project> projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p-> projectsMap.get(p.getProjectId()))); |
|
|
|
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
// 查出用户工作流 |
|
|
|
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); |
|
|
|
req.setInstCodes(instCodes); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
BeanUtils.copyProperties(param,req); |
|
|
|
List<ProcessTaskVo> userTodoList = processTaskService.getUserTodoList(req); |
|
|
|
List<ProcessTaskVo> userTodoList = Lists.newArrayList(); |
|
|
|
if (CollUtil.isNotEmpty(instCodes)) { |
|
|
|
// 查出用户工作流 |
|
|
|
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); |
|
|
|
req.setInstCodes(instCodes); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
BeanUtils.copyProperties(param,req); |
|
|
|
userTodoList = processTaskService.getUserTodoList(req); |
|
|
|
} |
|
|
|
|
|
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
|
|
String fileName = null; |
|
|
@@ -733,6 +731,9 @@ public class TodoCenterManage { |
|
|
|
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); |
|
|
|
// 再查出项目关联的流程实例ID |
|
|
|
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); |
|
|
|
if (CollUtil.isEmpty(projectIdList)) { |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.in(ProjectInst::getProjectId, projectIdList) |
|
|
|
.orderByDesc(ProjectInst::getProjectId)); |
|
|
@@ -789,22 +790,26 @@ public class TodoCenterManage { |
|
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
|
BeanUtils.copyProperties(param, projectListReq); |
|
|
|
List<Project> projects = projectLibManage.projectList(projectListReq); |
|
|
|
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); |
|
|
|
// 再查出项目关联的流程实例ID |
|
|
|
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); |
|
|
|
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.in(ProjectInst::getProjectId, projectIdList) |
|
|
|
.orderByDesc(ProjectInst::getProjectId)); |
|
|
|
Map<String, Project> projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p-> projectsMap.get(p.getProjectId()))); |
|
|
|
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); |
|
|
|
|
|
|
|
// 查出用户工作流 |
|
|
|
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
req.setInstCodes(instCodes); |
|
|
|
List<ProcessTaskVo> userIdoList = processTaskService.getUserIdoList(req); |
|
|
|
|
|
|
|
List<ProcessTaskVo> userIdoList = Lists.newArrayList(); |
|
|
|
Map<String, Project> projectInfoMap = Maps.newHashMap(); |
|
|
|
if (CollUtil.isEmpty(projects)) { |
|
|
|
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); |
|
|
|
// 再查出项目关联的流程实例ID |
|
|
|
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.in(ProjectInst::getProjectId, projectIdList) |
|
|
|
.orderByDesc(ProjectInst::getProjectId)); |
|
|
|
projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p-> projectsMap.get(p.getProjectId()))); |
|
|
|
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); |
|
|
|
|
|
|
|
// 查出用户工作流 |
|
|
|
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
req.setInstCodes(instCodes); |
|
|
|
userIdoList = processTaskService.getUserIdoList(req); |
|
|
|
} |
|
|
|
|
|
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
|
|
|
|
|
@@ -852,6 +857,11 @@ public class TodoCenterManage { |
|
|
|
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); |
|
|
|
// 再查出项目关联的流程实例ID |
|
|
|
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
if (CollUtil.isEmpty(projectIdList)) { |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
|
|
|
|
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.in(ProjectInst::getProjectId, projectIdList) |
|
|
|
.orderByDesc(ProjectInst::getProjectId)); |
|
|
@@ -909,21 +919,26 @@ public class TodoCenterManage { |
|
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
|
BeanUtils.copyProperties(param, projectListReq); |
|
|
|
List<Project> projects = projectLibManage.projectList(projectListReq); |
|
|
|
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); |
|
|
|
// 再查出项目关联的流程实例ID |
|
|
|
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); |
|
|
|
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.in(ProjectInst::getProjectId, projectIdList) |
|
|
|
.orderByDesc(ProjectInst::getProjectId)); |
|
|
|
Map<String, Project> projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p-> projectsMap.get(p.getProjectId()))); |
|
|
|
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); |
|
|
|
|
|
|
|
// 查出用户工作流 |
|
|
|
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
req.setInstCodes(instCodes); |
|
|
|
List<ProcessInstanceVo> userSubmittedList = processInstanceService.getUserSubmittedList(req); |
|
|
|
List<ProcessInstanceVo> userSubmittedList = Lists.newArrayList(); |
|
|
|
Map<String, Project> projectInfoMap = Maps.newHashMap(); |
|
|
|
if (CollUtil.isEmpty(projects)) { |
|
|
|
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); |
|
|
|
// 再查出项目关联的流程实例ID |
|
|
|
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); |
|
|
|
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.in(ProjectInst::getProjectId, projectIdList) |
|
|
|
.orderByDesc(ProjectInst::getProjectId)); |
|
|
|
projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p-> projectsMap.get(p.getProjectId()))); |
|
|
|
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); |
|
|
|
|
|
|
|
// 查出用户工作流 |
|
|
|
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
req.setInstCodes(instCodes); |
|
|
|
userSubmittedList = processInstanceService.getUserSubmittedList(req); |
|
|
|
} |
|
|
|
|
|
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
|
|
|
|
|
@@ -968,6 +983,11 @@ public class TodoCenterManage { |
|
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
|
BeanUtils.copyProperties(param, projectListReq); |
|
|
|
List<Project> projects = projectLibManage.projectList(projectListReq); |
|
|
|
|
|
|
|
if (CollUtil.isEmpty(projects)) { |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
|
|
|
|
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); |
|
|
|
// 再查出项目关联的流程实例ID |
|
|
|
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); |
|
|
@@ -1029,22 +1049,29 @@ public class TodoCenterManage { |
|
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
|
BeanUtils.copyProperties(param, projectListReq); |
|
|
|
List<Project> projects = projectLibManage.projectList(projectListReq); |
|
|
|
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); |
|
|
|
// 再查出项目关联的流程实例ID |
|
|
|
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); |
|
|
|
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.in(ProjectInst::getProjectId, projectIdList) |
|
|
|
.orderByDesc(ProjectInst::getProjectId)); |
|
|
|
Map<String, Project> projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p-> projectsMap.get(p.getProjectId()))); |
|
|
|
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); |
|
|
|
|
|
|
|
// 分页查出用户工作流 |
|
|
|
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
req.setInstCodes(instCodes); |
|
|
|
BeanUtils.copyProperties(param,req); |
|
|
|
List<ProcessInstanceVo> ccMeList = processInstanceService.getCcMeList(req); |
|
|
|
List<ProcessInstanceVo> ccMeList = Lists.newArrayList(); |
|
|
|
Map<String, Project> projectInfoMap = Maps.newHashMap(); |
|
|
|
if (CollUtil.isEmpty(projects)) { |
|
|
|
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); |
|
|
|
// 再查出项目关联的流程实例ID |
|
|
|
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); |
|
|
|
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.in(ProjectInst::getProjectId, projectIdList) |
|
|
|
.orderByDesc(ProjectInst::getProjectId)); |
|
|
|
projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p-> projectsMap.get(p.getProjectId()))); |
|
|
|
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); |
|
|
|
|
|
|
|
// 分页查出用户工作流 |
|
|
|
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
req.setInstCodes(instCodes); |
|
|
|
BeanUtils.copyProperties(param,req); |
|
|
|
ccMeList = processInstanceService.getCcMeList(req); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
|
|
|
|
|
|