补充根据身份id类型批量查询接口
This commit is contained in:
parent
34bc1fc106
commit
81ab60e44f
@ -1,6 +1,7 @@
|
||||
package cn.axzo.tyr.client.feign;
|
||||
|
||||
import cn.axzo.framework.domain.web.result.ApiResult;
|
||||
import cn.axzo.tyr.client.model.req.QueryByIdentityIdTypeReq;
|
||||
import cn.axzo.tyr.client.model.req.QuerySaasRoleReq;
|
||||
import cn.axzo.tyr.client.model.vo.SaasRoleVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
@ -10,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 角色
|
||||
@ -39,10 +41,20 @@ public interface SaasRoleApi {
|
||||
ApiResult<List<SaasRoleVO>> query(@RequestBody QuerySaasRoleReq req);
|
||||
|
||||
/**
|
||||
* 根据身份id 身份类型查询权限列表
|
||||
* 根据身份id身份类型查询权限列表(批量)
|
||||
* @param identityType 身份类型 1:工人 2:班组长 3:从业人员 4:监管人员 5:运营人员
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/api/saasRole/queryByIdentityIdType")
|
||||
ApiResult<List<SaasRoleVO>> queryByIdentityIdType(@RequestParam(required = true) Long identityId,@RequestParam(required = true) Integer identityType,@RequestParam(required = true) Long workspaceId,@RequestParam(required = true) Long ouId);
|
||||
|
||||
/**
|
||||
* 根据身份id身份类型查询权限列表(批量)
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/api/saasRole/queryBatchByIdentityIdType")
|
||||
ApiResult<Map<QueryByIdentityIdTypeReq, List<SaasRoleVO>>> queryBatchByIdentityIdType(@RequestBody List<QueryByIdentityIdTypeReq> req);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
package cn.axzo.tyr.client.model.req;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@EqualsAndHashCode
|
||||
public class QueryByIdentityIdTypeReq {
|
||||
|
||||
Long identityId;
|
||||
|
||||
/**
|
||||
* 身份类型 1:工人 2:班组长 3:从业人员 4:监管人员 5:运营人员
|
||||
*/
|
||||
Integer identityType;
|
||||
|
||||
Long workspaceId;
|
||||
|
||||
Long ouId;
|
||||
}
|
||||
@ -2,6 +2,7 @@ package cn.axzo.tyr.server.controller.role;
|
||||
|
||||
import cn.axzo.framework.domain.web.result.ApiResult;
|
||||
import cn.axzo.tyr.client.feign.SaasRoleApi;
|
||||
import cn.axzo.tyr.client.model.req.QueryByIdentityIdTypeReq;
|
||||
import cn.axzo.tyr.client.model.req.QuerySaasRoleReq;
|
||||
import cn.axzo.tyr.client.model.vo.SaasRoleVO;
|
||||
import cn.axzo.tyr.server.service.RoleService;
|
||||
@ -11,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 权限
|
||||
@ -46,4 +48,10 @@ public class SaasRoleController implements SaasRoleApi {
|
||||
public ApiResult<List<SaasRoleVO>> queryByIdentityIdType(Long identityId, Integer identityType,Long workspaceId,Long ouId) {
|
||||
return ApiResult.ok(roleService.queryByIdentityIdType(identityId, identityType,workspaceId,ouId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResult<Map<QueryByIdentityIdTypeReq, List<SaasRoleVO>>> queryBatchByIdentityIdType(List<QueryByIdentityIdTypeReq> req) {
|
||||
return ApiResult.ok(roleService.queryBatchByIdentityIdType(req));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
package cn.axzo.tyr.server.service;
|
||||
|
||||
import cn.axzo.framework.domain.web.result.ApiListResult;
|
||||
import cn.axzo.tyr.client.model.req.QueryByIdentityIdTypeReq;
|
||||
import cn.axzo.tyr.client.model.req.QuerySaasRoleReq;
|
||||
import cn.axzo.tyr.client.model.vo.SaasRoleVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 角色
|
||||
@ -19,4 +20,6 @@ public interface RoleService {
|
||||
List<SaasRoleVO> queryByIdentityIdType(Long identityId, Integer identityType,Long workspaceId,Long ouId);
|
||||
|
||||
List<SaasRoleVO> query(QuerySaasRoleReq req);
|
||||
|
||||
Map<QueryByIdentityIdTypeReq, List<SaasRoleVO>> queryBatchByIdentityIdType(List<QueryByIdentityIdTypeReq> req);
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package cn.axzo.tyr.server.service.impl;
|
||||
|
||||
import cn.axzo.basics.common.constant.enums.TableIsDeleteEnum;
|
||||
import cn.axzo.pokonyan.config.mybatisplus.BaseEntity;
|
||||
import cn.axzo.tyr.client.model.req.QueryByIdentityIdTypeReq;
|
||||
import cn.axzo.tyr.client.model.req.QuerySaasPermissionGroupReq;
|
||||
import cn.axzo.tyr.client.model.req.QuerySaasRoleGroupReq;
|
||||
import cn.axzo.tyr.client.model.req.QuerySaasRoleReq;
|
||||
@ -59,6 +60,7 @@ public class RoleServiceImpl implements RoleService {
|
||||
|
||||
/**
|
||||
* 根据id查询权限详情包含权限组合权限集(底层基础方法)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<SaasRoleVO> getByIds(List<Long> roleIds) {
|
||||
@ -139,6 +141,15 @@ public class RoleServiceImpl implements RoleService {
|
||||
return getByIds(list.stream().map(BaseEntity::getId).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<QueryByIdentityIdTypeReq, List<SaasRoleVO>> queryBatchByIdentityIdType(List<QueryByIdentityIdTypeReq> req) {
|
||||
HashMap<QueryByIdentityIdTypeReq, List<SaasRoleVO>> result = new HashMap<>();
|
||||
req.forEach(e -> {
|
||||
result.put(e,queryByIdentityIdType(e.getIdentityId(),e.getIdentityType(),e.getWorkspaceId(),e.getOuId()));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色id查询权限集关联关系
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user