丹尼克尔,人员架构、组织分部图调整

danikor
dxfeng 2 years ago
parent 2b8e3dbb85
commit fb38ba271b

@ -260,10 +260,10 @@ public class DanikorResourceBackServiceImpl extends Service implements DanikorRe
String departmentSql;
if (StringUtils.isNotBlank(syncDate) && !DateUtil.getDate(new Date()).equals(syncDate)) {
subCompanySql = "select t.id, t.subcompanyname, t.supsubcomid, ( select distinct 1 as hasnext from hrmsubcompany_back s where (s.supsubcomid = t.id and (s.CANCELED IS NULL OR s.CANCELED != '1') and s.sync_date = '" + syncDate + "') ) as hassubnext, ( select distinct 1 as hasnext from HrmDepartment_back d where (d.subcompanyid1 = t.id and (d.CANCELED IS NULL OR d.CANCELED != '1') and d.sync_date = '" + syncDate + "')) as hasdeptnext, t.tlevel from hrmsubcompany_back t where (t.canceled IS NULL OR t.canceled != '1') and t.id != t.supsubcomid and tlevel <= 10000 and sync_date = '" + syncDate + "' order by t.supsubcomid, t.showorder, t.subcompanyname";
departmentSql = "select t.id, t.departmentname, t.subcompanyid1, isnull(t.supdepid,0) as supdepid, (case when t.supdepid != 0 and ( select COUNT(id) from hrmdepartment_back where id = t.supdepid and sync_date = '" + syncDate + "')= 0 then 0 else 1 end) as isExist, ( select distinct 1 as hasnext from hrmdepartment_back d where d.supdepid = t.id and (CANCELED IS NULL OR CANCELED != '1') and sync_date = '" + syncDate + "') as hasnext, t.tlevel from hrmdepartment_back t where t.id != ISNULL(t.supdepid, 0) and tlevel <= 10000 and (t.canceled IS NULL OR t.canceled != '1') and (t.canceled IS NULL OR t.canceled != '1') and sync_date = '" + syncDate + "' order by t.subcompanyid1 asc , t.supdepid asc , t.showorder asc, t.departmentname asc";
departmentSql = "select t.id, t.departmentname, t.subcompanyid1, isnull(t.supdepid,0) as supdepid, (case when t.supdepid != 0 and ( select COUNT(id) from hrmdepartment_back where id = t.supdepid and sync_date = '" + syncDate + "')= 0 then 0 else 1 end) as isExist, ( select distinct 1 as hasnext from hrmdepartment_back d where d.supdepid = t.id and (CANCELED IS NULL OR CANCELED != '1') and sync_date = '" + syncDate + "') as hasnext, t.tlevel from hrmdepartment_back t where t.id != ISNULL(t.supdepid, 0) and SNULL(t.tlevel,0) <= 10000 and (t.canceled IS NULL OR t.canceled != '1') and (t.canceled IS NULL OR t.canceled != '1') and sync_date = '" + syncDate + "' order by t.subcompanyid1 asc , t.supdepid asc , t.showorder asc, t.departmentname asc";
} else {
subCompanySql = "select t.id,t.subcompanyname,t.supsubcomid,(select distinct 1 as hasnext from hrmsubcompany s where (s.supsubcomid=t.id and (s.CANCELED IS NULL OR s.CANCELED !='1')) ) as hassubnext,(select distinct 1 as hasnext from HrmDepartment d where (d.subcompanyid1=t.id and (d.CANCELED IS NULL OR d.CANCELED !='1')) ) as hasdeptnext,t.tlevel from hrmsubcompany t where (t.canceled IS NULL OR t.canceled !='1') and t.id != t.supsubcomid and tlevel <= 10000 order by t.supsubcomid,t.showorder,t.subcompanyname";
departmentSql = "select t.id,t.departmentname,t.subcompanyid1,isnull(t.supdepid,0) as supdepid,(case when t.supdepid != 0 and (select COUNT(id) from hrmdepartment where id = t.supdepid)=0 then 0 else 1 end) as isExist,(select distinct 1 as hasnext from hrmdepartment d where d.supdepid=t.id and (CANCELED IS NULL OR CANCELED !='1')) as hasnext,t.tlevel from hrmdepartment t where t.id != ISNULL(t.supdepid,0) and tlevel <= 10000 and (t.canceled IS NULL OR t.canceled !='1') order by t.subcompanyid1 asc , t.supdepid asc , t.showorder asc, t.departmentname asc";
departmentSql = "select t.id,t.departmentname,t.subcompanyid1,isnull(t.supdepid,0) as supdepid,(case when t.supdepid != 0 and (select COUNT(id) from hrmdepartment where id = t.supdepid)=0 then 0 else 1 end) as isExist,(select distinct 1 as hasnext from hrmdepartment d where d.supdepid=t.id and (CANCELED IS NULL OR CANCELED !='1')) as hasnext,t.tlevel from hrmdepartment t where t.id != ISNULL(t.supdepid,0) and ISNULL(t.tlevel,0) <= 10000 and (t.canceled IS NULL OR t.canceled !='1') order by t.subcompanyid1 asc , t.supdepid asc , t.showorder asc, t.departmentname asc";
}
RecordSet rs = new RecordSet();
@ -318,13 +318,17 @@ public class DanikorResourceBackServiceImpl extends Service implements DanikorRe
@Override
public List<ChartParam> getResourceChartData(Map<String, Object> params) {
String syncDate = Util.null2String(params.get("date"));
String secLevel = Util.null2String(params.get("secLevel"));
if (StringUtils.isBlank(secLevel)) {
secLevel = "40";
}
List<ChartParam> chartParamList = new ArrayList<>();
// 查询安全级别大于等于40的人员
String sql;
if (StringUtils.isNotBlank(syncDate) && !DateUtil.getDate(new Date()).equals(syncDate)) {
sql = "select a.id, a.managerid , a.lastname , b.jobtitlename, ( select count(1) from HrmResource_back where managerid = a.id and sync_date = '" + syncDate + "') subordinate from HrmResource_back a left join HrmJobTitles b on a.jobtitle = b.id where seclevel >= 40 and sync_date = '" + syncDate + "'";
sql = "select a.id, a.managerid , a.lastname , b.jobtitlename, ( select count(1) from HrmResource_back where managerid = a.id and and seclevel >= " + secLevel + " and sync_date = '" + syncDate + "') subordinate from HrmResource_back a left join HrmJobTitles b on a.jobtitle = b.id where seclevel >= " + secLevel + " and sync_date = '" + syncDate + "'";
} else {
sql = "select a.id, a.managerid , a.lastname , b.jobtitlename, ( select count(1) from HrmResource where managerid = a.id) subordinate from HrmResource a left join HrmJobTitles b on a.jobtitle = b.id where seclevel >= 40";
sql = "select a.id, a.managerid , a.lastname , b.jobtitlename, ( select count(1) from HrmResource where managerid = a.id and seclevel >= " + secLevel + ") subordinate from HrmResource a left join HrmJobTitles b on a.jobtitle = b.id where seclevel >= " + secLevel;
}
RecordSet rs = new RecordSet();
@ -337,9 +341,9 @@ public class DanikorResourceBackServiceImpl extends Service implements DanikorRe
ChartParam chartParam = new ChartParam();
chartParam.setId(rs.getString("id"));
chartParam.setPid(managerId);
chartParam.setType((StringUtils.isBlank(managerId) || "0".equals(managerId)) ? "company" : "subcompany");
chartParam.setName(StringUtils.isBlank(jobTitleName) ? lastName : lastName + "(" + jobTitleName + ")");
chartParam.setTitle(chartParam.getName());
chartParam.setType((StringUtils.isBlank(managerId) || "0".equals(managerId)) ? "company" : "dept");
chartParam.setName(StringUtils.isBlank(jobTitleName) ? lastName : lastName + "<br/><span style=\"line-height: 20px!important;\">" + jobTitleName + "</span>");
chartParam.setTitle(lastName);
chartParam.setNum("0");
chartParam.setNTitle("");
chartParam.setODisplay("none");
@ -347,7 +351,7 @@ public class DanikorResourceBackServiceImpl extends Service implements DanikorRe
chartParam.setSubTitle("");
chartParam.setHasChild(subordinate > 0 ? "true" : "false");
chartParam.setNeedPlus("false");
chartParam.setCOnclick("/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo/" + chartParam.getId());
chartParam.setCOnclick("");
chartParam.setSOnclick("");
chartParamList.add(chartParam);
}

Loading…
Cancel
Save