use of io.github.ihongs.serv.master.Dept in project HongsCORE by ihongs.
the class AuthKit method getMoreDepts.
/**
* 获取所在的下级分组
* @param uid
* @return
* @throws HongsException
*/
public static Set getMoreDepts(String uid) throws HongsException {
Table rel = DB.getInstance("master").getTable("dept_user");
List<Map> lst = rel.fetchCase().filter("user_id = ?", uid).select("dept_id").getAll();
Set set = new HashSet();
Dept dp = new Dept();
for (Map row : lst) {
String id = (String) row.get("dept_id");
set.addAll(dp.getChildIds(id, true));
}
return set;
}
use of io.github.ihongs.serv.master.Dept in project HongsCORE by ihongs.
the class AuthKit method getLessDepts.
/**
* 获取所在的顶层分组
* @param deptIds
* @return
* @throws HongsException
*/
public static Set getLessDepts(Set<String> deptIds) throws HongsException {
Set set = new TreeSet();
Dept dp = new Dept();
for (String id : deptIds) {
set.add(getDeptPath(id, dp));
}
return getPeakPids(set);
}
use of io.github.ihongs.serv.master.Dept in project HongsCORE by ihongs.
the class AuthKit method getLessDepts.
/**
* 获取所在的顶层分组
* @param uid
* @return
* @throws HongsException
*/
public static Set getLessDepts(String uid) throws HongsException {
Table rel = DB.getInstance("master").getTable("dept_user");
List<Map> lst = rel.fetchCase().filter("user_id = ?", uid).select("dept_id").getAll();
Set set = new TreeSet();
Dept dp = new Dept();
for (Map row : lst) {
String id = (String) row.get("dept_id");
set.add(getDeptPath(id, dp));
}
return getPeakPids(set);
}
use of io.github.ihongs.serv.master.Dept in project HongsCORE by ihongs.
the class AuthKit method getMoreDepts.
/**
* 获取所在的下级分组
* @param deptIds
* @return
* @throws HongsException
*/
public static Set getMoreDepts(Set<String> deptIds) throws HongsException {
Set set = new HashSet();
Dept dp = new Dept();
for (String id : deptIds) {
set.addAll(dp.getChildIds(id, true));
}
return set;
}