| | |
| | | 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; |
| | |
| | | private String memo; |
| | | |
| | | @TableField(exist = false) |
| | | private Long[] roleIds; |
| | | |
| | | @TableField(exist = false) |
| | | private List<Role> roles; |
| | | |
| | | @TableField(exist = false) |
| | |
| | | } |
| | | } |
| | | |
| | | // 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; |
| | | // } |
| | | 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; |
| | | } |
| | | |
| | | public String getHostId$(){ |
| | | HostService service = SpringUtils.getBean(HostService.class); |
| | |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.createBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | 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; |