DeptService.java 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /*
  2. * Copyright 2019-2020 Zheng Jie
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package me.zhengjie.modules.system.service;
  17. import me.zhengjie.modules.dm.user.service.dto.DmUserQueryCriteria;
  18. import me.zhengjie.modules.system.domain.Dept;
  19. import me.zhengjie.modules.system.service.dto.DeptDto;
  20. import me.zhengjie.modules.system.service.dto.DeptQueryCriteria;
  21. import me.zhengjie.modules.system.service.dto.DeptQueryNoAuthCriteria;
  22. import org.springframework.data.domain.Pageable;
  23. import javax.servlet.http.HttpServletResponse;
  24. import java.io.IOException;
  25. import java.util.List;
  26. import java.util.Map;
  27. import java.util.Set;
  28. /**
  29. * @author Zheng Jie
  30. * @date 2019-03-25
  31. */
  32. public interface DeptService {
  33. /**
  34. * 查询所有数据
  35. * @param criteria 条件
  36. * @param isQuery /
  37. * @throws Exception /
  38. * @return /
  39. */
  40. List<DeptDto> queryAll2(DeptQueryCriteria criteria, String[] sort, Boolean isQuery) throws Exception;
  41. /**
  42. * 查询所有数据
  43. * @param criteria 条件
  44. * @param isQuery /
  45. * @throws Exception /
  46. * @return /
  47. */
  48. List<DeptDto> queryAll(DeptQueryCriteria criteria, Boolean isQuery) throws Exception;
  49. /**
  50. * 查询所有数据
  51. * @param criteria 条件
  52. * @return /
  53. */
  54. List<DeptDto> queryAll(DeptQueryNoAuthCriteria criteria) throws Exception;
  55. /**
  56. * 查询数据分页
  57. * @param criteria 条件
  58. * @param pageable 分页参数
  59. * @return Map<String,Object>
  60. */
  61. Map<String,Object> queryAll(DeptQueryNoAuthCriteria criteria, Pageable pageable);
  62. /**
  63. * 根据ID查询
  64. * @param id /
  65. * @return /
  66. */
  67. DeptDto findById(String id);
  68. /**
  69. * 创建
  70. * @param resources /
  71. */
  72. void create(Dept resources);
  73. /**
  74. * 创建
  75. * @param resources /
  76. */
  77. void syncCreate(Dept resources);
  78. /**
  79. * 编辑
  80. * @param resources /
  81. */
  82. void update(Dept resources);
  83. /**
  84. * 删除
  85. * @param deptDtos /
  86. *
  87. */
  88. void delete(Set<DeptDto> deptDtos);
  89. /**
  90. * 根据PID查询
  91. * @param pid /
  92. * @return /
  93. */
  94. List<Dept> findByPid(String pid);
  95. /**
  96. * 根据角色ID查询
  97. * @param id /
  98. * @return /
  99. */
  100. Set<Dept> findByRoleId(String id);
  101. /**
  102. * 导出数据
  103. * @param queryAll 待导出的数据
  104. * @param response /
  105. * @throws IOException /
  106. */
  107. void download(List<DeptDto> queryAll, HttpServletResponse response) throws IOException;
  108. /**
  109. * 获取待删除的部门
  110. * @param deptList /
  111. * @param deptDtos /
  112. * @return /
  113. */
  114. Set<DeptDto> getDeleteDepts(List<Dept> deptList, Set<DeptDto> deptDtos);
  115. /**
  116. * 根据ID获取同级与上级数据
  117. * @param deptDto /
  118. * @param depts /
  119. * @return /
  120. */
  121. List<DeptDto> getSuperior(DeptDto deptDto, List<Dept> depts);
  122. /**
  123. * 构建树形数据
  124. * @param deptDtos /
  125. * @return /
  126. */
  127. Object buildTree(List<DeptDto> deptDtos);
  128. /**
  129. * 获取
  130. * @param deptList
  131. * @return
  132. */
  133. List<String> getDeptChildren(List<Dept> deptList);
  134. /**
  135. * 验证是否被角色或用户关联
  136. * @param deptDtos /
  137. */
  138. void verification(Set<DeptDto> deptDtos);
  139. /**
  140. * 查询所有数据
  141. * @return /
  142. */
  143. List<DeptDto> getAllDept() throws Exception;
  144. }