From 50fb4a56b9a65b17703c50448af7d895c9433528 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Wed, 8 Mar 2023 12:54:14 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=BA=93=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=A4=84=E7=90=86=E8=AF=A6=E6=83=85=E7=94=A8=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=A3=85=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handle/ConstructionPlanReviewHandle.java | 11 ++++- .../projectlib/handle/DeptUnitedReviewHandle.java | 9 +++- .../handle/PreliminaryPreviewHandle.java | 11 ++++- .../handle/ProjectFinalInspectionHandle.java | 11 ++++- .../projectlib/handle/UnitInnerAuditHandle.java | 23 +++++++++- .../pmapi/todocenter/manage/TodoCenterManage.java | 27 ++--------- .../todocenter/model/vo/ResToBeProcessedVO.java | 4 +- .../pmapi/todocenter/utils/BuildUserUtils.java | 53 ++++++++++++++++++++++ 8 files changed, 115 insertions(+), 34 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/todocenter/utils/BuildUserUtils.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java index b8340d0..08edae5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java @@ -6,6 +6,7 @@ import java.util.Objects; import com.google.common.collect.Lists; import com.ningdatech.basic.util.NdDateUtils; +import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; import com.wflow.workflow.bean.process.ProgressNode; import com.wflow.workflow.bean.vo.ProcessDetailVO; import com.wflow.workflow.enums.StepStatusEnum; @@ -33,10 +34,12 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle private final IProjectInstService projectInstService; private final ProcessInstanceService processInstanceService; + private final BuildUserUtils buildUserUtils; - public ConstructionPlanReviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService){ + public ConstructionPlanReviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils){ this.projectInstService = projectInstService; this.processInstanceService = processInstanceService; + this.buildUserUtils = buildUserUtils; } @Override @@ -66,11 +69,15 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle } else if (ProcessStatusEnum.APPROVED.getDesc().equals(status)) { processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); } + + // 装配节点审核人员信息 + List progressInfo = instanceDetail.getProgressInfo(); + buildUserUtils.buildUserByProcessInfo(progressInfo); + // 根据流程处理详情获取流程完成时间 if(StepStatusEnum.contains(processDetailVO.getStepStatus(), Lists.newArrayList(StepStatusEnum.REJECTED, StepStatusEnum.COMPLETED))){ - List progressInfo = instanceDetail.getProgressInfo(); ProgressNode progressNode = progressInfo.get(progressInfo.size() - 1); LocalDateTime finishTime = NdDateUtils.date2LocalDateTime(progressNode.getFinishTime()); processDetailVO.setFinishTime(finishTime); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java index 0c43ef6..587ee56 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java @@ -6,6 +6,7 @@ import java.util.Objects; import com.google.common.collect.Lists; import com.ningdatech.basic.util.NdDateUtils; +import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; import com.wflow.workflow.bean.process.ProgressNode; import com.wflow.workflow.bean.vo.ProcessDetailVO; import com.wflow.workflow.enums.StepStatusEnum; @@ -33,10 +34,12 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { private final IProjectInstService projectInstService; private final ProcessInstanceService processInstanceService; + private final BuildUserUtils buildUserUtils; - public DeptUnitedReviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService){ + public DeptUnitedReviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils){ this.projectInstService = projectInstService; this.processInstanceService = processInstanceService; + this.buildUserUtils = buildUserUtils; } @Override @@ -64,11 +67,13 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { } else if (ProcessStatusEnum.APPROVED.getDesc().equals(status)) { processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); } + // 装配节点审核人员信息 + List progressInfo = instanceDetail.getProgressInfo(); + buildUserUtils.buildUserByProcessInfo(progressInfo); // 根据流程处理详情获取流程完成时间 if(StepStatusEnum.contains(processDetailVO.getStepStatus(), Lists.newArrayList(StepStatusEnum.REJECTED, StepStatusEnum.COMPLETED))){ - List progressInfo = instanceDetail.getProgressInfo(); ProgressNode progressNode = progressInfo.get(progressInfo.size() - 1); LocalDateTime finishTime = NdDateUtils.date2LocalDateTime(progressNode.getFinishTime()); processDetailVO.setFinishTime(finishTime); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java index 15e4b72..4b985a4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java @@ -7,6 +7,7 @@ import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; import com.ningdatech.pmapi.projectlib.service.IProjectInstService; +import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; import com.wflow.workflow.bean.process.ProgressNode; import com.wflow.workflow.bean.vo.ProcessDetailVO; import com.wflow.workflow.bean.vo.ProcessProgressVo; @@ -32,10 +33,12 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle { private final IProjectInstService projectInstService; private final ProcessInstanceService processInstanceService; + private final BuildUserUtils buildUserUtils; - public PreliminaryPreviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService) { + public PreliminaryPreviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils) { this.projectInstService = projectInstService; this.processInstanceService = processInstanceService; + this.buildUserUtils = buildUserUtils; } @Override @@ -63,11 +66,15 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle { } else if (ProcessStatusEnum.APPROVED.getDesc().equals(status)) { processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); } + + // 装配节点审核人员信息 + List progressInfo = instanceDetail.getProgressInfo(); + buildUserUtils.buildUserByProcessInfo(progressInfo); + // 根据流程处理详情获取流程完成时间 if(StepStatusEnum.contains(processDetailVO.getStepStatus(), Lists.newArrayList(StepStatusEnum.REJECTED, StepStatusEnum.COMPLETED))){ - List progressInfo = instanceDetail.getProgressInfo(); ProgressNode progressNode = progressInfo.get(progressInfo.size() - 1); LocalDateTime finishTime = NdDateUtils.date2LocalDateTime(progressNode.getFinishTime()); processDetailVO.setFinishTime(finishTime); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java index 69a0d2d..72c8e8c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java @@ -8,6 +8,7 @@ import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; import com.ningdatech.pmapi.projectlib.service.IProjectInstService; +import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; import com.wflow.workflow.bean.process.ProgressNode; import com.wflow.workflow.bean.vo.ProcessDetailVO; import com.wflow.workflow.bean.vo.ProcessProgressVo; @@ -31,10 +32,12 @@ import com.ningdatech.pmapi.common.constant.CommonConst; public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle { private final IProjectInstService projectInstService; private final ProcessInstanceService processInstanceService; + private final BuildUserUtils buildUserUtils; - public ProjectFinalInspectionHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService){ + public ProjectFinalInspectionHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils){ this.projectInstService = projectInstService; this.processInstanceService = processInstanceService; + this.buildUserUtils = buildUserUtils; } @Override @@ -66,11 +69,15 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle } else if (ProcessStatusEnum.APPROVED.getDesc().equals(status)) { processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); } + + // 装配节点审核人员信息 + List progressInfo = instanceDetail.getProgressInfo(); + buildUserUtils.buildUserByProcessInfo(progressInfo); + // 根据流程处理详情获取流程完成时间 if(StepStatusEnum.contains(processDetailVO.getStepStatus(), Lists.newArrayList(StepStatusEnum.REJECTED, StepStatusEnum.COMPLETED))){ - List progressInfo = instanceDetail.getProgressInfo(); ProgressNode progressNode = progressInfo.get(progressInfo.size() - 1); LocalDateTime finishTime = NdDateUtils.date2LocalDateTime(progressNode.getFinishTime()); processDetailVO.setFinishTime(finishTime); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java index 286e255..c22f36d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java @@ -2,7 +2,9 @@ package com.ningdatech.pmapi.projectlib.handle; import java.time.LocalDateTime; import java.util.List; +import java.util.Map; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; import com.ningdatech.basic.util.NdDateUtils; @@ -11,6 +13,8 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; import com.ningdatech.pmapi.projectlib.service.IProjectInstService; import com.ningdatech.pmapi.common.constant.CommonConst; +import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; +import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; import com.wflow.workflow.bean.process.ProgressNode; import com.wflow.workflow.bean.vo.ProcessDetailVO; import com.wflow.workflow.bean.vo.ProcessProgressVo; @@ -33,10 +37,12 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle { private final IProjectInstService projectInstService; private final ProcessInstanceService processInstanceService; + private final BuildUserUtils buildUserUtils; - public UnitInnerAuditHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService){ + public UnitInnerAuditHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils){ this.projectInstService = projectInstService; this.processInstanceService = processInstanceService; + this.buildUserUtils = buildUserUtils; } @Override @@ -59,11 +65,15 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle { } else if (ProcessStatusEnum.APPROVED.getDesc().equals(status)) { processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); } + + // 装配节点审核人员信息 + List progressInfo = instanceDetail.getProgressInfo(); + buildUserUtils.buildUserByProcessInfo(progressInfo); + // 根据流程处理详情获取流程完成时间 if(StepStatusEnum.contains(processDetailVO.getStepStatus(), Lists.newArrayList(StepStatusEnum.REJECTED, StepStatusEnum.COMPLETED))){ - List progressInfo = instanceDetail.getProgressInfo(); ProgressNode progressNode = progressInfo.get(progressInfo.size() - 1); LocalDateTime finishTime = NdDateUtils.date2LocalDateTime(progressNode.getFinishTime()); processDetailVO.setFinishTime(finishTime); @@ -72,4 +82,13 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle { processDetailVO.setProcessName(CommonConst.UNIT_INNER_AUDIT); processSchedule.add(processDetailVO); } + + private void buildUser(List progressInfo, Map userMap) { + for (ProgressNode progressNode : progressInfo) { + progressNode.setUser(userMap.get(progressNode.getUserId())); + if (CollUtil.isNotEmpty(progressNode.getChildren())) { + buildUser(progressNode.getChildren(), userMap); + } + } + } } 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 a37a910..488232c 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 @@ -39,6 +39,7 @@ import com.ningdatech.pmapi.todocenter.model.req.ProcessDetailReq; import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedExportReq; import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedReq; import com.ningdatech.pmapi.todocenter.model.vo.ResToBeProcessedVO; +import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; import com.ningdatech.pmapi.user.entity.UserInfo; import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; import com.ningdatech.pmapi.user.service.IUserInfoService; @@ -100,6 +101,7 @@ public class TodoCenterManage { private final DefaultDeclaredProjectManage defaultDeclaredProjectManage; private final IProjectApplicationService projectApplicationService; private final UserInfoHelper userInfoHelper; + private final BuildUserUtils buildUserUtils; /** @@ -589,21 +591,10 @@ public class TodoCenterManage { ProcessProgressVo progressInstanceDetail = processInstanceService.getProgressInstanceDetail(nodeId, instanceId); List progressInfo = progressInstanceDetail.getProgressInfo(); + buildUserUtils.buildUserByProcessInfo(progressInfo); - Set userSet = Sets.newHashSet(); - progressInfo.forEach(node -> { - if (CollUtil.isNotEmpty(node.getChildren())) { - for (ProgressNode innerNode : node.getChildren()) { - userSet.add(innerNode.getUserId()); - } - } else { - userSet.add(node.getUserId()); - } - }); - Map userMap = userInfoService.getUserMapByIds(userSet); - - // 装配节点审核人员信息 - buildUser(progressInfo, userMap); + //// 装配节点审核人员信息 + //buildUser(progressInfo, userMap); ProcessProgressDetailVo res = new ProcessProgressDetailVo(); res.setProcessProgressVo(progressInstanceDetail); @@ -612,14 +603,6 @@ public class TodoCenterManage { return res; } - private void buildUser(List progressInfo, Map userMap) { - for (ProgressNode progressNode : progressInfo) { - progressNode.setUser(userMap.get(progressNode.getUserId())); - if (CollUtil.isNotEmpty(progressNode.getChildren())) { - buildUser(progressNode.getChildren(), userMap); - } - } - } /** * 待办中心我已处理项目列表查询 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java index b1dc02b..928baa0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java @@ -39,13 +39,13 @@ public class ResToBeProcessedVO implements Serializable { private String projectName; @ApiModelProperty("建设单位名称") - private String buildOrgName; + private String buildOrg; @ApiModelProperty("建设单位统一社会信用代码") private String buildOrgCode; @ApiModelProperty("申报金额") - private BigDecimal declareAmount; + private BigDecimal declaredAmount; @ApiModelProperty("预算年度") private Integer projectYear; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/utils/BuildUserUtils.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/utils/BuildUserUtils.java new file mode 100644 index 0000000..b7dd4a0 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/utils/BuildUserUtils.java @@ -0,0 +1,53 @@ +package com.ningdatech.pmapi.todocenter.utils; + +import cn.hutool.core.collection.CollUtil; +import com.google.common.collect.Sets; +import com.ningdatech.pmapi.user.service.IUserInfoService; +import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; +import com.wflow.workflow.bean.process.ProgressNode; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 装配节点用户信息工具类 + * + * @author CMM + * @since 2023/03/08 11:52 + */ +@Slf4j +@RequiredArgsConstructor +@Component +public class BuildUserUtils { + + private final IUserInfoService userInfoService; + + public void buildUserByProcessInfo(List progressInfo) { + Set userSet = Sets.newHashSet(); + progressInfo.forEach(node -> { + if (CollUtil.isNotEmpty(node.getChildren())) { + for (ProgressNode innerNode : node.getChildren()) { + userSet.add(innerNode.getUserId()); + } + } else { + userSet.add(node.getUserId()); + } + }); + Map userMap = userInfoService.getUserMapByIds(userSet); + buildUser(progressInfo,userMap); + } + private void buildUser(List progressInfo, Map userMap) { + for (ProgressNode progressNode : progressInfo) { + progressNode.setUser(userMap.get(progressNode.getUserId())); + if (CollUtil.isNotEmpty(progressNode.getChildren())) { + buildUser(progressNode.getChildren(), userMap); + } + } + } + + +}