| | |
| | | |
| | | @TableField(exist = false) |
| | | private List<Menu> authorities; |
| | | @TableField(exist = false) |
| | | private String deptId$; |
| | | |
| | | @TableField(exist = false) |
| | | private String tenantId$; |
| | | |
| | | @TableField(exist = false) |
| | | private String createBy$; |
| | | |
| | | @TableField(exist = false) |
| | | private String updateBy$; |
| | | |
| | | @TableField(exist = false) |
| | | private Long[] userRoleIds; |
| | | |
| | | |
| | | |
| | | public User() {} |
| | | |
| | |
| | | |
| | | @JsonIgnore |
| | | public String getDeptId$(){ |
| | | DeptService service = SpringUtils.getBean(DeptService.class); |
| | | Dept dept = service.getById(this.deptId); |
| | | if (!Cools.isEmpty(dept)){ |
| | | return String.valueOf(dept.getName()); |
| | | } |
| | | return null; |
| | | return this.deptId$; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public String getTenantId$(){ |
| | | TenantService service = SpringUtils.getBean(TenantService.class); |
| | | Tenant tenant = service.getById(this.tenantId); |
| | | if (!Cools.isEmpty(tenant)){ |
| | | return String.valueOf(tenant.getName()); |
| | | } |
| | | return null; |
| | | return this.tenantId$; |
| | | } |
| | | |
| | | public String getStatus$(){ |
| | |
| | | |
| | | @JsonIgnore |
| | | public String getCreateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.createBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | return this.createBy$; |
| | | } |
| | | |
| | | @JsonIgnore |
| | |
| | | |
| | | @JsonIgnore |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | return this.updateBy$; |
| | | } |
| | | |
| | | public Long[] getRoleIds() { |
| | |
| | | |
| | | @JsonIgnore |
| | | public Long[] getUserRoleIds() { |
| | | UserRoleService service = SpringUtils.getBean(UserRoleService.class); |
| | | List<UserRole> list = service.list(new LambdaQueryWrapper<UserRole>().eq(UserRole::getUserId, this.id)); |
| | | return list.stream().map(UserRole::getRoleId).toArray(Long[]::new); |
| | | return this.userRoleIds; |
| | | } |
| | | |
| | | @Override |