对齐 boot 与 cloud 的代码

This commit is contained in:
YunaiV 2023-07-27 13:59:29 +08:00
parent 859cf74a6c
commit 5d6308e4bb
7 changed files with 17 additions and 14 deletions

View File

@ -73,11 +73,13 @@ public interface BpmTaskConvert {
BpmTaskDonePageItemRespVO convert2(HistoricTaskInstance bean); BpmTaskDonePageItemRespVO convert2(HistoricTaskInstance bean);
@Mappings({@Mapping(source = "processInstance.id", target = "id"), @Mappings({
@Mapping(source = "processInstance.name", target = "name"), @Mapping(source = "processInstance.id", target = "id"),
@Mapping(source = "processInstance.startUserId", target = "startUserId"), @Mapping(source = "processInstance.name", target = "name"),
@Mapping(source = "processInstance.processDefinitionId", target = "processDefinitionId"), @Mapping(source = "processInstance.startUserId", target = "startUserId"),
@Mapping(source = "startUser.nickname", target = "startUserNickname")}) @Mapping(source = "processInstance.processDefinitionId", target = "processDefinitionId"),
@Mapping(source = "startUser.nickname", target = "startUserNickname")
})
BpmTaskTodoPageItemRespVO.ProcessInstance convert(ProcessInstance processInstance, AdminUserRespDTO startUser); BpmTaskTodoPageItemRespVO.ProcessInstance convert(ProcessInstance processInstance, AdminUserRespDTO startUser);
default List<BpmTaskRespVO> convertList3(List<HistoricTaskInstance> tasks, default List<BpmTaskRespVO> convertList3(List<HistoricTaskInstance> tasks,

View File

@ -298,7 +298,7 @@ public class BpmTaskAssignRuleServiceImpl implements BpmTaskAssignRuleService {
} }
private Set<Long> calculateTaskCandidateUsersByPost(BpmTaskAssignRuleDO rule) { private Set<Long> calculateTaskCandidateUsersByPost(BpmTaskAssignRuleDO rule) {
List<AdminUserRespDTO> users = adminUserApi.getUsersByPostIds(rule.getOptions()); List<AdminUserRespDTO> users = adminUserApi.getUserListByPostIds(rule.getOptions());
return convertSet(users, AdminUserRespDTO::getId); return convertSet(users, AdminUserRespDTO::getId);
} }

View File

@ -120,7 +120,7 @@ public class BpmTaskAssignRuleServiceImplTest extends BaseDbUnitTest {
// mock 方法 // mock 方法
List<AdminUserRespDTO> users = CollectionUtils.convertList(asSet(11L, 22L), List<AdminUserRespDTO> users = CollectionUtils.convertList(asSet(11L, 22L),
id -> new AdminUserRespDTO().setId(id)); id -> new AdminUserRespDTO().setId(id));
when(adminUserApi.getUsersByPostIds(eq(rule.getOptions()))).thenReturn(users); when(adminUserApi.getUserListByPostIds(eq(rule.getOptions()))).thenReturn(users);
mockGetUserMap(asSet(11L, 22L)); mockGetUserMap(asSet(11L, 22L));
// 调用 // 调用

View File

@ -44,7 +44,7 @@ public interface AdminUserApi {
* @param postIds 岗位数组 * @param postIds 岗位数组
* @return 用户数组 * @return 用户数组
*/ */
List<AdminUserRespDTO> getUsersByPostIds(Collection<Long> postIds); List<AdminUserRespDTO> getUserListByPostIds(Collection<Long> postIds);
/** /**
* 获得用户 Map * 获得用户 Map

View File

@ -40,7 +40,7 @@ public class AdminUserApiImpl implements AdminUserApi {
} }
@Override @Override
public List<AdminUserRespDTO> getUsersByPostIds(Collection<Long> postIds) { public List<AdminUserRespDTO> getUserListByPostIds(Collection<Long> postIds) {
List<AdminUserDO> users = userService.getUserListByPostIds(postIds); List<AdminUserDO> users = userService.getUserListByPostIds(postIds);
return UserConvert.INSTANCE.convertList4(users); return UserConvert.INSTANCE.convertList4(users);
} }

View File

@ -27,10 +27,11 @@ public interface AuthConvert {
default AuthPermissionInfoRespVO convert(AdminUserDO user, List<RoleDO> roleList, List<MenuDO> menuList) { default AuthPermissionInfoRespVO convert(AdminUserDO user, List<RoleDO> roleList, List<MenuDO> menuList) {
return AuthPermissionInfoRespVO.builder() return AuthPermissionInfoRespVO.builder()
.user(AuthPermissionInfoRespVO.UserVO.builder().id(user.getId()).nickname(user.getNickname()).avatar(user.getAvatar()).build()) .user(AuthPermissionInfoRespVO.UserVO.builder().id(user.getId()).nickname(user.getNickname())
.roles(convertSet(roleList, RoleDO::getCode)) .avatar(user.getAvatar()).build())
.permissions(convertSet(menuList, MenuDO::getPermission)) .roles(convertSet(roleList, RoleDO::getCode))
.build(); .permissions(convertSet(menuList, MenuDO::getPermission))
.build();
} }
AuthMenuRespVO convertTreeNode(MenuDO menu); AuthMenuRespVO convertTreeNode(MenuDO menu);