|
|
|
@ -43,10 +43,8 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
fclasslist.add(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rs.executeQuery("select id, fnumber, fname from jcl_org_map where ftype in (0, 1) order by ftype , id ");
|
|
|
|
|
rs.executeQuery("select distinct id, fnumber, fname, ftype from jcl_org_map where ftype in (0, 1) order by ftype , id ");
|
|
|
|
|
List<Map<String, Object>> companylist = new ArrayList<>();
|
|
|
|
|
Map<String, Object> defaultCompanyItem = new HashMap<>();
|
|
|
|
|
companylist.add(defaultCompanyItem);
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
Map<String, Object> item = new HashMap<>();
|
|
|
|
|
item.put("id", rs.getString("id"));
|
|
|
|
@ -134,9 +132,11 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
list.add(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int currentLevel = 0;
|
|
|
|
|
int currentLevel = 1;
|
|
|
|
|
if (currentLevel + 1 <= Integer.parseInt(level)) {
|
|
|
|
|
findCompanyItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, true);
|
|
|
|
|
} else {
|
|
|
|
|
findCompanyItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.put("api_status", true);
|
|
|
|
@ -227,7 +227,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
|
|
|
|
|
// 获取根节点
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
rs.executeQuery("select t.id, t.fname, t.ftype, t.fparentid, t.fleadername,t.fobjid,t.fecid, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber, t.fleader from jcl_org_map t " + whereSql + whereItemSql);
|
|
|
|
|
rs.executeQuery("select t.id, t.fname, t.ftype, t.fparentid, t.fleadername,t.fobjid,t.fecid, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber, t.fleader, t.fleaderlv, t.fleaderst,t.fecid from jcl_org_map t " + whereSql + whereItemSql);
|
|
|
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
|
|
|
String id = null;
|
|
|
|
|
if (rs.next()) {
|
|
|
|
@ -247,12 +247,17 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
item.put("fnumber", rs.getString("fnumber"));
|
|
|
|
|
item.put("fleader", rs.getString("fleader"));
|
|
|
|
|
item.put("fobjid",rs.getString("fobjid"));
|
|
|
|
|
item.put("fleaderlv",rs.getString("fleaderlv"));
|
|
|
|
|
item.put("fleaderst",rs.getString("fleaderst"));
|
|
|
|
|
item.put("fecid",rs.getString("fecid"));
|
|
|
|
|
list.add(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int currentLevel = 1;
|
|
|
|
|
if (currentLevel + 1 <= Integer.parseInt(level)) {
|
|
|
|
|
findUserItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, true);
|
|
|
|
|
}else{
|
|
|
|
|
findUserItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.put("api_status", true);
|
|
|
|
@ -268,7 +273,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
whereSql += " and fparentid in (" + ids + ") ";
|
|
|
|
|
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
rs.executeQuery("select t.id, t.fname, t.ftype, t.fparentid, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber, t.fleader from jcl_org_map t " + whereSql);
|
|
|
|
|
rs.executeQuery("select t.id, t.fname, t.ftype, t.fparentid, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber, t.fleader,t.fleaderlv, t.fleaderst,t.fobjid from jcl_org_map t " + whereSql);
|
|
|
|
|
List<Map<String, Object>> currentList = new ArrayList<>();
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
Map<String, Object> item = new HashMap<>();
|
|
|
|
@ -284,6 +289,9 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
item.put("fnumber", rs.getString("fnumber"));
|
|
|
|
|
item.put("hasChildren", hasChildren(rs.getString("id"), false));
|
|
|
|
|
item.put("fleader", rs.getString("fleader"));
|
|
|
|
|
item.put("fleaderlv",rs.getString("fleaderlv"));
|
|
|
|
|
item.put("fleaderst",rs.getString("fleaderst"));
|
|
|
|
|
item.put("fobjid",rs.getString("fobjid"));
|
|
|
|
|
currentList.add(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -319,7 +327,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
whereSql += " and fparentid in (" + ids + ") ";
|
|
|
|
|
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
rs.executeQuery("select id, fname, ftype, fparentid, fnumber from jcl_org_map " + whereSql);
|
|
|
|
|
rs.executeQuery("select id, fname, ftype, fparentid, fnumber,fobjid from jcl_org_map " + whereSql);
|
|
|
|
|
List<Map<String, Object>> currentList = new ArrayList<>();
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
Map<String, Object> item = new HashMap<>();
|
|
|
|
@ -328,6 +336,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
item.put("ftype", rs.getString("ftype"));
|
|
|
|
|
item.put("parentId", rs.getString("fparentid"));
|
|
|
|
|
item.put("fnumber", rs.getString("fnumber"));
|
|
|
|
|
item.put("fobjid", rs.getString("fobjid"));
|
|
|
|
|
item.put("hasChildren", hasChildren(rs.getString("id"), true));
|
|
|
|
|
currentList.add(item);
|
|
|
|
|
}
|
|
|
|
@ -340,7 +349,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.fleader, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber,t.fobjid,fecid from jcl_org_map t " + whereSql + " and t.fparentid = " + id);
|
|
|
|
|
rs.executeQuery("select t.id, t.fname, t.ftype, t.fparentid,t.fobjparentid,t.fleader, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber,t.fobjid,t.fecid,t.fleaderlv, t.fleaderst from jcl_org_map t " + whereSql + " and t.fparentid = " + id);
|
|
|
|
|
List<Map<String, Object>> currentList = new ArrayList<>();
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
Map<String, Object> item = new HashMap<>();
|
|
|
|
@ -348,6 +357,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
item.put("fname", rs.getString("fname"));
|
|
|
|
|
item.put("ftype", rs.getString("ftype"));
|
|
|
|
|
item.put("parentId", rs.getString("fparentid"));
|
|
|
|
|
item.put("fobjparentId", rs.getString("fobjparentid"));
|
|
|
|
|
item.put("fleadername", rs.getString("fleadername"));
|
|
|
|
|
item.put("fleaderimg", rs.getString("fleaderimg"));
|
|
|
|
|
item.put("fleaderjob", rs.getString("fleaderjob"));
|
|
|
|
@ -358,6 +368,8 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
item.put("fobjid", rs.getString("fobjid"));
|
|
|
|
|
item.put("fecid", rs.getString("fecid"));
|
|
|
|
|
item.put("fleader", rs.getString("fleader"));
|
|
|
|
|
item.put("fleaderlv", rs.getString("fleaderlv"));
|
|
|
|
|
item.put("fleaderst", rs.getString("fleaderst"));
|
|
|
|
|
item.put("hasChildren", hasChildren(rs.getString("id"), false));
|
|
|
|
|
currentList.add(item);
|
|
|
|
|
}
|
|
|
|
|