|
|
|
@ -57,19 +57,15 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getCompanyData(Map<String, Object> request2Map, User user) {
|
|
|
|
|
private String companyDateWhereSql(Map<String, Object> request2Map) {
|
|
|
|
|
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 root = (String) request2Map.get("root"); // 根节点
|
|
|
|
|
String level = (String) request2Map.get("level"); // 显示层级
|
|
|
|
|
if(StringUtils.isBlank(level)) {
|
|
|
|
|
level = "3";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String fisvitual = (String) request2Map.get("fisvitual"); // 是否显示虚拟组织
|
|
|
|
|
if(StringUtils.isBlank(fisvitual)) {
|
|
|
|
@ -87,6 +83,18 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
whereSql += " and ftype in (0 , 1 ,2) ";
|
|
|
|
|
return whereSql;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getCompanyData(Map<String, Object> request2Map, User user) {
|
|
|
|
|
|
|
|
|
|
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)) { // 集团的情况
|
|
|
|
@ -95,8 +103,6 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
whereItemSql += " and id = '" + root +"' ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取根节点
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
rs.executeQuery("select id, fname, ftype, fparentid, fnumber from jcl_org_map " + whereSql + whereItemSql);
|
|
|
|
@ -153,19 +159,14 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getUserData(Map<String, Object> request2Map, User user) {
|
|
|
|
|
private String userWhereSql(Map<String, Object> request2Map) {
|
|
|
|
|
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 root = (String) request2Map.get("root"); // 根节点
|
|
|
|
|
String level = (String) request2Map.get("level"); // 显示层级
|
|
|
|
|
if(StringUtils.isBlank(level)) {
|
|
|
|
|
level = "3";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String fisvitual = (String) request2Map.get("fisvitual"); // 是否显示虚拟组织
|
|
|
|
|
if(StringUtils.isBlank(fisvitual)) {
|
|
|
|
@ -181,6 +182,18 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
}else {
|
|
|
|
|
whereSql += " and t.fisvitual in (0, 1) ";
|
|
|
|
|
}
|
|
|
|
|
return whereSql;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getUserData(Map<String, Object> request2Map, User user) {
|
|
|
|
|
String root = (String) request2Map.get("root"); // 根节点
|
|
|
|
|
String level = (String) request2Map.get("level"); // 显示层级
|
|
|
|
|
if(StringUtils.isBlank(level)) {
|
|
|
|
|
level = "3";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String whereSql = userWhereSql(request2Map);
|
|
|
|
|
|
|
|
|
|
String whereItemSql = " ";
|
|
|
|
|
if("0".equals(root)) { // 集团的情况
|
|
|
|
@ -226,31 +239,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> asyncUserData(Map<String, Object> request2Map, User user) {
|
|
|
|
|
String ids = (String) request2Map.get("ids");
|
|
|
|
|
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 level = (String) request2Map.get("level"); // 显示层级
|
|
|
|
|
if(StringUtils.isBlank(level)) {
|
|
|
|
|
level = "3";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String fisvitual = (String) request2Map.get("fisvitual"); // 是否显示虚拟组织
|
|
|
|
|
if(StringUtils.isBlank(fisvitual)) {
|
|
|
|
|
fisvitual = "0";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String whereSql = " where 1 = 1 ";
|
|
|
|
|
whereSql += " and ((t.fdatebegin <= '"+ date +"' and t.fdateend >= '"+ date +"') or (t.fdatebegin <= '"+ date +"' and t.fdateend is null )) ";
|
|
|
|
|
whereSql += " and t.fclass = " + fclass +" ";
|
|
|
|
|
|
|
|
|
|
if("0".equals(fisvitual)) {
|
|
|
|
|
whereSql += " and t.fisvitual = 0 ";
|
|
|
|
|
}else {
|
|
|
|
|
whereSql += " and t.fisvitual in (0, 1) ";
|
|
|
|
|
}
|
|
|
|
|
String whereSql = userWhereSql(request2Map);
|
|
|
|
|
|
|
|
|
|
whereSql += " and fparentid in (" +ids+ ") ";
|
|
|
|
|
|
|
|
|
@ -300,32 +289,8 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> asyncCompanyData(Map<String, Object> request2Map, User user) {
|
|
|
|
|
String ids = (String) request2Map.get("ids");
|
|
|
|
|
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 root = (String) request2Map.get("root"); // 根节点
|
|
|
|
|
String level = (String) request2Map.get("level"); // 显示层级
|
|
|
|
|
if(StringUtils.isBlank(level)) {
|
|
|
|
|
level = "3";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String fisvitual = (String) request2Map.get("fisvitual"); // 是否显示虚拟组织
|
|
|
|
|
if(StringUtils.isBlank(fisvitual)) {
|
|
|
|
|
fisvitual = "0";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String whereSql = " where 1 = 1 ";
|
|
|
|
|
whereSql += " and ((fdatebegin <= '"+ date +"' and fdateend >= '"+ date +"') or (fdatebegin <= '"+ date +"' and fdateend is null )) ";
|
|
|
|
|
whereSql += " and fclass = " + fclass +" ";
|
|
|
|
|
String whereSql = companyDateWhereSql(request2Map);
|
|
|
|
|
|
|
|
|
|
if("0".equals(fisvitual)) {
|
|
|
|
|
whereSql += " and fisvitual = 0 ";
|
|
|
|
|
}else {
|
|
|
|
|
whereSql += " and fisvitual in (0, 1) ";
|
|
|
|
|
}
|
|
|
|
|
whereSql += " and fparentid in (" +ids+ ") ";
|
|
|
|
|
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|