组织架构图一级分部分权条件修复

pull/225/head
Chengliang 1 year ago
parent ab5e011640
commit b4aa07b797

@ -100,6 +100,13 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
String sql; String sql;
if (isSearchCurrent) { if (isSearchCurrent) {
sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompany where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = ? "; sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompany where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = ? ";
boolean isRealDimension = StringUtils.isBlank(fclass) || "0".equals(fclass);
boolean isRealTime = StringUtils.isBlank(id) || "0".equals(id);
if (isRealTime && user.getUID() != 1 && isRealDimension) {
DetachUtil detachUtil = new DetachUtil(user);
String ids = detachUtil.getJclRoleLevels();
sql = sql + " and id in ("+ids+")";
}
if (StringUtils.isNotBlank(fclass) && !"0".equals(fclass)) { if (StringUtils.isNotBlank(fclass) && !"0".equals(fclass)) {
sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompanyvirtual where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = ? and companyid = '" + fclass + "'"; sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompanyvirtual where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = ? and companyid = '" + fclass + "'";
} }

Loading…
Cancel
Save