RoleService.java 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. package jnpf.permission.service;
  2. import jnpf.base.Pagination;
  3. import jnpf.base.service.SuperService;
  4. import jnpf.permission.entity.RoleEntity;
  5. import jnpf.permission.model.position.PosConModel;
  6. import jnpf.permission.model.role.RolePagination;
  7. import java.util.List;
  8. import java.util.Map;
  9. /**
  10. * 系统角色
  11. *
  12. * @author JNPF开发平台组
  13. * @version V3.1.0
  14. * @copyright 引迈信息技术有限公司
  15. * @date 2019年9月26日 上午9:18
  16. */
  17. public interface RoleService extends SuperService<RoleEntity> {
  18. /**
  19. * 列表
  20. *
  21. * @param page 条件
  22. */
  23. List<RoleEntity> getList(RolePagination page);
  24. /**
  25. * 验证名称
  26. *
  27. * @param fullName 名称
  28. * @param id 主键值
  29. */
  30. Boolean isExistByFullName(String fullName, String id, String type);
  31. /**
  32. * 验证编码
  33. *
  34. * @param enCode 名称
  35. * @param id 主键值
  36. */
  37. Boolean isExistByEnCode(String enCode, String id);
  38. /**
  39. * 创建
  40. *
  41. * @param entity 实体对象
  42. */
  43. void create(RoleEntity entity);
  44. /**
  45. * 更新
  46. *
  47. * @param id 主键值
  48. * @param entity 实体对象
  49. */
  50. Boolean update(String id, RoleEntity entity);
  51. /**
  52. * 信息
  53. *
  54. * @param roleId 角色ID
  55. * @return 角色对象
  56. */
  57. RoleEntity getInfo(String roleId);
  58. /**
  59. * 删除
  60. *
  61. * @param entity 实体对象
  62. */
  63. void delete(RoleEntity entity);
  64. RoleEntity getByEnCode(String enCode);
  65. /**
  66. * 列表
  67. *
  68. * @param filterEnabledMark
  69. * @param type 用户、岗位、组织
  70. * @param isSystem null-全部,1-系统,2-自定义
  71. * @return 角色对象集合
  72. */
  73. List<RoleEntity> getList(boolean filterEnabledMark, String type, Integer isSystem);
  74. /**
  75. * 根据id集合返回角色对象集合
  76. *
  77. * @param roleIds 角色ID集合
  78. * @param keyword
  79. * @param filterEnabledMark
  80. * @return 角色对象集合
  81. */
  82. List<RoleEntity> getListByIds(List<String> roleIds, String keyword, boolean filterEnabledMark);
  83. /**
  84. * 根据id查询角色列表
  85. *
  86. * @param idList
  87. * @return
  88. */
  89. List<RoleEntity> getListByIds(List<String> idList);
  90. /**
  91. * 根据id查询角色列表
  92. *
  93. * @param idList
  94. * @return
  95. */
  96. List<RoleEntity> getListByIds(Pagination pagination, List<String> idList);
  97. Map<String, Object> getRoleMap();
  98. /**
  99. * 角色编码/name.id
  100. *
  101. * @return
  102. */
  103. Map<String, Object> getRoleNameAndIdMap();
  104. Map<String, Object> getRoleNameAndIdMap(boolean enabledMark);
  105. /**
  106. * 获取角色实体
  107. *
  108. * @param fullName 角色名称
  109. * @return 角色对象
  110. */
  111. RoleEntity getInfoByFullName(String fullName);
  112. /**
  113. * 获取当前用户的默认组织下的所有角色集合
  114. *
  115. * @return 角色对象集合
  116. */
  117. List<RoleEntity> getCurRolesByOrgId();
  118. /**
  119. * 根据id集合
  120. *
  121. * @param idList ID集合
  122. * @param filterEnabledMark
  123. */
  124. List<RoleEntity> getList(List<String> idList, Pagination pagination, boolean filterEnabledMark);
  125. /**
  126. * 统计用户角色的用户数
  127. *
  128. * @return
  129. */
  130. Map<String, Integer> roleUserCount();
  131. /**
  132. * 获取用户角色列表
  133. *
  134. * @param userId
  135. * @return
  136. */
  137. List<RoleEntity> getUserRoles(String userId);
  138. /**
  139. * 联动修改角色约束
  140. *
  141. * @param id
  142. * @param posConModel
  143. */
  144. void linkUpdate(String id, PosConModel posConModel);
  145. }