Merge pull request '组织架构图分权BUG修复' (#232) from feature/dxf into develop
Reviewed-on: http://221.226.25.34:3000/liang.cheng/weaver-hrm-organization/pulls/232
This commit is contained in:
commit
2d46b33600
|
|
@ -1310,8 +1310,10 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
// 一级分部数据分权处理
|
||||
if (isRealTime && user.getUID() != 1 && isRealDimension) {
|
||||
DetachUtil detachUtil = new DetachUtil(user);
|
||||
String ids = detachUtil.getJclRoleLevels();
|
||||
sql = sql + " and a.id in ("+ids+")";
|
||||
if(detachUtil.isDETACH()) {
|
||||
String ids = detachUtil.getJclRoleLevels();
|
||||
sql = sql + " and a.id in (" + ids + ")";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "1":
|
||||
|
|
|
|||
|
|
@ -69,8 +69,10 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
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(detachUtil.isDETACH()) {
|
||||
String ids = detachUtil.getJclRoleLevels();
|
||||
sql = sql + " and id in (" + ids + ")";
|
||||
}
|
||||
}
|
||||
|
||||
rs.executeQuery(sql);
|
||||
|
|
@ -106,9 +108,11 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
judgeTreeLeafSql = sql;
|
||||
if (isRealTime && user.getUID() != 1 && isRealDimension) {
|
||||
DetachUtil detachUtil = new DetachUtil(user);
|
||||
String ids = detachUtil.getJclRoleLevels();
|
||||
if ("0".equals(subcompany)) {
|
||||
sql = sql + " and id in ("+ids+")";
|
||||
if (detachUtil.isDETACH()) {
|
||||
String ids = detachUtil.getJclRoleLevels();
|
||||
if ("0".equals(subcompany)) {
|
||||
sql = sql + " and id in (" + ids + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(fclass) && !"0".equals(fclass)) {
|
||||
|
|
@ -123,7 +127,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
sql += " and versionid = " + id;
|
||||
judgeTreeLeafSql = sql;
|
||||
}
|
||||
rs.executeQuery(sql,subcompany);
|
||||
rs.executeQuery(sql, subcompany);
|
||||
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());
|
||||
}
|
||||
|
|
@ -622,25 +626,25 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
RecordSet rs = new RecordSet();
|
||||
String recordDate = OrganizationDateUtil.getFormatLocalDateTime(LocalDateTime.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();
|
||||
String id = Util.null2String(rs.getString("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);
|
||||
}else {
|
||||
rs.executeUpdate("insert into JCL_ORG_CHARTVERSION (recorddate,description,creator,deletetype,createtime,fclass) values(?,?,?,?,?,?)",recordDate,description,user.getUID(),0,createDate,fclass);
|
||||
if (StringUtils.isNotEmpty(id)) {
|
||||
rs.executeUpdate("update JCL_ORG_CHARTVERSION set recorddate = ?,description = ?,creator = ? where fclass = ? and createtime = ?", recordDate, description, user.getUID(), fclass, createDate);
|
||||
} else {
|
||||
rs.executeUpdate("insert into JCL_ORG_CHARTVERSION (recorddate,description,creator,deletetype,createtime,fclass) values(?,?,?,?,?,?)", recordDate, description, user.getUID(), 0, createDate, fclass);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
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();
|
||||
String fclass = Util.null2String(params.get("fclass"));
|
||||
List<TimeLinesBO> timeLinesBOList = new ArrayList<>();
|
||||
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()) {
|
||||
timeLinesBOList.add(TimeLinesBO.builder()
|
||||
.key(rs.getInt("id"))
|
||||
|
|
@ -651,7 +655,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
.build());
|
||||
}
|
||||
|
||||
datas.put("timelineList",timeLinesBOList);
|
||||
datas.put("timelineList", timeLinesBOList);
|
||||
return datas;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue