|
@@ -222,6 +222,28 @@ public class SystemService {
|
|
|
* @title 根据id查询部门
|
|
|
* @description 获取所有的部门
|
|
|
*/
|
|
|
+ public List<Integer> getDutyDeparts(Integer personId) {
|
|
|
+ List<Integer> ids =new ArrayList<>();
|
|
|
+ LambdaQueryWrapper<Department> queryWrapper1 =new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.select(Department::getId);
|
|
|
+ queryWrapper1.in(Department::getCreateUser,personId);
|
|
|
+ List<Map<String,Object>> mapList =new ArrayList<>();
|
|
|
+ java.util.function.Function <Object,Integer> f = (o -> Integer.parseInt(o.toString())) ;
|
|
|
+ List<Integer> departIds = departmentService.listObjs(queryWrapper1,f);
|
|
|
+ if(departIds.size()==0){
|
|
|
+ return ids;
|
|
|
+ }
|
|
|
+ List<Integer> childIds =departmentService.getBaseMapper().getChildIds(departIds);
|
|
|
+ ids.addAll(departIds);
|
|
|
+ ids.addAll(childIds);
|
|
|
+ return ids;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @author 李仁杰
|
|
|
+ * @title 根据id查询部门
|
|
|
+ * @description 获取所有的部门
|
|
|
+ */
|
|
|
public List<Map<String,Object>> getDeparts(List<Integer> departIds) {
|
|
|
LambdaQueryWrapper<Department> queryWrapper1 =new LambdaQueryWrapper<>();
|
|
|
queryWrapper1.in(Department::getId,departIds);
|