| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excel.ColumnType; |
| | |
| | | * 用户ID |
| | | */ |
| | | @Excel(name = "用户序号", cellType = ColumnType.STRING, prompt = "用户编号") |
| | | @TableId |
| | | private String userId; |
| | | |
| | | /** |
| | |
| | | @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), |
| | | @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT) |
| | | }) |
| | | @TableField(exist = false) |
| | | private SysDept dept; |
| | | |
| | | /** |
| | | * 角色对象 |
| | | */ |
| | | @TableField(exist = false) |
| | | private List<SysRole> roles; |
| | | |
| | | /** |
| | | * 角色组 |
| | | */ |
| | | @TableField(exist = false) |
| | | private Long[] roleIds; |
| | | |
| | | /** |
| | | * 岗位组 |
| | | */ |
| | | @TableField(exist = false) |
| | | private Long[] postIds; |
| | | |
| | | /** |
| | | * 角色ID |
| | | */ |
| | | @TableField(exist = false) |
| | | private Long roleId; |
| | | |
| | | /** |
| | | * 相机操控优先级 |
| | | */ |
| | | private Integer cameraPriority; |
| | | private String cameraPriority; |
| | | |
| | | /** |
| | | * 用户融云token |
| | | */ |
| | | private String rongCloudToken; |
| | | |
| | | /** |
| | | * app用户类型 |
| | | * 0-app指挥端 1-app单兵端 空-pc端 |
| | | */ |
| | | private String appUserType; |
| | | /** |
| | | * app用户在线状态 |
| | | * 0-离线 1-在线 |
| | | */ |
| | | private String appOnlineState; |
| | | /** |
| | | * 关联报警类型组 |
| | | */ |
| | | @TableField(exist = false) |
| | | private List<String> commands; |
| | | |
| | | public SysUser() { |
| | | |
| | | } |
| | | |
| | | public String getAppOnlineState() { |
| | | return appOnlineState; |
| | | } |
| | | |
| | | public void setAppOnlineState(String appOnlineState) { |
| | | this.appOnlineState = appOnlineState; |
| | | } |
| | | |
| | | public String getAppUserType() { |
| | | return appUserType; |
| | | } |
| | | |
| | | public void setAppUserType(String appUserType) { |
| | | this.appUserType = appUserType; |
| | | } |
| | | |
| | | public List<String> getCommands() { |
| | |
| | | this.rongCloudToken = rongCloudToken; |
| | | } |
| | | |
| | | public Integer getCameraPriority() { |
| | | public String getCameraPriority() { |
| | | return cameraPriority; |
| | | } |
| | | |
| | | public void setCameraPriority(Integer cameraPriority) { |
| | | public void setCameraPriority(String cameraPriority) { |
| | | this.cameraPriority = cameraPriority; |
| | | } |
| | | |
| | |
| | | |
| | | public static boolean isAdmin(String userId) { |
| | | return userId != null && userId.equals("1"); |
| | | } |
| | | |
| | | /** |
| | | * 是否app指挥端 |
| | | */ |
| | | public boolean isAppLeader() { |
| | | return isAppLeader(this.userId); |
| | | } |
| | | |
| | | public boolean isAppLeader(String userId) { |
| | | List<SysRole> roles = this.getRoles(); |
| | | if(roles==null) |
| | | {return false;} |
| | | boolean appLeader = roles.stream().anyMatch(sysRole -> sysRole.getRoleKey().contains("appLeader")); |
| | | return userId != null && appLeader; |
| | | } |
| | | |
| | | public Long getDeptId() { |