#
Junjie
2024-07-13 5fd478fcee23bbdac0fe4fbe9becdd2a28d14c56
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/system/entity/User.java
@@ -1,10 +1,12 @@
package com.zy.asrs.wcs.system.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.framework.common.SpringUtils;
import com.zy.asrs.wcs.system.service.DeptService;
import com.zy.asrs.wcs.system.service.HostService;
import com.zy.asrs.wcs.system.service.UserRoleService;
import com.zy.asrs.wcs.system.service.UserService;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -165,6 +167,9 @@
    private String memo;
    @TableField(exist = false)
    private Long[] roleIds;
    @TableField(exist = false)
    private List<Role> roles;
    @TableField(exist = false)
@@ -322,6 +327,16 @@
        return null;
    }
    public Long[] getRoleIds() {
        return this.roleIds;
    }
    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);
    }
    @Override
    public boolean isAccountNonExpired() {
        return true;