|
|
|
@ -42,15 +42,17 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
public Map<String, Object> getOptionCondition(Map<String, Object> request2Map, User user) {
|
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
|
|
|
|
|
rs.executeQuery("select id, companyname from HrmCompanyVirtual order by id");
|
|
|
|
|
List<Map<String, Object>> fclasslist = new ArrayList<>();
|
|
|
|
|
Map<String, Object> defaultItem = new HashMap<>();
|
|
|
|
|
int fkey = 0;
|
|
|
|
|
defaultItem.put("key",fkey++);
|
|
|
|
|
defaultItem.put("id", "0");
|
|
|
|
|
defaultItem.put("companyname", "行政维度");
|
|
|
|
|
fclasslist.add(defaultItem);
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
Map<String, Object> item = new HashMap<>();
|
|
|
|
|
item.put("key",fkey++);
|
|
|
|
|
item.put("id", rs.getString("id"));
|
|
|
|
|
item.put("companyname", rs.getString("companyname"));
|
|
|
|
|
fclasslist.add(item);
|
|
|
|
@ -69,8 +71,10 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
}
|
|
|
|
|
rs.executeQuery(sql + " and fdateend > " + DBType.get(new RecordSet().getDBType()).currentDate() + " order by ftype , id,fdateend desc ");
|
|
|
|
|
Set<OrgSelectItem> companySet = new HashSet<>();
|
|
|
|
|
int ckey = 0;
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
OrgSelectItem item = new OrgSelectItem();
|
|
|
|
|
item.setKey(ckey++);
|
|
|
|
|
item.setId(rs.getString("id"));
|
|
|
|
|
item.setFnumber(rs.getString("fnumber"));
|
|
|
|
|
item.setFname(rs.getString("fname"));
|
|
|
|
@ -83,15 +87,12 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String companyDateWhereSql(Map<String, Object> request2Map) {
|
|
|
|
|
String date = (String) request2Map.get("date"); // 数据日期
|
|
|
|
|
String date = (String) request2Map.get("date");
|
|
|
|
|
if (StringUtils.isBlank(date)) {
|
|
|
|
|
date = DateUtil.format(DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, 1), "yyyy-MM-dd");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String fclass = (String) request2Map.get("fclass"); // 维度
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String fisvitual = (String) request2Map.get("fisvitual"); // 是否显示虚拟组织
|
|
|
|
|
String fclass = (String) request2Map.get("fclass");
|
|
|
|
|
String fisvitual = (String) request2Map.get("fisvitual");
|
|
|
|
|
if (StringUtils.isBlank(fisvitual)) {
|
|
|
|
|
fisvitual = "0";
|
|
|
|
|
}
|
|
|
|
@ -123,15 +124,15 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String root = (String) request2Map.get("root"); // 根节点
|
|
|
|
|
String level = (String) request2Map.get("level"); // 显示层级
|
|
|
|
|
String root = (String) request2Map.get("root");
|
|
|
|
|
String level = (String) request2Map.get("level");
|
|
|
|
|
if (StringUtils.isBlank(level)) {
|
|
|
|
|
level = "3";
|
|
|
|
|
}
|
|
|
|
|
String whereSql = companyDateWhereSql(request2Map);
|
|
|
|
|
|
|
|
|
|
String whereItemSql = " ";
|
|
|
|
|
if ("0".equals(root)) { // 集团的情况
|
|
|
|
|
if ("0".equals(root)) {
|
|
|
|
|
whereItemSql += " and ftype = 0 ";
|
|
|
|
|
} else {
|
|
|
|
|
whereItemSql += " and id = '" + root + "' ";
|
|
|
|
@ -211,14 +212,14 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String userWhereSql(Map<String, Object> request2Map) {
|
|
|
|
|
String date = (String) request2Map.get("date"); // 数据日期
|
|
|
|
|
String date = (String) request2Map.get("date");
|
|
|
|
|
if (StringUtils.isBlank(date)) {
|
|
|
|
|
date = DateUtil.format(DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, 1), "yyyy-MM-dd");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String fclass = (String) request2Map.get("fclass"); // 维度
|
|
|
|
|
String fclass = (String) request2Map.get("fclass");
|
|
|
|
|
|
|
|
|
|
String fisvitual = (String) request2Map.get("fisvitual"); // 是否显示虚拟组织
|
|
|
|
|
String fisvitual = (String) request2Map.get("fisvitual");
|
|
|
|
|
if (StringUtils.isBlank(fisvitual)) {
|
|
|
|
|
fisvitual = "0";
|
|
|
|
|
}
|
|
|
|
@ -247,8 +248,8 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
if (!hasRight) {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
String root = (String) request2Map.get("root"); // 根节点
|
|
|
|
|
String level = (String) request2Map.get("level"); // 显示层级
|
|
|
|
|
String root = (String) request2Map.get("root");
|
|
|
|
|
String level = (String) request2Map.get("level");
|
|
|
|
|
if (StringUtils.isBlank(level)) {
|
|
|
|
|
level = "3";
|
|
|
|
|
}
|
|
|
|
@ -256,7 +257,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
String whereSql = userWhereSql(request2Map);
|
|
|
|
|
|
|
|
|
|
String whereItemSql = " ";
|
|
|
|
|
if ("0".equals(root)) { // 集团的情况
|
|
|
|
|
if ("0".equals(root)) {
|
|
|
|
|
whereItemSql += " and t.ftype = 0 ";
|
|
|
|
|
} else {
|
|
|
|
|
whereItemSql += " and t.id = '" + root + "' ";
|
|
|
|
@ -618,10 +619,19 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static class OrgSelectItem {
|
|
|
|
|
private Integer key;
|
|
|
|
|
private String id;
|
|
|
|
|
private String fnumber;
|
|
|
|
|
private String fname;
|
|
|
|
|
|
|
|
|
|
public Integer getKey() {
|
|
|
|
|
return key;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setKey(Integer key) {
|
|
|
|
|
this.key = key;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getId() {
|
|
|
|
|
return id;
|
|
|
|
|
}
|
|
|
|
|