feature/dxf #192

Merged
dxfeng merged 2 commits from feature/dxf into develop 2 years ago

@ -131,10 +131,10 @@ public class ChartServiceImpl extends Service implements ChartService {
String isVirtual = Util.null2String(params.get("fisvitual"));
showVirtual = "1".equals(isVirtual);
//版本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");
List<ChartPO> dataList = new ArrayList<>();
@ -146,28 +146,17 @@ public class ChartServiceImpl extends Service implements ChartService {
if (s.contains("_")) {
String fObjId = s.split("_")[1];
if (s.startsWith("s")) {
if (hasVirtualFields) {
if (showVirtual) {
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 + "'");
}
if (isRealTime) {
rs.executeQuery(getRealTimeChildSql("", "1", fObjId));
} 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 + "'" +
" 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 + "'");
rs.executeQuery(getLastTimeChildSql("", "1", fObjId, versionId));
}
} else if (s.startsWith("d")) {
if (hasVirtualFields) {
if (showVirtual) {
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 + "'");
}
if (isRealTime) {
rs.executeQuery(getRealTimeChildSql("", "2", fObjId));
} 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()) {
@ -208,7 +197,7 @@ public class ChartServiceImpl extends Service implements ChartService {
String detauleType = Util.null2String(params.get("detauleType"));
if (!"chart".equals(detauleType)) {
// 展示列表模块
return ServiceUtil.getService(HrmResourceServiceImpl.class, user).chartResourceList(Integer.parseInt(departmentId),versionId,dimension);
return ServiceUtil.getService(HrmResourceServiceImpl.class, user).chartResourceList(Integer.parseInt(departmentId), versionId, dimension);
}
@ -257,7 +246,7 @@ public class ChartServiceImpl extends Service implements ChartService {
// 查询部门下的岗位
if (isRealTime) {
sql = "select a.id,a.jobtitlename as name from hrmjobtitles a inner join jcl_org_job b on a.id = b.ec_jobtitle where b.ec_department = '" + departmentId + "'";
}else{
} else {
sql = "select jobid as id ,jobname as name from jcl_chart_job where departmentid = '" + departmentId + "' and versionid = " + versionId;
}
rs.executeQuery(sql);
@ -501,7 +490,7 @@ public class ChartServiceImpl extends Service implements ChartService {
} else {
sql = "select " + SUB_COMPANY_ID + " as id,a.subcompanyname as name,'1' as type from " + SUB_COMPANY_TABLE + " a where (a.canceled is null or a.canceled != '1') and (a.supsubcompanyid is null or a.supsubcompanyid = '0') and versionid = " + versionId;
}
if(!isRealDimension){
if (!isRealDimension) {
sql += " and companyid = " + fObjId;
}
break;
@ -524,7 +513,7 @@ public class ChartServiceImpl extends Service implements ChartService {
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;
} 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 {
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;
@ -544,14 +533,14 @@ public class ChartServiceImpl extends Service implements ChartService {
* @param dataList
* @param selectDepth
*/
private void findChildData(ChartPO topChartPO, List<ChartPO> dataList, Integer selectDepth,String versionId) {
private void findChildData(ChartPO topChartPO, List<ChartPO> dataList, Integer selectDepth, String versionId) {
String fType = topChartPO.getFtype();
String fObjId = topChartPO.getFobjid();
String sql = "";
if (isRealTime) {
sql = getRealTimeChildSql(sql, fType, fObjId);
} else {
sql = getLastTimeChildSql(sql, fType, fObjId,versionId);
sql = getLastTimeChildSql(sql, fType, fObjId, versionId);
}
if (StringUtils.isNotBlank(sql)) {
@ -573,7 +562,7 @@ public class ChartServiceImpl extends Service implements ChartService {
}
for (ChartPO chartPO : currentList) {
if (inDepth(selectDepth, chartPO.getDepartmentDepth())) {
findChildData(chartPO, dataList, selectDepth,versionId);
findChildData(chartPO, dataList, selectDepth, versionId);
}
}
dataList.addAll(currentList);
@ -682,6 +671,9 @@ public class ChartServiceImpl extends Service implements ChartService {
* @return
*/
private String getDepartmentLeader(String ids) {
if (!isRealTime) {
return ids;
}
if (StringUtils.isBlank(ids)) {
return "";
}

Loading…
Cancel
Save