feat:(REQ-3282) 扩展支持roleUserList接口
This commit is contained in:
parent
15ad4c99be
commit
c8d81b444f
@ -0,0 +1,27 @@
|
|||||||
|
package cn.axzo.tyr.feign.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员身份类型枚举
|
||||||
|
*
|
||||||
|
* @author xuyaozuo
|
||||||
|
* @since 2022/5/9 21:59
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum IdentityTypeEnum {
|
||||||
|
|
||||||
|
/*人员身份类型*/
|
||||||
|
NOT_SUPPORT(0, "NOT_SUPPORT", "无效类型"),
|
||||||
|
WORKER(1, "WORKER", "工人"),
|
||||||
|
WORKER_LEADER(2, "WORKER_LEADER", "班组长"),
|
||||||
|
PRACTITIONER(3, "PRACTITIONER", "从业人员"),
|
||||||
|
REGULATOR(4, "REGULATOR", "监管人员"),
|
||||||
|
OPERATOR(5, "OPERATOR", "运营人员"),
|
||||||
|
;
|
||||||
|
private final Integer code;
|
||||||
|
private final String message;
|
||||||
|
private final String desc;
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
package cn.axzo.tyr.feign.req;
|
package cn.axzo.tyr.feign.req;
|
||||||
|
|
||||||
|
import cn.axzo.tyr.feign.enums.IdentityTypeEnum;
|
||||||
import cn.axzo.tyr.feign.enums.RoleTypeEnum;
|
import cn.axzo.tyr.feign.enums.RoleTypeEnum;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@ -32,12 +33,12 @@ public class PageRoleUserReq {
|
|||||||
/**
|
/**
|
||||||
* 企业id
|
* 企业id
|
||||||
*/
|
*/
|
||||||
private Long ouId;
|
private Set<Long> ouIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目id
|
* 项目id
|
||||||
*/
|
*/
|
||||||
private Long workspaceId;
|
private Set<Long> workspaceIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色code
|
* 角色code
|
||||||
@ -65,6 +66,26 @@ public class PageRoleUserReq {
|
|||||||
*/
|
*/
|
||||||
private List<WorkspaceOuPair> workspaceOuPairs;
|
private List<WorkspaceOuPair> workspaceOuPairs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否需要角色信息
|
||||||
|
*/
|
||||||
|
private Boolean needRole;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Set<Long> personIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份id
|
||||||
|
*/
|
||||||
|
private Set<Long> identityIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份类型
|
||||||
|
*/
|
||||||
|
private IdentityTypeEnum identityType;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
|||||||
@ -5,12 +5,25 @@ import lombok.Builder;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class RoleUserResp {
|
public class RoleUserResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色Id
|
||||||
|
*/
|
||||||
|
private Long roleId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 身份Id
|
* 身份Id
|
||||||
*/
|
*/
|
||||||
@ -40,4 +53,33 @@ public class RoleUserResp {
|
|||||||
* 工作台Id
|
* 工作台Id
|
||||||
*/
|
*/
|
||||||
private Long workspaceId;
|
private Long workspaceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
private Long createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新者
|
||||||
|
*/
|
||||||
|
private Long updateBy;
|
||||||
|
|
||||||
|
protected Date createAt;
|
||||||
|
|
||||||
|
protected Date updateAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资源类型
|
||||||
|
*/
|
||||||
|
private Integer resourceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资源Id
|
||||||
|
*/
|
||||||
|
private Long resourceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色信息
|
||||||
|
*/
|
||||||
|
private RoleResp role;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import cn.axzo.tyr.client.model.roleuser.req.ListRoleUserRelationParam;
|
|||||||
import cn.axzo.tyr.client.model.roleuser.req.PageRoleUserRelationParam;
|
import cn.axzo.tyr.client.model.roleuser.req.PageRoleUserRelationParam;
|
||||||
import cn.axzo.tyr.feign.api.RoleUserApi;
|
import cn.axzo.tyr.feign.api.RoleUserApi;
|
||||||
import cn.axzo.tyr.feign.req.PageRoleUserReq;
|
import cn.axzo.tyr.feign.req.PageRoleUserReq;
|
||||||
|
import cn.axzo.tyr.feign.resp.RoleResp;
|
||||||
import cn.axzo.tyr.feign.resp.RoleUserResp;
|
import cn.axzo.tyr.feign.resp.RoleUserResp;
|
||||||
import cn.axzo.tyr.server.service.SaasRoleUserRelationService;
|
import cn.axzo.tyr.server.service.SaasRoleUserRelationService;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
@ -67,6 +68,9 @@ public class RoleUserV2Controller implements RoleUserApi {
|
|||||||
.build())
|
.build())
|
||||||
.collect(Collectors.toList()))
|
.collect(Collectors.toList()))
|
||||||
.orElse(null));
|
.orElse(null));
|
||||||
|
result.setPersonIds(Optional.ofNullable(req.getPersonIds())
|
||||||
|
.map(Lists::newArrayList)
|
||||||
|
.orElse(null));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,6 +80,17 @@ public class RoleUserV2Controller implements RoleUserApi {
|
|||||||
BeanUtils.copyProperties(saasRoleUserV2DTO, result);
|
BeanUtils.copyProperties(saasRoleUserV2DTO, result);
|
||||||
|
|
||||||
result.setPersonId(saasRoleUserV2DTO.getSaasRoleUser().getPersonId());
|
result.setPersonId(saasRoleUserV2DTO.getSaasRoleUser().getPersonId());
|
||||||
|
|
||||||
|
result.setRole(Optional.ofNullable(saasRoleUserV2DTO.getSaasRole())
|
||||||
|
.map(e -> {
|
||||||
|
RoleResp role = RoleResp.builder().build();
|
||||||
|
BeanUtils.copyProperties(e, role);
|
||||||
|
role.setRoleId(e.getId());
|
||||||
|
role.setCooperateShipType(e.getProductUnitType());
|
||||||
|
role.setOuId(e.getOwnerOuId());
|
||||||
|
return role;
|
||||||
|
})
|
||||||
|
.orElse(null));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import cn.axzo.tyr.client.model.roleuser.dto.SaasRoleUserDTO;
|
|||||||
import cn.axzo.tyr.client.model.roleuser.dto.SuperAminInfoResp;
|
import cn.axzo.tyr.client.model.roleuser.dto.SuperAminInfoResp;
|
||||||
import cn.axzo.tyr.client.model.roleuser.req.RoleUserParam;
|
import cn.axzo.tyr.client.model.roleuser.req.RoleUserParam;
|
||||||
import cn.axzo.tyr.client.model.roleuser.req.SuperAdminParam;
|
import cn.axzo.tyr.client.model.roleuser.req.SuperAdminParam;
|
||||||
|
import cn.axzo.tyr.feign.enums.IdentityTypeEnum;
|
||||||
import cn.axzo.tyr.feign.enums.RoleTypeEnum;
|
import cn.axzo.tyr.feign.enums.RoleTypeEnum;
|
||||||
import cn.axzo.tyr.feign.req.PageRoleUserReq;
|
import cn.axzo.tyr.feign.req.PageRoleUserReq;
|
||||||
import cn.axzo.tyr.feign.resp.RoleUserResp;
|
import cn.axzo.tyr.feign.resp.RoleUserResp;
|
||||||
@ -84,8 +85,8 @@ class RoleUserV2ControllerTest extends BaseTest {
|
|||||||
// old
|
// old
|
||||||
|
|
||||||
List<RoleUserResp> data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
List<RoleUserResp> data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
||||||
.workspaceId(3L)
|
.workspaceIds(Sets.newHashSet(3L))
|
||||||
.ouId(4L)
|
.ouIds(Sets.newHashSet(4L))
|
||||||
.roleTypes(Sets.newHashSet(RoleTypeEnum.SUPER_ADMIN))
|
.roleTypes(Sets.newHashSet(RoleTypeEnum.SUPER_ADMIN))
|
||||||
.build())
|
.build())
|
||||||
.getData()
|
.getData()
|
||||||
@ -99,8 +100,8 @@ class RoleUserV2ControllerTest extends BaseTest {
|
|||||||
|
|
||||||
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
||||||
.roleIds(Sets.newHashSet(101100L))
|
.roleIds(Sets.newHashSet(101100L))
|
||||||
.workspaceId(3L)
|
.workspaceIds(Sets.newHashSet(3L))
|
||||||
.ouId(4L)
|
.ouIds(Sets.newHashSet(4L))
|
||||||
.roleTypes(Sets.newHashSet(RoleTypeEnum.SUPER_ADMIN))
|
.roleTypes(Sets.newHashSet(RoleTypeEnum.SUPER_ADMIN))
|
||||||
.build())
|
.build())
|
||||||
.getData()
|
.getData()
|
||||||
@ -109,8 +110,8 @@ class RoleUserV2ControllerTest extends BaseTest {
|
|||||||
|
|
||||||
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
||||||
.roleIds(Sets.newHashSet(101101L))
|
.roleIds(Sets.newHashSet(101101L))
|
||||||
.workspaceId(3L)
|
.workspaceIds(Sets.newHashSet(3L))
|
||||||
.ouId(4L)
|
.ouIds(Sets.newHashSet(4L))
|
||||||
.build())
|
.build())
|
||||||
.getData()
|
.getData()
|
||||||
.getData();
|
.getData();
|
||||||
@ -124,8 +125,8 @@ class RoleUserV2ControllerTest extends BaseTest {
|
|||||||
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
||||||
.roleIds(Sets.newHashSet(101100L))
|
.roleIds(Sets.newHashSet(101100L))
|
||||||
.roleCodes(Sets.newHashSet("sdf"))
|
.roleCodes(Sets.newHashSet("sdf"))
|
||||||
.workspaceId(3L)
|
.workspaceIds(Sets.newHashSet(3L))
|
||||||
.ouId(4L)
|
.ouIds(Sets.newHashSet(4L))
|
||||||
.build())
|
.build())
|
||||||
.getData()
|
.getData()
|
||||||
.getData();
|
.getData();
|
||||||
@ -134,8 +135,8 @@ class RoleUserV2ControllerTest extends BaseTest {
|
|||||||
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
||||||
.roleIds(Sets.newHashSet(101101L))
|
.roleIds(Sets.newHashSet(101101L))
|
||||||
.roleCodes(Sets.newHashSet("sdf"))
|
.roleCodes(Sets.newHashSet("sdf"))
|
||||||
.workspaceId(3L)
|
.workspaceIds(Sets.newHashSet(3L))
|
||||||
.ouId(4L)
|
.ouIds(Sets.newHashSet(4L))
|
||||||
.build())
|
.build())
|
||||||
.getData()
|
.getData()
|
||||||
.getData();
|
.getData();
|
||||||
@ -144,8 +145,8 @@ class RoleUserV2ControllerTest extends BaseTest {
|
|||||||
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
||||||
.roleIds(Sets.newHashSet(101101L))
|
.roleIds(Sets.newHashSet(101101L))
|
||||||
.roleCodes(Sets.newHashSet("pro_superadmin"))
|
.roleCodes(Sets.newHashSet("pro_superadmin"))
|
||||||
.workspaceId(3L)
|
.workspaceIds(Sets.newHashSet(3L))
|
||||||
.ouId(4L)
|
.ouIds(Sets.newHashSet(4L))
|
||||||
.build())
|
.build())
|
||||||
.getData()
|
.getData()
|
||||||
.getData();
|
.getData();
|
||||||
@ -429,5 +430,188 @@ class RoleUserV2ControllerTest extends BaseTest {
|
|||||||
Assertions.assertEquals(LocalDateTime.ofInstant(listApiResult.get(0).getUpdateAt().toInstant(), ZoneId.systemDefault()),
|
Assertions.assertEquals(LocalDateTime.ofInstant(listApiResult.get(0).getUpdateAt().toInstant(), ZoneId.systemDefault()),
|
||||||
LocalDateTime.of(2024, 9, 26, 11, 31, 32));
|
LocalDateTime.of(2024, 9, 26, 11, 31, 32));
|
||||||
// old
|
// old
|
||||||
|
|
||||||
|
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
||||||
|
.needRole(true)
|
||||||
|
.build())
|
||||||
|
.getData()
|
||||||
|
.getData();
|
||||||
|
Assertions.assertEquals(data.size(), 13);
|
||||||
|
Assertions.assertEquals(data.get(0).getId(), 544214L);
|
||||||
|
Assertions.assertEquals(data.get(0).getIdentityId(), 14L);
|
||||||
|
Assertions.assertEquals(data.get(0).getIdentityType(), 3);
|
||||||
|
Assertions.assertEquals(data.get(0).getRoleId(), 100921L);
|
||||||
|
Assertions.assertEquals(data.get(0).getPersonId(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getName(), "查看组织架构");
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getRoleType(), cn.axzo.tyr.client.common.enums.RoleTypeEnum.INIT.getValue());
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getDescription(), "ff");
|
||||||
|
Assertions.assertEquals(data.get(0).getCreateBy(), 1L);
|
||||||
|
Assertions.assertEquals(data.get(0).getUpdateBy(), 2L);
|
||||||
|
Assertions.assertEquals(data.get(0).getOuId(), 4L);
|
||||||
|
Assertions.assertEquals(data.get(0).getWorkspaceId(), 3L);
|
||||||
|
Assertions.assertEquals(data.get(0).getResourceId(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getResourceType(), 0);
|
||||||
|
Assertions.assertTrue(data.get(0).getRole().getIsDisplay());
|
||||||
|
Assertions.assertTrue(data.get(0).getRole().getEnabled());
|
||||||
|
Assertions.assertEquals(LocalDateTime.ofInstant(listApiResult.get(0).getUpdateAt().toInstant(), ZoneId.systemDefault()),
|
||||||
|
LocalDateTime.of(2024, 9, 26, 11, 31, 32));
|
||||||
|
|
||||||
|
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
||||||
|
.needRole(true)
|
||||||
|
.workspaceIds(Sets.newHashSet(5L))
|
||||||
|
.build())
|
||||||
|
.getData()
|
||||||
|
.getData();
|
||||||
|
Assertions.assertEquals(data.size(), 1);
|
||||||
|
Assertions.assertEquals(data.get(0).getId(), 544688L);
|
||||||
|
Assertions.assertEquals(data.get(0).getIdentityId(), 429L);
|
||||||
|
Assertions.assertEquals(data.get(0).getIdentityType(), 3);
|
||||||
|
Assertions.assertEquals(data.get(0).getRoleId(), 100921L);
|
||||||
|
Assertions.assertEquals(data.get(0).getPersonId(), 5267L);
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getName(), "查看组织架构");
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getRoleType(), cn.axzo.tyr.client.common.enums.RoleTypeEnum.INIT.getValue());
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getDescription(), "ff");
|
||||||
|
Assertions.assertEquals(data.get(0).getCreateBy(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getUpdateBy(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getOuId(), 6L);
|
||||||
|
Assertions.assertEquals(data.get(0).getWorkspaceId(), 5L);
|
||||||
|
Assertions.assertEquals(data.get(0).getResourceId(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getResourceType(), 0);
|
||||||
|
Assertions.assertTrue(data.get(0).getRole().getIsDisplay());
|
||||||
|
Assertions.assertTrue(data.get(0).getRole().getEnabled());
|
||||||
|
Assertions.assertEquals(LocalDateTime.ofInstant(data.get(0).getUpdateAt().toInstant(), ZoneId.systemDefault()),
|
||||||
|
LocalDateTime.of(2024, 9, 26, 11, 31, 33));
|
||||||
|
|
||||||
|
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
||||||
|
.needRole(true)
|
||||||
|
.workspaceIds(Sets.newHashSet(5L))
|
||||||
|
.build())
|
||||||
|
.getData()
|
||||||
|
.getData();
|
||||||
|
Assertions.assertEquals(data.size(), 1);
|
||||||
|
Assertions.assertEquals(data.get(0).getId(), 544688L);
|
||||||
|
Assertions.assertEquals(data.get(0).getIdentityId(), 429L);
|
||||||
|
Assertions.assertEquals(data.get(0).getIdentityType(), 3);
|
||||||
|
Assertions.assertEquals(data.get(0).getRoleId(), 100921L);
|
||||||
|
Assertions.assertEquals(data.get(0).getPersonId(), 5267L);
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getName(), "查看组织架构");
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getRoleType(), cn.axzo.tyr.client.common.enums.RoleTypeEnum.INIT.getValue());
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getDescription(), "ff");
|
||||||
|
Assertions.assertEquals(data.get(0).getCreateBy(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getUpdateBy(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getOuId(), 6L);
|
||||||
|
Assertions.assertEquals(data.get(0).getWorkspaceId(), 5L);
|
||||||
|
Assertions.assertEquals(data.get(0).getResourceId(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getResourceType(), 0);
|
||||||
|
Assertions.assertTrue(data.get(0).getRole().getIsDisplay());
|
||||||
|
Assertions.assertTrue(data.get(0).getRole().getEnabled());
|
||||||
|
Assertions.assertEquals(LocalDateTime.ofInstant(data.get(0).getUpdateAt().toInstant(), ZoneId.systemDefault()),
|
||||||
|
LocalDateTime.of(2024, 9, 26, 11, 31, 33));
|
||||||
|
|
||||||
|
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
||||||
|
.needRole(true)
|
||||||
|
.ouIds(Sets.newHashSet(6L))
|
||||||
|
.build())
|
||||||
|
.getData()
|
||||||
|
.getData();
|
||||||
|
Assertions.assertEquals(data.size(), 1);
|
||||||
|
Assertions.assertEquals(data.get(0).getId(), 544688L);
|
||||||
|
Assertions.assertEquals(data.get(0).getIdentityId(), 429L);
|
||||||
|
Assertions.assertEquals(data.get(0).getIdentityType(), 3);
|
||||||
|
Assertions.assertEquals(data.get(0).getRoleId(), 100921L);
|
||||||
|
Assertions.assertEquals(data.get(0).getPersonId(), 5267L);
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getName(), "查看组织架构");
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getRoleType(), cn.axzo.tyr.client.common.enums.RoleTypeEnum.INIT.getValue());
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getDescription(), "ff");
|
||||||
|
Assertions.assertEquals(data.get(0).getCreateBy(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getUpdateBy(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getOuId(), 6L);
|
||||||
|
Assertions.assertEquals(data.get(0).getWorkspaceId(), 5L);
|
||||||
|
Assertions.assertEquals(data.get(0).getResourceId(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getResourceType(), 0);
|
||||||
|
Assertions.assertTrue(data.get(0).getRole().getIsDisplay());
|
||||||
|
Assertions.assertTrue(data.get(0).getRole().getEnabled());
|
||||||
|
Assertions.assertEquals(LocalDateTime.ofInstant(data.get(0).getUpdateAt().toInstant(), ZoneId.systemDefault()),
|
||||||
|
LocalDateTime.of(2024, 9, 26, 11, 31, 33));
|
||||||
|
|
||||||
|
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
||||||
|
.needRole(true)
|
||||||
|
.personIds(Sets.newHashSet(5267L))
|
||||||
|
.build())
|
||||||
|
.getData()
|
||||||
|
.getData();
|
||||||
|
Assertions.assertEquals(data.size(), 2);
|
||||||
|
Assertions.assertEquals(data.get(0).getId(), 544687L);
|
||||||
|
Assertions.assertEquals(data.get(0).getIdentityId(), 429L);
|
||||||
|
Assertions.assertEquals(data.get(0).getIdentityType(), 3);
|
||||||
|
Assertions.assertEquals(data.get(0).getRoleId(), 100921L);
|
||||||
|
Assertions.assertEquals(data.get(0).getPersonId(), 5267L);
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getName(), "查看组织架构");
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getRoleType(), cn.axzo.tyr.client.common.enums.RoleTypeEnum.INIT.getValue());
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getDescription(), "ff");
|
||||||
|
Assertions.assertEquals(data.get(0).getCreateBy(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getUpdateBy(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getOuId(), 4L);
|
||||||
|
Assertions.assertEquals(data.get(0).getWorkspaceId(), 3L);
|
||||||
|
Assertions.assertEquals(data.get(0).getResourceId(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getResourceType(), 0);
|
||||||
|
Assertions.assertTrue(data.get(0).getRole().getIsDisplay());
|
||||||
|
Assertions.assertTrue(data.get(0).getRole().getEnabled());
|
||||||
|
Assertions.assertEquals(LocalDateTime.ofInstant(data.get(0).getUpdateAt().toInstant(), ZoneId.systemDefault()),
|
||||||
|
LocalDateTime.of(2024, 9, 26, 11, 31, 33));
|
||||||
|
|
||||||
|
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
||||||
|
.needRole(true)
|
||||||
|
.identityIds(Sets.newHashSet(429L))
|
||||||
|
.identityType(IdentityTypeEnum.PRACTITIONER)
|
||||||
|
.build())
|
||||||
|
.getData()
|
||||||
|
.getData();
|
||||||
|
Assertions.assertEquals(data.size(), 2);
|
||||||
|
Assertions.assertEquals(data.get(0).getId(), 544687L);
|
||||||
|
Assertions.assertEquals(data.get(0).getIdentityId(), 429L);
|
||||||
|
Assertions.assertEquals(data.get(0).getIdentityType(), 3);
|
||||||
|
Assertions.assertEquals(data.get(0).getRoleId(), 100921L);
|
||||||
|
Assertions.assertEquals(data.get(0).getPersonId(), 5267L);
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getName(), "查看组织架构");
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getRoleType(), cn.axzo.tyr.client.common.enums.RoleTypeEnum.INIT.getValue());
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getDescription(), "ff");
|
||||||
|
Assertions.assertEquals(data.get(0).getCreateBy(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getUpdateBy(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getOuId(), 4L);
|
||||||
|
Assertions.assertEquals(data.get(0).getWorkspaceId(), 3L);
|
||||||
|
Assertions.assertEquals(data.get(0).getResourceId(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getResourceType(), 0);
|
||||||
|
Assertions.assertTrue(data.get(0).getRole().getIsDisplay());
|
||||||
|
Assertions.assertTrue(data.get(0).getRole().getEnabled());
|
||||||
|
Assertions.assertEquals(LocalDateTime.ofInstant(data.get(0).getUpdateAt().toInstant(), ZoneId.systemDefault()),
|
||||||
|
LocalDateTime.of(2024, 9, 26, 11, 31, 33));
|
||||||
|
|
||||||
|
data = roleUserV2Controller.page(PageRoleUserReq.builder()
|
||||||
|
.needRole(true)
|
||||||
|
.roleIds(Sets.newHashSet(100923L))
|
||||||
|
.build())
|
||||||
|
.getData()
|
||||||
|
.getData();
|
||||||
|
|
||||||
|
Assertions.assertEquals(data.size(), 1);
|
||||||
|
Assertions.assertEquals(data.get(0).getId(), 544453L);
|
||||||
|
Assertions.assertEquals(data.get(0).getIdentityId(), 36L);
|
||||||
|
Assertions.assertEquals(data.get(0).getIdentityType(), 3);
|
||||||
|
Assertions.assertEquals(data.get(0).getRoleId(), 100923L);
|
||||||
|
Assertions.assertEquals(data.get(0).getPersonId(), 3470L);
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getName(), "查看合约");
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getRoleType(), cn.axzo.tyr.client.common.enums.RoleTypeEnum.INIT.getValue());
|
||||||
|
Assertions.assertEquals(data.get(0).getRole().getDescription(), "dd");
|
||||||
|
Assertions.assertEquals(data.get(0).getCreateBy(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getUpdateBy(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getOuId(), 4L);
|
||||||
|
Assertions.assertEquals(data.get(0).getWorkspaceId(), 3L);
|
||||||
|
Assertions.assertEquals(data.get(0).getResourceId(), 0L);
|
||||||
|
Assertions.assertEquals(data.get(0).getResourceType(), 0);
|
||||||
|
Assertions.assertTrue(data.get(0).getRole().getIsDisplay());
|
||||||
|
Assertions.assertTrue(data.get(0).getRole().getEnabled());
|
||||||
|
Assertions.assertEquals(LocalDateTime.ofInstant(data.get(0).getUpdateAt().toInstant(), ZoneId.systemDefault()),
|
||||||
|
LocalDateTime.of(2024, 9, 26, 11, 31, 32));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -17,15 +17,9 @@ INSERT INTO saas_role (id, NAME, description, role_type, role_code, workspace_id
|
|||||||
VALUES (100923, '查看合约', 'dd', 'init', 'cms:zb_contact_view', -1, -1, 1, 2, 0, '2024-09-25 11:51:58', '2024-09-26 10:43:06', 154587, 154587, 1, 65535, 0, null, 0, '', 1, 2, 1);
|
VALUES (100923, '查看合约', 'dd', 'init', 'cms:zb_contact_view', -1, -1, 1, 2, 0, '2024-09-25 11:51:58', '2024-09-26 10:43:06', 154587, 154587, 1, 65535, 0, null, 0, '', 1, 2, 1);
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO saas_role_user_relation (id, identity_id, role_id, identity_type, natural_person_id, workspace_id, ou_id, resource_type, resource_id, is_delete, create_at, update_at, create_by, update_by, job_type)
|
|
||||||
VALUES (197519, 28801, 3414, 3, 24510, 3, 4, 0, 0, 0, '2024-01-18 16:36:16', '2024-09-29 17:16:39', 0, 0, 2);
|
|
||||||
INSERT INTO saas_role_user_relation (id, identity_id, role_id, identity_type, natural_person_id, workspace_id, ou_id, resource_type, resource_id, is_delete, create_at, update_at, create_by, update_by, job_type)
|
|
||||||
VALUES (183677, 40, 3415, 3, 2232, 8, 1, 0, 0, 0, '2023-10-06 15:13:35', '2024-09-29 17:16:39', 0, 0, 2);
|
|
||||||
INSERT INTO saas_role_user_relation (id, identity_id, role_id, identity_type, natural_person_id, workspace_id, ou_id, resource_type, resource_id, is_delete, create_at, update_at, create_by, update_by, job_type)
|
INSERT INTO saas_role_user_relation (id, identity_id, role_id, identity_type, natural_person_id, workspace_id, ou_id, resource_type, resource_id, is_delete, create_at, update_at, create_by, update_by, job_type)
|
||||||
VALUES (1157571, 40, 101101, 3, 2232, 8, 1, 0, 0, 0, '2024-09-27 09:39:49', '2024-09-27 09:39:48', 0, 0, 2);
|
VALUES (1157571, 40, 101101, 3, 2232, 8, 1, 0, 0, 0, '2024-09-27 09:39:49', '2024-09-27 09:39:48', 0, 0, 2);
|
||||||
INSERT INTO saas_role_user_relation (id, identity_id, role_id, identity_type, natural_person_id, workspace_id, ou_id, resource_type, resource_id, is_delete, create_at, update_at, create_by, update_by, job_type)
|
INSERT INTO saas_role_user_relation (id, identity_id, role_id, identity_type, natural_person_id, workspace_id, ou_id, resource_type, resource_id, is_delete, create_at, update_at, create_by, update_by, job_type)
|
||||||
VALUES (197520, 28802, 24425, 3, 24511, 3, 4, 0, 0, 0, '2024-01-18 16:36:16', '2024-09-29 17:16:39', 0, 0, 2);
|
|
||||||
INSERT INTO saas_role_user_relation (id, identity_id, role_id, identity_type, natural_person_id, workspace_id, ou_id, resource_type, resource_id, is_delete, create_at, update_at, create_by, update_by, job_type)
|
|
||||||
VALUES (1157572, 40, 101101, 3, 2232, 3, 4, 0, 0, 0, '2024-09-27 09:39:49', '2024-09-27 09:39:48', 0, 0, 2);
|
VALUES (1157572, 40, 101101, 3, 2232, 3, 4, 0, 0, 0, '2024-09-27 09:39:49', '2024-09-27 09:39:48', 0, 0, 2);
|
||||||
|
|
||||||
INSERT INTO saas_role_user_relation (id, identity_id, role_id, identity_type, natural_person_id, workspace_id, ou_id, resource_type, resource_id, is_delete, create_at, update_at, create_by, update_by, job_type)
|
INSERT INTO saas_role_user_relation (id, identity_id, role_id, identity_type, natural_person_id, workspace_id, ou_id, resource_type, resource_id, is_delete, create_at, update_at, create_by, update_by, job_type)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user