mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 12:18:42 +08:00 
			
		
		
		
	【代码评审修改】 代码评审修改
This commit is contained in:
		@@ -1,5 +1,6 @@
 | 
			
		||||
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance;
 | 
			
		||||
 | 
			
		||||
import cn.iocoder.yudao.module.bpm.controller.admin.base.user.UserSimpleBaseVO;
 | 
			
		||||
import io.swagger.v3.oas.annotations.media.Schema;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
@@ -42,24 +43,7 @@ public class BpmApprovalDetailRespVO {
 | 
			
		||||
        private List<ApprovalTaskInfo> tasks;
 | 
			
		||||
 | 
			
		||||
        @Schema(description = "候选人用户列表")
 | 
			
		||||
        // TODO @jason:candidateUserList => candidateUsers,保持和 tasks 的命名风格一致哈
 | 
			
		||||
        private List<User> candidateUserList; // 用于未运行任务节点
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // TODO @jason:可以替换成 UserSimpleBaseVO。简化下
 | 
			
		||||
    @Schema(description = "用户信息")
 | 
			
		||||
    @Data
 | 
			
		||||
    public static class User {
 | 
			
		||||
 | 
			
		||||
        @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
 | 
			
		||||
        private Long id;
 | 
			
		||||
 | 
			
		||||
        @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
 | 
			
		||||
        private String nickname;
 | 
			
		||||
 | 
			
		||||
        @Schema(description = "用户头像", example = "https://www.iocoder.cn/1.png")
 | 
			
		||||
        private String avatar;
 | 
			
		||||
        private List<UserSimpleBaseVO> candidateUsers; // 用于未运行任务节点
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -71,10 +55,10 @@ public class BpmApprovalDetailRespVO {
 | 
			
		||||
        private String id;
 | 
			
		||||
 | 
			
		||||
        @Schema(description = "任务所属人", example = "1024")
 | 
			
		||||
        private User ownerUser;
 | 
			
		||||
        private UserSimpleBaseVO ownerUser;
 | 
			
		||||
 | 
			
		||||
        @Schema(description = "任务分配人", example = "2048")
 | 
			
		||||
        private User assigneeUser;
 | 
			
		||||
        private UserSimpleBaseVO assigneeUser;
 | 
			
		||||
 | 
			
		||||
        @Schema(description = "任务状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
 | 
			
		||||
        private Integer status;  // 参见 BpmTaskStatusEnum 枚举
 | 
			
		||||
 
 | 
			
		||||
@@ -66,6 +66,8 @@ public class BpmProcessInstanceRespVO {
 | 
			
		||||
        private Long id;
 | 
			
		||||
        @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
 | 
			
		||||
        private String nickname;
 | 
			
		||||
        @Schema(description = "用户头像", example = "https://www.iocoder.cn/1.png")
 | 
			
		||||
        private String avatar;
 | 
			
		||||
 | 
			
		||||
        @Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
 | 
			
		||||
        private Long deptId;
 | 
			
		||||
 
 | 
			
		||||
@@ -102,8 +102,7 @@ public class BpmTaskCandidateInvoker {
 | 
			
		||||
        String param = BpmnModelUtils.parseCandidateParam(execution.getCurrentFlowElement());
 | 
			
		||||
        // 1.1 计算任务的候选人
 | 
			
		||||
        Set<Long> userIds = getCandidateStrategy(strategy).calculateUsers(execution, param);
 | 
			
		||||
        removeDisableUsers(userIds);
 | 
			
		||||
        // 1.2 移除被禁用的用户
 | 
			
		||||
        // 1.2 移除被禁用的用户 TODO @芋艿 在 calculateUsers 方法中默认已经移除了被禁用的用户, 这里还需要移除被禁用的用户吗?
 | 
			
		||||
        removeDisableUsers(userIds);
 | 
			
		||||
 | 
			
		||||
        // 2. 候选人为空时,根据“审批人为空”的配置补充
 | 
			
		||||
 
 | 
			
		||||
@@ -59,6 +59,8 @@ public class BpmTaskCandidateStartUserDeptLeaderMultiStrategy extends BpmTaskCan
 | 
			
		||||
        }
 | 
			
		||||
        Set<Long> users = getMultiLevelDeptLeaderIds(toList(dept.getId()), Integer.valueOf(param)); // 参数是部门的层级
 | 
			
		||||
        // TODO @jason:这里 removeDisableUsers 的原因是啥呀?
 | 
			
		||||
        // TODO @芋艿 calculateUsers(execution, param)  calculateUsers(startUserId, processInstance, activityId, param) 现在这两个方法, 默认都移除了被禁用的用户
 | 
			
		||||
        // TODO @芋艿 因为被禁用的用户是不能审批任务。 在这里移除是不是好一点。 代码可以重用。
 | 
			
		||||
        removeDisableUsers(users);
 | 
			
		||||
        return users;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user