zhou zhou
1 天以前 1dcfa3702505f0c431757312b5304531029f90f6
rsf-server/src/main/java/com/vincent/rsf/server/system/entity/User.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.vincent.rsf.framework.common.Cools;
import com.vincent.rsf.framework.common.SpringUtils;
import com.vincent.rsf.server.system.service.DeptService;
@@ -177,6 +178,22 @@
    @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() {}
@@ -207,22 +224,14 @@
        }
    }
    @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$(){
@@ -246,15 +255,12 @@
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
    }
    @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
    public String getUpdateTime$(){
        if (Cools.isEmpty(this.updateTime)){
            return "";
@@ -262,23 +268,18 @@
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
    }
    @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() {
        return this.roleIds;
    }
    @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
@@ -316,3 +317,4 @@
}