|
|
|
@ -21,14 +21,24 @@ import java.util.*;
|
|
|
|
|
public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
|
|
|
|
|
private RecordSet grs = new RecordSet();
|
|
|
|
|
private static final String RIGHT_NAME = "OrgChart:All";
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getOptionCondition(Map<String, Object> request2Map, User user) {
|
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
String type = (String) request2Map.get("type");
|
|
|
|
|
String rightName = "OrgChart:All";
|
|
|
|
|
// 组织透视
|
|
|
|
|
if ("user".equals(type)) {
|
|
|
|
|
rightName = "OrgPerspective:All";
|
|
|
|
|
}
|
|
|
|
|
boolean hasRight = HasRightUtil.hasRight(user, rightName, true);
|
|
|
|
|
result.put("hasRight", hasRight);
|
|
|
|
|
if (!hasRight) {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rs.executeQuery("select id, companyname from HrmCompanyVirtual order by id");
|
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
List<Map<String, Object>> fclasslist = new ArrayList<>();
|
|
|
|
|
Map<String, Object> defaultItem = new HashMap<>();
|
|
|
|
|
defaultItem.put("id", "0");
|
|
|
|
@ -323,13 +333,6 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getHasRight() {
|
|
|
|
|
Map<String, Object> returnMap = new HashMap<>();
|
|
|
|
|
boolean hasRight = HasRightUtil.hasRight(user, RIGHT_NAME, true);
|
|
|
|
|
returnMap.put("hasRight", hasRight);
|
|
|
|
|
return returnMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void findUserItemByParantId(String id, int currentLevel, String level, RecordSet rs, List<Map<String, Object>> list, String whereSql, boolean expand) {
|
|
|
|
|
rs.executeQuery("select t.id, t.fname, t.ftype, t.fparentid, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber from jcl_org_map t " + whereSql + " and t.fparentid = " + id);
|
|
|
|
|