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