组织架构图,回溯详细信息

pull/192/head
dxfeng 2 years ago
parent c61a071746
commit 62b25d6a65

@ -131,10 +131,10 @@ public class ChartServiceImpl extends Service implements ChartService {
String isVirtual = Util.null2String(params.get("fisvitual")); String isVirtual = Util.null2String(params.get("fisvitual"));
showVirtual = "1".equals(isVirtual); showVirtual = "1".equals(isVirtual);
//版本id //版本id
String id = Util.null2String(params.get("id")); String versionId = Util.null2String(params.get("id"));
// 初始化表名 // 初始化表名
initTableNameByClass(dimension, id); initTableNameByClass(dimension, versionId);
String ids = (String) params.get("ids"); String ids = (String) params.get("ids");
List<ChartPO> dataList = new ArrayList<>(); List<ChartPO> dataList = new ArrayList<>();
@ -146,28 +146,17 @@ public class ChartServiceImpl extends Service implements ChartService {
if (s.contains("_")) { if (s.contains("_")) {
String fObjId = s.split("_")[1]; String fObjId = s.split("_")[1];
if (s.startsWith("s")) { if (s.startsWith("s")) {
if (hasVirtualFields) { if (isRealTime) {
if (showVirtual) { rs.executeQuery(getRealTimeChildSql("", "1", fObjId));
rs.executeQuery("select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid where (a.canceled is null or a.canceled != '1') and a.supsubcomid = '" + fObjId + "'" +
" union select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual from " + DEPARTMENT_TABLE + " a left join " + DEPARTMENT_DEFINED_TABLE + " b on a.id = b.deptid where (a.canceled is null or a.canceled != '1') and (a.supdepid is null or a.supdepid = '0') and subcompanyid1 = '" + fObjId + "'");
} else {
rs.executeQuery("select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid where (a.canceled is null or a.canceled != '1') and (b.fblx is null or b.fblx != '1') and a.supsubcomid = '" + fObjId + "'" +
" union select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual from " + DEPARTMENT_TABLE + " a left join " + DEPARTMENT_DEFINED_TABLE + " b on a.id = b.deptid where (a.canceled is null or a.canceled != '1') and (a.supdepid is null or a.supdepid = '0') and (b.bmlx is null or b.bmlx != '1') and subcompanyid1 = '" + fObjId + "'");
}
} else { } else {
rs.executeQuery("select a.id,a.subcompanyname as name,'1' as type from " + SUB_COMPANY_TABLE + " a where (canceled is null or canceled != '1') and supsubcomid = '" + fObjId + "'" + rs.executeQuery(getLastTimeChildSql("", "1", fObjId, versionId));
" union select a.id,a.departmentname as name,'2' as type from " + DEPARTMENT_TABLE + " a where (canceled is null or canceled != '1') and (supdepid is null or supdepid = '0') and subcompanyid1 = '" + fObjId + "'");
} }
} else if (s.startsWith("d")) { } else if (s.startsWith("d")) {
if (hasVirtualFields) { if (isRealTime) {
if (showVirtual) { rs.executeQuery(getRealTimeChildSql("", "2", fObjId));
rs.executeQuery("select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual from " + DEPARTMENT_TABLE + " a left join " + DEPARTMENT_DEFINED_TABLE + " b on a.id = b.deptid where (a.canceled is null or a.canceled != '1') and supdepid = '" + fObjId + "'");
} else {
rs.executeQuery("select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual from " + DEPARTMENT_TABLE + " a left join hrmdepartmentdefined b on a.id = b.deptid where (canceled is null or canceled != '1') and (b.bmlx is null or b.bmlx != '1') and a.supdepid = '" + fObjId + "'");
}
} else { } else {
rs.executeQuery("select a.id,a.departmentname as name,'2' as type from " + DEPARTMENT_TABLE + " a where (canceled is null or canceled != '1') and supdepid = '" + fObjId + "'"); rs.executeQuery(getLastTimeChildSql("", "2", fObjId, versionId));
} }
} }
while (rs.next()) { while (rs.next()) {
@ -524,7 +513,7 @@ public class ChartServiceImpl extends Service implements ChartService {
if (showVirtual) { if (showVirtual) {
sql = "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual from " + DEPARTMENT_TABLE + " a where (a.canceled is null or a.canceled != '1') and supdepartmentid = '" + fObjId + "' and versionid = " + versionId; sql = "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual from " + DEPARTMENT_TABLE + " a where (a.canceled is null or a.canceled != '1') and supdepartmentid = '" + fObjId + "' and versionid = " + versionId;
} else { } else {
sql = "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual from " + DEPARTMENT_TABLE + " where (canceled is null or canceled != '1') and (isvirtual is null or isvirtual != '1') and a.supdepartmentid = '" + fObjId + "' and versionid = " + versionId; sql = "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual from " + DEPARTMENT_TABLE + " a where (canceled is null or canceled != '1') and (isvirtual is null or isvirtual != '1') and a.supdepartmentid = '" + fObjId + "' and versionid = " + versionId;
} }
} else { } else {
sql = "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type from " + DEPARTMENT_TABLE + " a where (canceled is null or canceled != '1') and supdepartmentid = '" + fObjId + "' and versionid = " + versionId; sql = "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type from " + DEPARTMENT_TABLE + " a where (canceled is null or canceled != '1') and supdepartmentid = '" + fObjId + "' and versionid = " + versionId;
@ -682,6 +671,9 @@ public class ChartServiceImpl extends Service implements ChartService {
* @return * @return
*/ */
private String getDepartmentLeader(String ids) { private String getDepartmentLeader(String ids) {
if (!isRealTime) {
return ids;
}
if (StringUtils.isBlank(ids)) { if (StringUtils.isBlank(ids)) {
return ""; return "";
} }

Loading…
Cancel
Save