From ee3f10a1c3d1712d5b79fcd899bf950660216ba2 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Fri, 9 Jun 2023 13:33:50 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=B9=B4=E5=BA=A6=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=BA=93=E7=BC=96=E8=BE=91=E8=A1=A8=E5=AF=BC=E5=87=BA=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java | 1 + 1 file changed, 1 insertion(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index 3e8e99d..069841d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -373,6 +373,7 @@ public class AnnualPlanLibManage { fileName = "丽水市" + year + "年数字化项目年度计划增补库编辑表"; } LambdaQueryWrapper query = ProjectHelper.projectQuery(param); + query.eq(Project::getNewest,Boolean.TRUE); query.eq(Project::getIsTemporaryAugment, isTemporaryAugment); query.orderByDesc(Project::getAnnualPlanAddTime); query.in(Project::getStatus, CollUtils.fieldList(ANNUAL_PLAN_LIST_STATUS, ProjectStatusEnum::getCode)); From 3f5e12c13586ad7b940458ce2ef75908a2cf2f88 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Fri, 9 Jun 2023 16:10:07 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=BE=85=E6=88=91=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=AF=BC=E5=87=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/todocenter/manage/TodoCenterManage.java | 66 ++++++++++------------ .../model/req/ToBeProcessedExportReq.java | 3 + 2 files changed, 33 insertions(+), 36 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index 99c369c..8b2a769 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -257,49 +257,43 @@ public class TodoCenterManage { * @since 2023/02/01 */ public void exportTodoList(HttpServletResponse response, ToBeProcessedExportReq param) { - // 获取登录用户ID - Long userId = LoginUserUtil.getUserId(); - // 获取用户全量用户信息 - UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); - // 获取登录用户浙政钉code - String employeeCode = userFullInfo.getEmployeeCode(); + String employeeCode = param.getEmployeeCode(); + if (StringUtils.isBlank(employeeCode)) { + // 获取登录用户ID + Long userId = LoginUserUtil.getUserId(); + // 获取用户全量用户信息 + UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); + // 获取登录用户浙政钉code + employeeCode = userFullInfo.getEmployeeCode(); + } // 查出项目库项目 ProjectListReq projectListReq = new ProjectListReq(); BeanUtils.copyProperties(param, projectListReq); List projects = projectLibManage.projectList(projectListReq); - List userTodoList = Lists.newArrayList(); - Map projectInfoMap = Maps.newHashMap(); - if (CollUtil.isNotEmpty(projects)) { - Map projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); - // 再查出项目关联的流程实例ID - List projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); - List 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 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)); - req.setEmployeeCode(employeeCode); - BeanUtils.copyProperties(param,req); - - //有待办节点的(不包含退回) - List todoList = processTaskService.getUserTodoList(req); - //有退回待办的 - List backList = processTaskService.getBackTodoList(req); - //合并 并且排序 - userTodoList = Stream.concat(todoList.stream(),backList.stream()) - .filter(Objects::nonNull) - .sorted(Comparator.comparing(ProcessTaskVo::getTaskCreateTime) - .reversed()) - .collect(Collectors.toList()); - } + Map projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); + // 再查出项目关联的流程实例ID + List projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); + List projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) + .in(ProjectInst::getProjectId, projectIdList).orderByDesc(ProjectInst::getProjectId)); + Map projectInfoMap = projectInstList.stream() + .collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId()))); + List instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); + + // 查出用户工作流 + TodoCenterListReqDTO req = new TodoCenterListReqDTO(); + req.setInstCodes(instCodes); + req.setProcessDefId(param.getProcessDefId()); + req.setEmployeeCode(employeeCode); + // 有待办节点的(不包含退回) + List todoList = processTaskService.getUserTodoList(req); + // 有退回待办的 + List backList = processTaskService.getBackTodoList(req); + // 合并 并且排序 + List userTodoList = Stream.concat(todoList.stream(), backList.stream()).filter(Objects::nonNull) + .sorted(Comparator.comparing(ProcessTaskVo::getTaskCreateTime).reversed()).collect(Collectors.toList()); ExcelExportWriter excelExportWriter = new ExcelExportWriter(); String fileName = null; if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedExportReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedExportReq.java index 7e1eb1e..e19d74c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedExportReq.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedExportReq.java @@ -20,6 +20,9 @@ import lombok.NoArgsConstructor; @AllArgsConstructor public class ToBeProcessedExportReq extends ToBeProcessedReq { + @ApiModelProperty("登录人员工号") + private String employeeCode; + @ApiModelProperty("导出选项") private List exportOptionList; From 3bb8ec752d6dfa050b5a04bc482c1409eb092a23 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Fri, 9 Jun 2023 16:22:21 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=BE=85=E6=88=91=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=AF=BC=E5=87=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/todocenter/manage/TodoCenterManage.java | 61 ++++++++++++---------- .../model/req/ToBeProcessedExportReq.java | 3 -- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index 8b2a769..d14aaae 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -10,6 +10,7 @@ import java.util.stream.Stream; import javax.servlet.http.HttpServletResponse; +import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.ObjectUtil; import com.ningdatech.basic.exception.BizException; import com.ningdatech.pmapi.projectlib.enumeration.*; @@ -257,43 +258,45 @@ public class TodoCenterManage { * @since 2023/02/01 */ public void exportTodoList(HttpServletResponse response, ToBeProcessedExportReq param) { - String employeeCode = param.getEmployeeCode(); - if (StringUtils.isBlank(employeeCode)) { - // 获取登录用户ID - Long userId = LoginUserUtil.getUserId(); - // 获取用户全量用户信息 - UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); - // 获取登录用户浙政钉code - employeeCode = userFullInfo.getEmployeeCode(); - } + // 获取登录用户ID + Long userId = LoginUserUtil.getUserId(); + // 获取用户全量用户信息 + UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); + // 获取登录用户浙政钉code + String employeeCode = userFullInfo.getEmployeeCode(); + + List userTodoList = Lists.newArrayList(); + Map projectInfoMap = MapUtil.newHashMap(); // 查出项目库项目 ProjectListReq projectListReq = new ProjectListReq(); BeanUtils.copyProperties(param, projectListReq); List projects = projectLibManage.projectList(projectListReq); + if (CollUtil.isNotEmpty(projects)) { + Map projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); + // 再查出项目关联的流程实例ID + List projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); + List 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 instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); - Map projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); - // 再查出项目关联的流程实例ID - List projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); - List projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) - .in(ProjectInst::getProjectId, projectIdList).orderByDesc(ProjectInst::getProjectId)); - Map projectInfoMap = projectInstList.stream() - .collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId()))); - List instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); - // 查出用户工作流 - TodoCenterListReqDTO req = new TodoCenterListReqDTO(); - req.setInstCodes(instCodes); - req.setProcessDefId(param.getProcessDefId()); - req.setEmployeeCode(employeeCode); + // 查出用户工作流 + TodoCenterListReqDTO req = new TodoCenterListReqDTO(); + req.setInstCodes(instCodes); + req.setProcessDefId(param.getProcessDefId()); + req.setEmployeeCode(employeeCode); - // 有待办节点的(不包含退回) - List todoList = processTaskService.getUserTodoList(req); - // 有退回待办的 - List backList = processTaskService.getBackTodoList(req); - // 合并 并且排序 - List userTodoList = Stream.concat(todoList.stream(), backList.stream()).filter(Objects::nonNull) - .sorted(Comparator.comparing(ProcessTaskVo::getTaskCreateTime).reversed()).collect(Collectors.toList()); + // 有待办节点的(不包含退回) + List todoList = processTaskService.getUserTodoList(req); + // 有退回待办的 + List backList = processTaskService.getBackTodoList(req); + // 合并 并且排序 + userTodoList = Stream.concat(todoList.stream(), backList.stream()).filter(Objects::nonNull) + .sorted(Comparator.comparing(ProcessTaskVo::getTaskCreateTime).reversed()).collect(Collectors.toList()); + } ExcelExportWriter excelExportWriter = new ExcelExportWriter(); String fileName = null; if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedExportReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedExportReq.java index e19d74c..7e1eb1e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedExportReq.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedExportReq.java @@ -20,9 +20,6 @@ import lombok.NoArgsConstructor; @AllArgsConstructor public class ToBeProcessedExportReq extends ToBeProcessedReq { - @ApiModelProperty("登录人员工号") - private String employeeCode; - @ApiModelProperty("导出选项") private List exportOptionList;