Commit 3720a648d78dc0bbc70f826eb4ec003058e54cb2
1 parent
fc2a8f13
refactor: 添加相关缺少字段
Showing
8 changed files
with
47 additions
and
31 deletions
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCCMyPageReqVO.java
| @@ -18,7 +18,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | @@ -18,7 +18,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | ||
| 18 | public class BpmProcessInstanceCCMyPageReqVO extends PageParam { | 18 | public class BpmProcessInstanceCCMyPageReqVO extends PageParam { |
| 19 | 19 | ||
| 20 | @Schema(description = "流程名称", example = "芋道") | 20 | @Schema(description = "流程名称", example = "芋道") |
| 21 | - private String name; | 21 | + private String processInstanceName; |
| 22 | 22 | ||
| 23 | @Schema(description = "流程编号", example = "123456768") | 23 | @Schema(description = "流程编号", example = "123456768") |
| 24 | private String processInstanceId; | 24 | private String processInstanceId; |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCCPageItemRespVO.java
| @@ -23,11 +23,7 @@ public class BpmProcessInstanceCCPageItemRespVO { | @@ -23,11 +23,7 @@ public class BpmProcessInstanceCCPageItemRespVO { | ||
| 23 | 23 | ||
| 24 | @Schema(description = "发起人别名") | 24 | @Schema(description = "发起人别名") |
| 25 | private String startUserNickname; | 25 | private String startUserNickname; |
| 26 | - /** | ||
| 27 | - * 表单名 | ||
| 28 | - */ | ||
| 29 | - @Schema(description = "流程实例的名字") | ||
| 30 | - private String name; | 26 | + |
| 31 | /** | 27 | /** |
| 32 | * 流程主键 | 28 | * 流程主键 |
| 33 | */ | 29 | */ |
| @@ -44,18 +40,16 @@ public class BpmProcessInstanceCCPageItemRespVO { | @@ -44,18 +40,16 @@ public class BpmProcessInstanceCCPageItemRespVO { | ||
| 44 | 40 | ||
| 45 | @Schema(description = "发起抄送的任务名称") | 41 | @Schema(description = "发起抄送的任务名称") |
| 46 | private String taskName; | 42 | private String taskName; |
| 47 | - /** | ||
| 48 | - * 用户主键 | ||
| 49 | - */ | ||
| 50 | - @Schema(description = "用户编号") | ||
| 51 | - private Long userId; | ||
| 52 | - | ||
| 53 | - @Schema(description = "用户别名") | ||
| 54 | - private String userNickname; | ||
| 55 | 43 | ||
| 56 | @Schema(description = "抄送原因") | 44 | @Schema(description = "抄送原因") |
| 57 | private String reason; | 45 | private String reason; |
| 58 | 46 | ||
| 47 | + @Schema(description = "抄送人") | ||
| 48 | + private String creator; | ||
| 49 | + | ||
| 50 | + @Schema(description = "抄送人别名") | ||
| 51 | + private String creatorNickname; | ||
| 52 | + | ||
| 59 | @Schema(description = "抄送时间") | 53 | @Schema(description = "抄送时间") |
| 60 | private LocalDateTime createTime; | 54 | private LocalDateTime createTime; |
| 61 | } | 55 | } |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/cc/BpmProcessInstanceCopyConvert.java
| @@ -35,15 +35,15 @@ public interface BpmProcessInstanceCopyConvert { | @@ -35,15 +35,15 @@ public interface BpmProcessInstanceCopyConvert { | ||
| 35 | , Map<Long/* userId */, String/* userName */> userMap | 35 | , Map<Long/* userId */, String/* userName */> userMap |
| 36 | ) { | 36 | ) { |
| 37 | List<BpmProcessInstanceCCPageItemRespVO> list = convertList(page.getList()); | 37 | List<BpmProcessInstanceCCPageItemRespVO> list = convertList(page.getList()); |
| 38 | - for (BpmProcessInstanceCCPageItemRespVO vo:list){ | ||
| 39 | - MapUtils.findAndThen(userMap, vo.getUserId(), | ||
| 40 | - userName -> vo.setUserNickname(userName)); | 38 | + for (BpmProcessInstanceCCPageItemRespVO vo : list) { |
| 39 | + MapUtils.findAndThen(userMap, Long.valueOf(vo.getCreator()), | ||
| 40 | + vo::setCreatorNickname); | ||
| 41 | MapUtils.findAndThen(userMap, vo.getStartUserId(), | 41 | MapUtils.findAndThen(userMap, vo.getStartUserId(), |
| 42 | - userName -> vo.setStartUserNickname(userName)); | 42 | + vo::setStartUserNickname); |
| 43 | MapUtils.findAndThen(taskMap, vo.getTaskId(), | 43 | MapUtils.findAndThen(taskMap, vo.getTaskId(), |
| 44 | - name -> vo.setTaskName(name)); | 44 | + vo::setTaskName); |
| 45 | MapUtils.findAndThen(processInstaneMap, vo.getProcessInstanceId(), | 45 | MapUtils.findAndThen(processInstaneMap, vo.getProcessInstanceId(), |
| 46 | - name -> vo.setProcessInstanceName(name)); | 46 | + vo::setProcessInstanceName); |
| 47 | } | 47 | } |
| 48 | return new PageResult<>(list, page.getTotal()); | 48 | return new PageResult<>(list, page.getTotal()); |
| 49 | } | 49 | } |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/cc/BpmProcessInstanceCopyDO.java
| @@ -33,7 +33,7 @@ public class BpmProcessInstanceCopyDO extends BaseDO { | @@ -33,7 +33,7 @@ public class BpmProcessInstanceCopyDO extends BaseDO { | ||
| 33 | /** | 33 | /** |
| 34 | * 流程名 | 34 | * 流程名 |
| 35 | */ | 35 | */ |
| 36 | - private String name; | 36 | + private String processInstanceName; |
| 37 | /** | 37 | /** |
| 38 | * 流程主键 | 38 | * 流程主键 |
| 39 | */ | 39 | */ |
| @@ -43,6 +43,12 @@ public class BpmProcessInstanceCopyDO extends BaseDO { | @@ -43,6 +43,12 @@ public class BpmProcessInstanceCopyDO extends BaseDO { | ||
| 43 | * 任务主键 | 43 | * 任务主键 |
| 44 | */ | 44 | */ |
| 45 | private String taskId; | 45 | private String taskId; |
| 46 | + | ||
| 47 | + /** | ||
| 48 | + * 任务名称 | ||
| 49 | + */ | ||
| 50 | + private String taskName; | ||
| 51 | + | ||
| 46 | /** | 52 | /** |
| 47 | * 用户主键 | 53 | * 用户主键 |
| 48 | */ | 54 | */ |
| @@ -53,4 +59,9 @@ public class BpmProcessInstanceCopyDO extends BaseDO { | @@ -53,4 +59,9 @@ public class BpmProcessInstanceCopyDO extends BaseDO { | ||
| 53 | */ | 59 | */ |
| 54 | private String reason; | 60 | private String reason; |
| 55 | 61 | ||
| 62 | + /** | ||
| 63 | + * 流程分类 | ||
| 64 | + */ | ||
| 65 | + private String processDefinitionCategory; | ||
| 66 | + | ||
| 56 | } | 67 | } |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/cc/BpmProcessInstanceCopyMapper.java
| @@ -5,7 +5,6 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | @@ -5,7 +5,6 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||
| 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 6 | import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceCCMyPageReqVO; | 6 | import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceCCMyPageReqVO; |
| 7 | import cn.iocoder.yudao.module.bpm.dal.dataobject.cc.BpmProcessInstanceCopyDO; | 7 | import cn.iocoder.yudao.module.bpm.dal.dataobject.cc.BpmProcessInstanceCopyDO; |
| 8 | -import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO; | ||
| 9 | import org.apache.ibatis.annotations.Mapper; | 8 | import org.apache.ibatis.annotations.Mapper; |
| 10 | 9 | ||
| 11 | @Mapper | 10 | @Mapper |
| @@ -14,7 +13,7 @@ public interface BpmProcessInstanceCopyMapper extends BaseMapperX<BpmProcessInst | @@ -14,7 +13,7 @@ public interface BpmProcessInstanceCopyMapper extends BaseMapperX<BpmProcessInst | ||
| 14 | return selectPage(reqVO, new LambdaQueryWrapperX<BpmProcessInstanceCopyDO>() | 13 | return selectPage(reqVO, new LambdaQueryWrapperX<BpmProcessInstanceCopyDO>() |
| 15 | .eqIfPresent(BpmProcessInstanceCopyDO::getUserId, loginUserId) | 14 | .eqIfPresent(BpmProcessInstanceCopyDO::getUserId, loginUserId) |
| 16 | .eqIfPresent(BpmProcessInstanceCopyDO::getProcessInstanceId, reqVO.getProcessInstanceId()) | 15 | .eqIfPresent(BpmProcessInstanceCopyDO::getProcessInstanceId, reqVO.getProcessInstanceId()) |
| 17 | - .likeIfPresent(BpmProcessInstanceCopyDO::getName, reqVO.getName()) | 16 | + .likeIfPresent(BpmProcessInstanceCopyDO::getProcessInstanceName, reqVO.getProcessInstanceName()) |
| 18 | .betweenIfPresent(BpmProcessInstanceCopyDO::getCreateTime, reqVO.getCreateTime()) | 17 | .betweenIfPresent(BpmProcessInstanceCopyDO::getCreateTime, reqVO.getCreateTime()) |
| 19 | .orderByDesc(BpmProcessInstanceCopyDO::getId)); | 18 | .orderByDesc(BpmProcessInstanceCopyDO::getId)); |
| 20 | } | 19 | } |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/cc/BpmProcessInstanceCopyServiceImpl.java
| @@ -18,6 +18,7 @@ import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; | @@ -18,6 +18,7 @@ import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; | ||
| 18 | import lombok.extern.slf4j.Slf4j; | 18 | import lombok.extern.slf4j.Slf4j; |
| 19 | import org.flowable.engine.RuntimeService; | 19 | import org.flowable.engine.RuntimeService; |
| 20 | import org.flowable.engine.delegate.DelegateExecution; | 20 | import org.flowable.engine.delegate.DelegateExecution; |
| 21 | +import org.flowable.engine.repository.ProcessDefinition; | ||
| 21 | import org.flowable.engine.runtime.ProcessInstance; | 22 | import org.flowable.engine.runtime.ProcessInstance; |
| 22 | import org.springframework.context.annotation.Lazy; | 23 | import org.springframework.context.annotation.Lazy; |
| 23 | import org.springframework.stereotype.Service; | 24 | import org.springframework.stereotype.Service; |
| @@ -75,6 +76,7 @@ public class BpmProcessInstanceCopyServiceImpl implements BpmProcessInstanceCopy | @@ -75,6 +76,7 @@ public class BpmProcessInstanceCopyServiceImpl implements BpmProcessInstanceCopy | ||
| 75 | // 调用 | 76 | // 调用 |
| 76 | // 设置任务id | 77 | // 设置任务id |
| 77 | copyDO.setTaskId(sourceInfo.getTaskId()); | 78 | copyDO.setTaskId(sourceInfo.getTaskId()); |
| 79 | + copyDO.setTaskName(FlowableUtils.getTaskNameByTaskId(sourceInfo.getTaskId())); | ||
| 78 | copyDO.setProcessInstanceId(sourceInfo.getProcessInstanceId()); | 80 | copyDO.setProcessInstanceId(sourceInfo.getProcessInstanceId()); |
| 79 | ProcessInstance processInstance = runtimeService.createProcessInstanceQuery() | 81 | ProcessInstance processInstance = runtimeService.createProcessInstanceQuery() |
| 80 | .processInstanceId(sourceInfo.getProcessInstanceId()) | 82 | .processInstanceId(sourceInfo.getProcessInstanceId()) |
| @@ -84,7 +86,9 @@ public class BpmProcessInstanceCopyServiceImpl implements BpmProcessInstanceCopy | @@ -84,7 +86,9 @@ public class BpmProcessInstanceCopyServiceImpl implements BpmProcessInstanceCopy | ||
| 84 | return false; | 86 | return false; |
| 85 | } | 87 | } |
| 86 | copyDO.setStartUserId(FlowableUtils.getStartUserIdFromProcessInstance(processInstance)); | 88 | copyDO.setStartUserId(FlowableUtils.getStartUserIdFromProcessInstance(processInstance)); |
| 87 | - copyDO.setName(FlowableUtils.getFlowName(processInstance.getProcessDefinitionId())); | 89 | + copyDO.setProcessInstanceName(processInstance.getName()); |
| 90 | + ProcessDefinition processDefinition = FlowableUtils.getProcessDefinition(processInstance.getProcessDefinitionId()); | ||
| 91 | + copyDO.setProcessDefinitionCategory(processDefinition.getCategory()); | ||
| 88 | copyDO.setReason(sourceInfo.getReason()); | 92 | copyDO.setReason(sourceInfo.getReason()); |
| 89 | copyDO.setCreator(sourceInfo.getCreator()); | 93 | copyDO.setCreator(sourceInfo.getCreator()); |
| 90 | copyDO.setCreateTime(LocalDateTime.now()); | 94 | copyDO.setCreateTime(LocalDateTime.now()); |
| @@ -131,7 +135,6 @@ public class BpmProcessInstanceCopyServiceImpl implements BpmProcessInstanceCopy | @@ -131,7 +135,6 @@ public class BpmProcessInstanceCopyServiceImpl implements BpmProcessInstanceCopy | ||
| 131 | userIds.add(doItem.getStartUserId()); | 135 | userIds.add(doItem.getStartUserId()); |
| 132 | Long userId = Long.valueOf(doItem.getCreator()); | 136 | Long userId = Long.valueOf(doItem.getCreator()); |
| 133 | userIds.add(userId); | 137 | userIds.add(userId); |
| 134 | - doItem.setUserId(userId); | ||
| 135 | } | 138 | } |
| 136 | 139 | ||
| 137 | Map<String, String> taskNameByTaskIds = FlowableUtils.getTaskNameByTaskIds(taskIds); | 140 | Map<String, String> taskNameByTaskIds = FlowableUtils.getTaskNameByTaskIds(taskIds); |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/cc/BpmProcessInstanceCopyVO.java
| @@ -31,11 +31,7 @@ public class BpmProcessInstanceCopyVO { | @@ -31,11 +31,7 @@ public class BpmProcessInstanceCopyVO { | ||
| 31 | 31 | ||
| 32 | @Schema(description = "发起人别名") | 32 | @Schema(description = "发起人别名") |
| 33 | private String startUserNickname; | 33 | private String startUserNickname; |
| 34 | - /** | ||
| 35 | - * 表单名 | ||
| 36 | - */ | ||
| 37 | - @Schema(description = "流程实例的名字") | ||
| 38 | - private String name; | 34 | + |
| 39 | /** | 35 | /** |
| 40 | * 流程主键 | 36 | * 流程主键 |
| 41 | */ | 37 | */ |
| @@ -51,6 +47,8 @@ public class BpmProcessInstanceCopyVO { | @@ -51,6 +47,8 @@ public class BpmProcessInstanceCopyVO { | ||
| 51 | @Schema(description = "发起抄送的任务编号") | 47 | @Schema(description = "发起抄送的任务编号") |
| 52 | private String taskId; | 48 | private String taskId; |
| 53 | 49 | ||
| 50 | + @Schema(description = "发起抄送的任务名称") | ||
| 51 | + private String taskName; | ||
| 54 | /** | 52 | /** |
| 55 | * 用户主键 | 53 | * 用户主键 |
| 56 | */ | 54 | */ |
| @@ -60,6 +58,12 @@ public class BpmProcessInstanceCopyVO { | @@ -60,6 +58,12 @@ public class BpmProcessInstanceCopyVO { | ||
| 60 | @Schema(description = "用户别名") | 58 | @Schema(description = "用户别名") |
| 61 | private Long userNickname; | 59 | private Long userNickname; |
| 62 | 60 | ||
| 61 | + @Schema(description = "抄送原因") | ||
| 62 | + private String reason; | ||
| 63 | + | ||
| 64 | + @Schema(description = "抄送人") | ||
| 65 | + private String creator; | ||
| 66 | + | ||
| 63 | @Schema(description = "抄送时间") | 67 | @Schema(description = "抄送时间") |
| 64 | private LocalDateTime createTime; | 68 | private LocalDateTime createTime; |
| 65 | } | 69 | } |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/util/FlowableUtils.java
| @@ -31,12 +31,17 @@ public class FlowableUtils { | @@ -31,12 +31,17 @@ public class FlowableUtils { | ||
| 31 | * @param processDefinitionId | 31 | * @param processDefinitionId |
| 32 | * @return | 32 | * @return |
| 33 | */ | 33 | */ |
| 34 | - public static String getFlowName(String processDefinitionId) { | 34 | + public static String getProcessDefinitionName(String processDefinitionId) { |
| 35 | RepositoryService repositoryService = SpringUtil.getBean(RepositoryService.class); | 35 | RepositoryService repositoryService = SpringUtil.getBean(RepositoryService.class); |
| 36 | ProcessDefinition processDefinition = repositoryService.getProcessDefinition(processDefinitionId); | 36 | ProcessDefinition processDefinition = repositoryService.getProcessDefinition(processDefinitionId); |
| 37 | return processDefinition.getName(); | 37 | return processDefinition.getName(); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | + public static ProcessDefinition getProcessDefinition(String processDefinitionId) { | ||
| 41 | + RepositoryService repositoryService = SpringUtil.getBean(RepositoryService.class); | ||
| 42 | + return repositoryService.getProcessDefinition(processDefinitionId); | ||
| 43 | + } | ||
| 44 | + | ||
| 40 | /** | 45 | /** |
| 41 | * 获取节点数据 | 46 | * 获取节点数据 |
| 42 | * | 47 | * |