Merge branch 'develop' of http://221.226.25.34:3000/liang.cheng/weaver-hrm-organization into feature/dxf
This commit is contained in:
commit
d4a6fb4a28
|
|
@ -29,4 +29,14 @@ public interface ChartService {
|
|||
Map<String, Object> getDepartmentDetail(Map<String, Object> params);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 根据Id获取版本日期
|
||||
* @Author: liang.cheng
|
||||
* @Date: 2023/7/11 2:53 PM
|
||||
* @param: [id]
|
||||
* @return: java.lang.String
|
||||
*/
|
||||
String selectVersionDate(String id);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue