嘉兆组织管理分权

feature/jiazhao
Mlin 2 years ago
parent db00bfbe65
commit 870e334429

@ -61,7 +61,17 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
}
String sql = "select id, fnumber, fname, ftype from jcl_org_map where ftype in (0, 1) ";
rs.executeQuery(sql + "select id, fnumber, fname, ftype from jcl_org_map where ftype = 0 and fdateend > " + DBType.get(new RecordSet().getDBType()).currentDate() + " order by ftype , id,fdateend desc ");
// 分部分权过滤
DetachUtil detachUtil = new DetachUtil(user);
if (detachUtil.isDETACH()) {
String jclRoleLevels = detachUtil.getJclRoleLevels();
if (StringUtils.isNotBlank(jclRoleLevels)) {
sql = "select id, fnumber, fname, ftype from jcl_org_map where (ftype = 0 or (ftype = 1 and fobjid in(" + jclRoleLevels + "))) ";
} else {
sql = "select id, fnumber, fname, ftype from jcl_org_map where ftype = 0 ";
}
}
rs.executeQuery(sql + " and fdateend > " + DBType.get(new RecordSet().getDBType()).currentDate() + " order by ftype , id,fdateend desc ");
Set<OrgSelectItem> companySet = new HashSet<>();
while (rs.next()) {
OrgSelectItem item = new OrgSelectItem();
@ -301,7 +311,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
String sql = "select t.id, t.fname, t.ftype, t.fparentid, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber, t.fleader,t.fleaderlv, t.fleaderst,t.fobjid,t.fisvitual from jcl_org_map t ";
RecordSet rs = new RecordSet();
List<Map<String, Object>> currentList = new ArrayList<>();
// DetachUtil detachUtil = new DetachUtil(user);
DetachUtil detachUtil = new DetachUtil(user);
for (String id:split) {
String whereSql = userWhereSql(request2Map);
String deptLeader = "";
@ -315,7 +325,19 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
}
}
if (detachUtil.isDETACH()) {
if ("0".equals(id)) {
whereSql += " and t.ftype = 1 and t.fobjid in(" + detachUtil.getJclRoleLevels() + ")";
} else {
if (StringUtils.isNotBlank(deptLeader)) {
deptLeader = deptLeader.split(",")[0];
whereSql += " and t.ftype = 3 and fobjid = '" + deptLeader + "' ";
deptLeader = String.valueOf(200000000 + Integer.parseInt(deptLeader));
} else {
whereSql += " and t.fparentid = " + id.split("_")[0] + " and ((t.ftype =1 and t.fobjid in(" + detachUtil.getJclRoleLevels() + ")) or (t.ftype =2 ) or (t.ftype = 3 ))";
}
}
} else {
if (StringUtils.isNotBlank(deptLeader)) {
deptLeader = deptLeader.split(",")[0];
whereSql += " and t.ftype = 3 and fobjid = '" + deptLeader + "' ";
@ -327,7 +349,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
whereSql += " and t.fparentid = "+ id.split("_")[0];
}
}
}
rs.executeQuery(sql + whereSql);
while (rs.next()) {
Map<String, Object> item = new HashMap<>();
@ -438,7 +460,20 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
}
}
DetachUtil detachUtil = new DetachUtil(user);
if (detachUtil.isDETACH()) {
if ("0".equals(id)) {
sql += " and t.ftype = 1 and t.fparentid = " + id + " and t.fobjid in(" + detachUtil.getJclRoleLevels() + ")";
} else {
if (StringUtils.isNotBlank(deptLeader)) {
deptLeader = deptLeader.split(",")[0];
sql += " and t.ftype = 3 and fobjid = '" + deptLeader + "' ";
deptLeader = String.valueOf(200000000 + Integer.parseInt(deptLeader));
} else {
sql += " and t.fparentid = " + id + " and ((t.ftype =1 and t.fobjid in(" + detachUtil.getJclRoleLevels() + ")) or (t.ftype =2) or (t.ftype = 3 ))";
}
}
} else {
if (StringUtils.isNotBlank(deptLeader)) {
deptLeader = deptLeader.split(",")[0];
sql += " and t.ftype = 3 and fobjid = '" + deptLeader + "' ";
@ -446,7 +481,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
} else {
sql += " and t.fparentid = " + id;
}
}
rs.executeQuery(sql);
List<Map<String, Object>> currentList = new ArrayList<>();
while (rs.next()) {

Loading…
Cancel
Save