组织架构图分权BUG修复

pull/232/head
dxfeng 1 year ago
parent 4fa9208150
commit a351557e5d

@ -1310,8 +1310,10 @@ public class ChartServiceImpl extends Service implements ChartService {
// 一级分部数据分权处理 // 一级分部数据分权处理
if (isRealTime && user.getUID() != 1 && isRealDimension) { if (isRealTime && user.getUID() != 1 && isRealDimension) {
DetachUtil detachUtil = new DetachUtil(user); DetachUtil detachUtil = new DetachUtil(user);
String ids = detachUtil.getJclRoleLevels(); if(detachUtil.isDETACH()) {
sql = sql + " and a.id in ("+ids+")"; String ids = detachUtil.getJclRoleLevels();
sql = sql + " and a.id in (" + ids + ")";
}
} }
break; break;
case "1": case "1":

@ -69,8 +69,10 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
boolean isRealTime = StringUtils.isBlank(id) || "0".equals(id); boolean isRealTime = StringUtils.isBlank(id) || "0".equals(id);
if (isRealTime && user.getUID() != 1 && isRealDimension) { if (isRealTime && user.getUID() != 1 && isRealDimension) {
DetachUtil detachUtil = new DetachUtil(user); DetachUtil detachUtil = new DetachUtil(user);
String ids = detachUtil.getJclRoleLevels(); if(detachUtil.isDETACH()) {
sql = sql + " and id in ("+ids+")"; String ids = detachUtil.getJclRoleLevels();
sql = sql + " and id in (" + ids + ")";
}
} }
rs.executeQuery(sql); rs.executeQuery(sql);
@ -106,9 +108,11 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
judgeTreeLeafSql = sql; judgeTreeLeafSql = sql;
if (isRealTime && user.getUID() != 1 && isRealDimension) { if (isRealTime && user.getUID() != 1 && isRealDimension) {
DetachUtil detachUtil = new DetachUtil(user); DetachUtil detachUtil = new DetachUtil(user);
String ids = detachUtil.getJclRoleLevels(); if (detachUtil.isDETACH()) {
if ("0".equals(subcompany)) { String ids = detachUtil.getJclRoleLevels();
sql = sql + " and id in ("+ids+")"; if ("0".equals(subcompany)) {
sql = sql + " and id in (" + ids + ")";
}
} }
} }
if (StringUtils.isNotBlank(fclass) && !"0".equals(fclass)) { if (StringUtils.isNotBlank(fclass) && !"0".equals(fclass)) {
@ -123,7 +127,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
sql += " and versionid = " + id; sql += " and versionid = " + id;
judgeTreeLeafSql = sql; judgeTreeLeafSql = sql;
} }
rs.executeQuery(sql,subcompany); rs.executeQuery(sql, subcompany);
while (rs.next()) { while (rs.next()) {
companyTree.add(CompanyTreePO.builder().id(rs.getString("id")).pId(rs.getString("pId")).value(rs.getString("value")).title(rs.getString("title")).isLeaf(judgeTreeLeaf(judgeTreeLeafSql, rs.getString("id"))).build()); companyTree.add(CompanyTreePO.builder().id(rs.getString("id")).pId(rs.getString("pId")).value(rs.getString("value")).title(rs.getString("title")).isLeaf(judgeTreeLeaf(judgeTreeLeafSql, rs.getString("id"))).build());
} }
@ -622,25 +626,25 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
String recordDate = OrganizationDateUtil.getFormatLocalDateTime(LocalDateTime.now()); String recordDate = OrganizationDateUtil.getFormatLocalDateTime(LocalDateTime.now());
String createDate = OrganizationDateUtil.getFormatLocalDate(LocalDate.now()); String createDate = OrganizationDateUtil.getFormatLocalDate(LocalDate.now());
rs.executeQuery("select id from JCL_ORG_CHARTVERSION where fclass = ? and createtime = ?",fclass,createDate); rs.executeQuery("select id from JCL_ORG_CHARTVERSION where fclass = ? and createtime = ?", fclass, createDate);
rs.next(); rs.next();
String id = Util.null2String(rs.getString("id")); String id = Util.null2String(rs.getString("id"));
if(StringUtils.isNotEmpty(id)){ if (StringUtils.isNotEmpty(id)) {
rs.executeUpdate("update JCL_ORG_CHARTVERSION set recorddate = ?,description = ?,creator = ? where fclass = ? and createtime = ?",recordDate,description,user.getUID(),fclass,createDate); rs.executeUpdate("update JCL_ORG_CHARTVERSION set recorddate = ?,description = ?,creator = ? where fclass = ? and createtime = ?", recordDate, description, user.getUID(), fclass, createDate);
}else { } else {
rs.executeUpdate("insert into JCL_ORG_CHARTVERSION (recorddate,description,creator,deletetype,createtime,fclass) values(?,?,?,?,?,?)",recordDate,description,user.getUID(),0,createDate,fclass); rs.executeUpdate("insert into JCL_ORG_CHARTVERSION (recorddate,description,creator,deletetype,createtime,fclass) values(?,?,?,?,?,?)", recordDate, description, user.getUID(), 0, createDate, fclass);
} }
} }
@Override @Override
public Map<String, Object> searchTimeLines(Map<String, Object> params) { public Map<String, Object> searchTimeLines(Map<String, Object> params) {
Map<String,Object> datas = new HashMap<>(); Map<String, Object> datas = new HashMap<>();
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
String fclass = Util.null2String(params.get("fclass")); String fclass = Util.null2String(params.get("fclass"));
List<TimeLinesBO> timeLinesBOList = new ArrayList<>(); List<TimeLinesBO> timeLinesBOList = new ArrayList<>();
timeLinesBOList.add(TimeLinesBO.builder().key(0).id(0).title("当前版本").color("blue").time("").build()); timeLinesBOList.add(TimeLinesBO.builder().key(0).id(0).title("当前版本").color("blue").time("").build());
rs.executeQuery("SELECT id,recorddate,description from JCL_ORG_CHARTVERSION where fclass = ? and deletetype = ? order by id desc",fclass,0); rs.executeQuery("SELECT id,recorddate,description from JCL_ORG_CHARTVERSION where fclass = ? and deletetype = ? order by id desc", fclass, 0);
while (rs.next()) { while (rs.next()) {
timeLinesBOList.add(TimeLinesBO.builder() timeLinesBOList.add(TimeLinesBO.builder()
.key(rs.getInt("id")) .key(rs.getInt("id"))
@ -651,7 +655,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
.build()); .build());
} }
datas.put("timelineList",timeLinesBOList); datas.put("timelineList", timeLinesBOList);
return datas; return datas;
} }

Loading…
Cancel
Save