parent
1e0899891c
commit
a3a344f8c9
|
@ -6,16 +6,10 @@ import java.util.Date;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "sys_role")
|
@Table(name = "sys_role")
|
||||||
public class SysRole {
|
public class SysRole {
|
||||||
//智慧工地系统管理员
|
//系统管理员
|
||||||
public static final int ROLE_TYPE_1 = 1;
|
public static final int ROLE_TYPE_SYSTEM = 0;
|
||||||
//市级管理员
|
//普通管理员
|
||||||
public static final int ROLE_TYPE_2 = 2;
|
public static final int ROLE_TYPE_NORMAL = 1;
|
||||||
//环保局管理员
|
|
||||||
public static final int ROLE_TYPE_3 = 3;
|
|
||||||
//网格管理员
|
|
||||||
public static final int ROLE_TYPE_4 = 4;
|
|
||||||
//工地巡查员
|
|
||||||
public static final int ROLE_TYPE_8 = 8;
|
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
|
|
@ -105,8 +105,11 @@ public class ProjectService {
|
||||||
Admin admin = InterfaceUtil.getAdmin();
|
Admin admin = InterfaceUtil.getAdmin();
|
||||||
int roleId = admin.getRoleId();
|
int roleId = admin.getRoleId();
|
||||||
Integer adminId = admin.getId();
|
Integer adminId = admin.getId();
|
||||||
//自己创建的肯定能看见
|
//自己创建的肯定能看见,配置的可以看见,系统管理员可以看见
|
||||||
queryHelper.addCondition("(p.creator_id=? OR p.id in (SELECT pv1.project_id FROM project_visible pv1 WHERE pv1.type=1 AND pv1.tid=? UNION SELECT pv2.project_id FROM project_visible pv2 WHERE pv2.type=2 AND pv2.tid=?))", adminId, roleId, adminId);
|
SysRole sysRole = sysRoleRepository.findSysRoleById(roleId);
|
||||||
|
if(SysRole.ROLE_TYPE_SYSTEM != sysRole.getType()){
|
||||||
|
queryHelper.addCondition("(p.creator_id=? OR p.id in (SELECT pv1.project_id FROM project_visible pv1 WHERE pv1.type=1 AND pv1.tid=? UNION SELECT pv2.project_id FROM project_visible pv2 WHERE pv2.type=2 AND pv2.tid=?))", adminId, roleId, adminId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
queryHelper.addDescOrderProperty("p.last_update_time");
|
queryHelper.addDescOrderProperty("p.last_update_time");
|
||||||
|
@ -239,6 +242,10 @@ public class ProjectService {
|
||||||
*/
|
*/
|
||||||
public List<ZTreeNode> getZTreeNodes(int projectId){
|
public List<ZTreeNode> getZTreeNodes(int projectId){
|
||||||
List<SysRole> roleList = sysRoleRepository.findAllRole();
|
List<SysRole> roleList = sysRoleRepository.findAllRole();
|
||||||
|
//过滤掉系统管理员角色
|
||||||
|
roleList = roleList.stream().filter(sysRole -> sysRole.getType()!=SysRole.ROLE_TYPE_SYSTEM).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
List<Admin> adminList = adminRepository.getAllEnable();
|
List<Admin> adminList = adminRepository.getAllEnable();
|
||||||
List<ZTreeNode> zTreeNodes = new ArrayList<>(roleList.size()+adminList.size());
|
List<ZTreeNode> zTreeNodes = new ArrayList<>(roleList.size()+adminList.size());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue