mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-19 03:30:06 +08:00
【代码评审】工作流:获得审批的进展
This commit is contained in:
parent
f03e26bc86
commit
4d15396e36
@ -13,6 +13,7 @@ import lombok.Getter;
|
|||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum BpmProcessNodeProgressEnum {
|
public enum BpmProcessNodeProgressEnum {
|
||||||
|
|
||||||
// 0 未开始
|
// 0 未开始
|
||||||
NOT_START(0,"未开始"),
|
NOT_START(0,"未开始"),
|
||||||
// 1 ~ 20 进行中
|
// 1 ~ 20 进行中
|
||||||
|
@ -47,7 +47,6 @@ public class BpmProcessInstanceController {
|
|||||||
private BpmProcessInstanceService processInstanceService;
|
private BpmProcessInstanceService processInstanceService;
|
||||||
@Resource
|
@Resource
|
||||||
private BpmTaskService taskService;
|
private BpmTaskService taskService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private BpmProcessDefinitionService processDefinitionService;
|
private BpmProcessDefinitionService processDefinitionService;
|
||||||
@Resource
|
@Resource
|
||||||
|
@ -22,17 +22,24 @@ public class BpmProcessInstanceProgressRespVO {
|
|||||||
|
|
||||||
@Schema(description = "节点编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "StartUserNode")
|
@Schema(description = "节点编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "StartUserNode")
|
||||||
private String id; // Bpmn XML 节点 Id
|
private String id; // Bpmn XML 节点 Id
|
||||||
|
|
||||||
@Schema(description = "节点名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "发起人")
|
@Schema(description = "节点名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "发起人")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "节点展示内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "指定成员: 芋道源码")
|
||||||
private String displayText;
|
private String displayText;
|
||||||
|
|
||||||
@Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
private Integer nodeType; // 参见 BpmSimpleModelNodeType 枚举
|
private Integer nodeType; // 参见 BpmSimpleModelNodeType 枚举
|
||||||
|
|
||||||
@Schema(description = "节点状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
|
@Schema(description = "节点状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
|
||||||
private Integer status; // 参见 BpmProcessNodeProgressEnum 枚举
|
private Integer status; // 参见 BpmProcessNodeProgressEnum 枚举
|
||||||
|
|
||||||
@Schema(description = "节点的开始时间")
|
@Schema(description = "节点的开始时间")
|
||||||
private LocalDateTime startTime;
|
private LocalDateTime startTime;
|
||||||
@Schema(description = "节点的结束时间")
|
@Schema(description = "节点的结束时间")
|
||||||
private LocalDateTime endTime;
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
@Schema(description = "用户列表")
|
@Schema(description = "用户列表")
|
||||||
private List<User> userList;
|
private List<User> userList;
|
||||||
@Schema(description = "分支节点")
|
@Schema(description = "分支节点")
|
||||||
@ -48,13 +55,19 @@ public class BpmProcessInstanceProgressRespVO {
|
|||||||
|
|
||||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
private String nickname;
|
private String nickname;
|
||||||
|
|
||||||
@Schema(description = "用户头像", example = "芋艿")
|
@Schema(description = "用户头像", example = "芋艿")
|
||||||
private String avatar;
|
private String avatar;
|
||||||
|
|
||||||
@Schema(description = "是否已处理", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
@Schema(description = "是否已处理", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||||
private Boolean processed;
|
private Boolean processed;
|
||||||
|
|
||||||
@Schema(description = "用户任务的处理状态", example = "1")
|
@Schema(description = "用户任务的处理状态", example = "1")
|
||||||
private Integer userTaskStatus;
|
private Integer userTaskStatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,9 @@ public interface BpmProcessInstanceCopyMapper extends BaseMapperX<BpmProcessInst
|
|||||||
.orderByDesc(BpmProcessInstanceCopyDO::getId));
|
.orderByDesc(BpmProcessInstanceCopyDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<BpmProcessInstanceCopyDO> selectListByProcInstIdAndActId(String processInstanceId, String activityId) {
|
default List<BpmProcessInstanceCopyDO> selectListByProcessIstanceIdAndActivityId(String processInstanceId, String activityId) {
|
||||||
return selectList(BpmProcessInstanceCopyDO::getProcessInstanceId, processInstanceId, BpmProcessInstanceCopyDO::getActivityId, activityId);
|
return selectList(BpmProcessInstanceCopyDO::getProcessInstanceId, processInstanceId,
|
||||||
|
BpmProcessInstanceCopyDO::getActivityId, activityId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -29,26 +29,6 @@ public interface BpmTaskCandidateStrategy {
|
|||||||
*/
|
*/
|
||||||
void validateParam(String param);
|
void validateParam(String param);
|
||||||
|
|
||||||
/**
|
|
||||||
* 基于执行任务,获得任务的候选用户们
|
|
||||||
*
|
|
||||||
* @param execution 执行任务
|
|
||||||
* @return 用户编号集合
|
|
||||||
*/
|
|
||||||
Set<Long> calculateUsers(DelegateExecution execution, String param);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 基于流程实例,获得任务的候选用户们。 用于获取未执行节点的候选用户们
|
|
||||||
*
|
|
||||||
* @param processInstanceId 流程实例
|
|
||||||
* @param param 节点的参数
|
|
||||||
* @return 用户编号集合
|
|
||||||
*/
|
|
||||||
default Set<Long> calculateUsers(String processInstanceId, String param) {
|
|
||||||
return Collections.emptySet();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否一定要输入参数
|
* 是否一定要输入参数
|
||||||
*
|
*
|
||||||
@ -58,4 +38,27 @@ public interface BpmTaskCandidateStrategy {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基于执行任务,获得任务的候选用户们
|
||||||
|
*
|
||||||
|
* @param execution 执行任务
|
||||||
|
* @return 用户编号集合
|
||||||
|
*/
|
||||||
|
Set<Long> calculateUsers(DelegateExecution execution, String param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基于流程实例,获得任务的候选用户们
|
||||||
|
*
|
||||||
|
* 目的:用于获取未执行节点的候选用户们
|
||||||
|
*
|
||||||
|
* @param processInstanceId 流程实例编号
|
||||||
|
* @param param 节点的参数
|
||||||
|
* @return 用户编号集合
|
||||||
|
*/
|
||||||
|
default Set<Long> calculateUsers(String processInstanceId, String param) {
|
||||||
|
return Collections.emptySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO @芋艿:后续可以抽象一个 calculateUsers(String param),默认 calculateUsers 和 calculateUsers 调用它
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -41,16 +41,11 @@ public class BpmTaskCandidateDeptMemberStrategy implements BpmTaskCandidateStrat
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<Long> calculateUsers(DelegateExecution execution, String param) {
|
public Set<Long> calculateUsers(DelegateExecution execution, String param) {
|
||||||
return calculateUsersByParam(param);
|
return calculateUsers((String) null, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<Long> calculateUsers(String processInstanceId, String param) {
|
public Set<Long> calculateUsers(String processInstanceId, String param) {
|
||||||
return calculateUsersByParam(param);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Set<Long> calculateUsersByParam(String param) {
|
|
||||||
|
|
||||||
Set<Long> deptIds = StrUtils.splitToLongSet(param);
|
Set<Long> deptIds = StrUtils.splitToLongSet(param);
|
||||||
List<AdminUserRespDTO> users = adminUserApi.getUserListByDeptIds(deptIds);
|
List<AdminUserRespDTO> users = adminUserApi.getUserListByDeptIds(deptIds);
|
||||||
return convertSet(users, AdminUserRespDTO::getId);
|
return convertSet(users, AdminUserRespDTO::getId);
|
||||||
|
@ -34,13 +34,13 @@ public class BpmTaskCandidateStartUserStrategy implements BpmTaskCandidateStrate
|
|||||||
public void validateParam(String param) {}
|
public void validateParam(String param) {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<Long> calculateUsers(DelegateExecution execution, String param) {
|
public boolean isParamRequired() {
|
||||||
return getStartUserOfProcessInstance(execution.getProcessInstanceId());
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isParamRequired() {
|
public Set<Long> calculateUsers(DelegateExecution execution, String param) {
|
||||||
return false;
|
return getStartUserOfProcessInstance(execution.getProcessInstanceId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -519,6 +519,7 @@ public class SimpleModelUtils {
|
|||||||
|
|
||||||
private static void processMultiInstanceLoopCharacteristics(Integer approveMethod, Integer approveRatio, UserTask userTask) {
|
private static void processMultiInstanceLoopCharacteristics(Integer approveMethod, Integer approveRatio, UserTask userTask) {
|
||||||
BpmUserTaskApproveMethodEnum approveMethodEnum = BpmUserTaskApproveMethodEnum.valueOf(approveMethod);
|
BpmUserTaskApproveMethodEnum approveMethodEnum = BpmUserTaskApproveMethodEnum.valueOf(approveMethod);
|
||||||
|
// TODO @jason:这种枚举,最终不要去掉哈 BpmUserTaskApproveMethodEnum。因为容易不经意重叠
|
||||||
if (approveMethodEnum == null || approveMethodEnum == RANDOM) {
|
if (approveMethodEnum == null || approveMethodEnum == RANDOM) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -656,7 +657,7 @@ public class SimpleModelUtils {
|
|||||||
traverseNodeToBuildNodeProgress(processInstance, simpleModel.getChildNode(), historicActivityList, activityInstanceMap, nodeProgresses, returnNodePosition);
|
traverseNodeToBuildNodeProgress(processInstance, simpleModel.getChildNode(), historicActivityList, activityInstanceMap, nodeProgresses, returnNodePosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO @芋艿:重点在 review 下
|
||||||
private static void buildNodeProgress(HistoricProcessInstance processInstance, BpmSimpleModelNodeVO node, List<ProcessNodeProgress> nodeProgresses,
|
private static void buildNodeProgress(HistoricProcessInstance processInstance, BpmSimpleModelNodeVO node, List<ProcessNodeProgress> nodeProgresses,
|
||||||
List<HistoricActivityInstance> historicActivityList, Map<String, HistoricActivityInstance> activityInstanceMap, List<Integer> returnNodePosition) {
|
List<HistoricActivityInstance> historicActivityList, Map<String, HistoricActivityInstance> activityInstanceMap, List<Integer> returnNodePosition) {
|
||||||
BpmSimpleModelNodeType nodeType = BpmSimpleModelNodeType.valueOf(node.getType());
|
BpmSimpleModelNodeType nodeType = BpmSimpleModelNodeType.valueOf(node.getType());
|
||||||
|
@ -48,11 +48,12 @@ public interface BpmProcessDefinitionService {
|
|||||||
* @param model 流程模型
|
* @param model 流程模型
|
||||||
* @param modelMetaInfo 流程模型元信息
|
* @param modelMetaInfo 流程模型元信息
|
||||||
* @param bpmnBytes BPMN XML 字节数组
|
* @param bpmnBytes BPMN XML 字节数组
|
||||||
* @param simpleBytes simple model json 字节数组
|
* @param simpleBytes SIMPLE Model JSON 字节数组
|
||||||
* @param form 表单
|
* @param form 表单
|
||||||
* @return 流程编号
|
* @return 流程编号
|
||||||
*/
|
*/
|
||||||
String createProcessDefinition(Model model, BpmModelMetaInfoVO modelMetaInfo, byte[] bpmnBytes, byte[] simpleBytes, BpmFormDO form);
|
String createProcessDefinition(Model model, BpmModelMetaInfoVO modelMetaInfo,
|
||||||
|
byte[] bpmnBytes, byte[] simpleBytes, BpmFormDO form);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新流程定义状态
|
* 更新流程定义状态
|
||||||
|
@ -29,7 +29,9 @@ public interface BpmActivityService {
|
|||||||
List<HistoricActivityInstance> getHistoricActivityListByExecutionId(String executionId);
|
List<HistoricActivityInstance> getHistoricActivityListByExecutionId(String executionId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取活动的用户列表。 例如:抄送人列表。 审批人列表
|
* 获取活动的用户列表。
|
||||||
|
*
|
||||||
|
* 例如:抄送人列表、审批人列表
|
||||||
*
|
*
|
||||||
* @param historicActivity 活动
|
* @param historicActivity 活动
|
||||||
* @param isMultiInstance 是否多实例 (会签,或签 )
|
* @param isMultiInstance 是否多实例 (会签,或签 )
|
||||||
@ -37,10 +39,11 @@ public interface BpmActivityService {
|
|||||||
* @return 用户列表
|
* @return 用户列表
|
||||||
*/
|
*/
|
||||||
List<BpmProcessInstanceProgressRespVO.User> getHistoricActivityUserList(HistoricActivityInstance historicActivity,
|
List<BpmProcessInstanceProgressRespVO.User> getHistoricActivityUserList(HistoricActivityInstance historicActivity,
|
||||||
Boolean isMultiInstance, List<HistoricActivityInstance> historicActivityList);
|
Boolean isMultiInstance,
|
||||||
|
List<HistoricActivityInstance> historicActivityList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取活动的进度状态。
|
* 获取活动的进度状态
|
||||||
*
|
*
|
||||||
* @param historicActivity 活动
|
* @param historicActivity 活动
|
||||||
* @param isMultiInstance 是否多实例 (会签,或签 )
|
* @param isMultiInstance 是否多实例 (会签,或签 )
|
||||||
@ -48,11 +51,15 @@ public interface BpmActivityService {
|
|||||||
* @return 活动的进度状态
|
* @return 活动的进度状态
|
||||||
*/
|
*/
|
||||||
Integer getHistoricActivityProgressStatus(HistoricActivityInstance historicActivity,
|
Integer getHistoricActivityProgressStatus(HistoricActivityInstance historicActivity,
|
||||||
Boolean isMultiInstance, List<HistoricActivityInstance> historicActivityList);
|
Boolean isMultiInstance,
|
||||||
|
List<HistoricActivityInstance> historicActivityList);
|
||||||
|
|
||||||
|
// TODO @jason:可以写下这 2 个方法的注释
|
||||||
Integer getNotRunActivityProgressStatus(Integer processInstanceStatus);
|
Integer getNotRunActivityProgressStatus(Integer processInstanceStatus);
|
||||||
|
|
||||||
List<BpmProcessInstanceProgressRespVO.User> getNotRunActivityUserList(String processInstanceId, Integer processInstanceStatus
|
List<BpmProcessInstanceProgressRespVO.User> getNotRunActivityUserList(String processInstanceId,
|
||||||
, Integer candidateStrategy, String candidateParam);
|
Integer processInstanceStatus,
|
||||||
|
Integer candidateStrategy,
|
||||||
|
String candidateParam);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -72,6 +72,7 @@ public class BpmActivityServiceImpl implements BpmActivityService {
|
|||||||
return historyService.createHistoricActivityInstanceQuery().executionId(executionId).list();
|
return historyService.createHistoricActivityInstanceQuery().executionId(executionId).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO @芋艿:重点在 review 下~
|
||||||
@Override
|
@Override
|
||||||
public List<User> getHistoricActivityUserList(HistoricActivityInstance historicActivity
|
public List<User> getHistoricActivityUserList(HistoricActivityInstance historicActivity
|
||||||
, Boolean isMultiInstance, List<HistoricActivityInstance> historicActivityList) {
|
, Boolean isMultiInstance, List<HistoricActivityInstance> historicActivityList) {
|
||||||
|
@ -43,6 +43,7 @@ public interface BpmProcessInstanceCopyService {
|
|||||||
*/
|
*/
|
||||||
PageResult<BpmProcessInstanceCopyDO> getProcessInstanceCopyPage(Long userId,
|
PageResult<BpmProcessInstanceCopyDO> getProcessInstanceCopyPage(Long userId,
|
||||||
BpmProcessInstanceCopyPageReqVO pageReqVO);
|
BpmProcessInstanceCopyPageReqVO pageReqVO);
|
||||||
|
// TODO @芋艿:重点在 review 下
|
||||||
/**
|
/**
|
||||||
* 通过流程实例和流程活动编号获取抄送人的 Id
|
* 通过流程实例和流程活动编号获取抄送人的 Id
|
||||||
*
|
*
|
||||||
|
@ -89,7 +89,7 @@ public class BpmProcessInstanceCopyServiceImpl implements BpmProcessInstanceCopy
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<Long> getCopyUserIds(String processInstanceId, String activityId) {
|
public Set<Long> getCopyUserIds(String processInstanceId, String activityId) {
|
||||||
return CollectionUtils.convertSet(processInstanceCopyMapper.selectListByProcInstIdAndActId(processInstanceId, activityId),
|
return CollectionUtils.convertSet(processInstanceCopyMapper.selectListByProcessIstanceIdAndActivityId(processInstanceId, activityId),
|
||||||
BpmProcessInstanceCopyDO::getUserId);
|
BpmProcessInstanceCopyDO::getUserId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +92,7 @@ public interface BpmProcessInstanceService {
|
|||||||
*/
|
*/
|
||||||
Map<String, String> getProcessInstanceFormFieldsPermission(@Valid BpmProcessInstanceFormFieldsPermissionReqVO reqVO);
|
Map<String, String> getProcessInstanceFormFieldsPermission(@Valid BpmProcessInstanceFormFieldsPermissionReqVO reqVO);
|
||||||
|
|
||||||
|
// TODO @芋艿:重点在 review 下
|
||||||
/**
|
/**
|
||||||
* 获取流程实例的进度
|
* 获取流程实例的进度
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user