|
|
|
@ -63,6 +63,9 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|
|
|
|
|
|
|
|
|
String depth = Util.null2String(params.get("level"));
|
|
|
|
|
|
|
|
|
|
//版本id
|
|
|
|
|
String id = Util.null2String(params.get("id"));
|
|
|
|
|
|
|
|
|
|
// 初始化表名
|
|
|
|
|
initTableNameByClass(dimension);
|
|
|
|
|
|
|
|
|
@ -71,8 +74,13 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|
|
|
|
String sql = "";
|
|
|
|
|
|
|
|
|
|
ChartPO topChartPO = null;
|
|
|
|
|
//TODO 查询当前实际数据
|
|
|
|
|
sql = getRealTimeTopSql(root, dimension);
|
|
|
|
|
//查询当前实际数据
|
|
|
|
|
if("0".equals(id)){
|
|
|
|
|
sql = getRealTimeTopSql(root, dimension);
|
|
|
|
|
}else {
|
|
|
|
|
sql = getLastTimeTopSql(root,dimension,id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rs.executeQuery(sql);
|
|
|
|
|
|
|
|
|
|
// 封装顶部节点
|
|
|
|
@ -99,6 +107,8 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> asyncCompanyData(Map<String, Object> params) {
|
|
|
|
|
|
|
|
|
@ -307,6 +317,38 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String selectVersionDate(String id) {
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
rs.executeQuery("select recorddate from jcl_org_chartversion where id = ?",id);
|
|
|
|
|
rs.next();
|
|
|
|
|
return rs.getString("recorddate");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取历史顶部元素sql
|
|
|
|
|
* @param root
|
|
|
|
|
* @param dimension 维度ID
|
|
|
|
|
* @param vesionId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private String getLastTimeTopSql(String root, String dimension, String vesionId) {
|
|
|
|
|
if ("0".equals(root)) {
|
|
|
|
|
//查询集团维度历史版本
|
|
|
|
|
if ("0".equals(dimension)) {
|
|
|
|
|
//组织维度
|
|
|
|
|
return "select id,companyname as name,'0' as type from hrmcompany";
|
|
|
|
|
} else {
|
|
|
|
|
//查询其他维度集团版本信息
|
|
|
|
|
return "select id,companyname as name,'0' as type from jcl_chart_companyvirtual where " +
|
|
|
|
|
" versionid = "+vesionId+" and companyvirtualid = "+dimension;
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
return "select id,subcompanyname as name,'1' as type from jcl_chart_subcompanyvirtual where " +
|
|
|
|
|
" versionid= "+vesionId+" and subcompanyvirtualid"+root;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询实时数据,顶级元素SQL
|
|
|
|
|
*
|
|
|
|
|