package com.ruoyi.common.core.domain.entity;
|
|
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.xss.Xss;
|
import io.swagger.annotations.ApiModelProperty;
|
import lombok.Data;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
import javax.validation.constraints.Email;
|
import javax.validation.constraints.Size;
|
import java.math.BigDecimal;
|
import java.util.Date;
|
import java.util.List;
|
|
/**
|
* 用户对象 sys_user
|
*
|
* @author ruoyi
|
*/
|
@Data
|
public class SysUser extends BaseEntity
|
{
|
private static final long serialVersionUID = 1L;
|
|
/** 用户ID */
|
//@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
@ApiModelProperty(value = "用户id")
|
@TableField("user_id")
|
private Long userId;
|
|
/** 部门ID */
|
//@Excel(name = "部门编号", type = Type.IMPORT)
|
@ApiModelProperty(value = "部门id")
|
@TableField("dept_id")
|
private String deptId;
|
|
/** 用户账号 */
|
//@Excel(name = "登录名称")
|
@ApiModelProperty(value = "登录名称")
|
private String userName;
|
|
/** 用户昵称 */
|
//@Excel(name = "用户名称")
|
@ApiModelProperty(value = "用户名称")
|
private String nickName;
|
|
@ApiModelProperty(value = "职位")
|
@TableField("position")
|
private String position;
|
@ApiModelProperty(value = "任职时间")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@TableField("position_time")
|
private Date positionTime;
|
@ApiModelProperty(value = "身份证")
|
@TableField("id_card")
|
private String idCard;
|
@ApiModelProperty(value = "编制")
|
@TableField("organization")
|
private String organization;
|
@ApiModelProperty(value = "政治面貌")
|
@TableField("political_outlook")
|
private String politicalOutlook;
|
@ApiModelProperty(value = "参工时间")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@TableField("participation_time")
|
private Date participationTime;
|
@ApiModelProperty(value = "进入公司时间")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@TableField("company_time")
|
private Date companyTime;
|
@ApiModelProperty(value = "第一学历")
|
@TableField("first_degree")
|
private String firstDegree;
|
@ApiModelProperty(value = "第一学历学院")
|
@TableField("first_college")
|
private String firstCollege;
|
@ApiModelProperty(value = "第一学历专业")
|
@TableField("first_major")
|
private String firstMajor;
|
@ApiModelProperty(value = "最高学历")
|
@TableField("highest_degree")
|
private String highestDegree;
|
@ApiModelProperty(value = "最高学历学院")
|
@TableField("highest_college")
|
private String highestCollege;
|
@ApiModelProperty(value = "最高学历专业")
|
@TableField("highest_major")
|
private String highestMajor;
|
|
|
/** 手机号码 */
|
//@Excel(name = "手机号码")
|
@ApiModelProperty(value = "手机号码")
|
private String phonenumber;
|
|
/** 用户性别 */
|
//@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
|
@ApiModelProperty(value = "用户性别 0=男,1=女,2=未知")
|
private String sex;
|
|
|
/** 密码 */
|
@ApiModelProperty(value = "密码")
|
private String password;
|
|
/** 帐号状态(0正常 1停用) */
|
//@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
@ApiModelProperty(value = "帐号状态 0=正常,1=停用")
|
private String status;
|
|
/** 删除标志(0代表存在 2代表删除) */
|
@ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
|
private String delFlag;
|
|
/** 最后登录IP */
|
//@Excel(name = "最后登录IP", type = Type.EXPORT)
|
@ApiModelProperty(value = "最后登录IP")
|
private String loginIp;
|
|
/** 最后登录时间 */
|
//@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@ApiModelProperty(value = "最后登录时间")
|
private Date loginDate;
|
|
/** 部门对象 */
|
//@Excels({
|
//@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
//@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
|
// })
|
@ApiModelProperty(value = "部门对象")
|
private SysDept dept;
|
|
/** 角色对象 */
|
@ApiModelProperty(value = "角色对象")
|
private List<SysRole> roles;
|
|
/** 角色组 */
|
@ApiModelProperty(value = "角色组")
|
private Long[] roleIds;
|
|
/** 岗位组 */
|
@ApiModelProperty(value = "岗位组")
|
private Long[] postIds;
|
|
/** 角色ID */
|
@ApiModelProperty(value = "角色ID")
|
private Long roleId;
|
/**
|
* 是否为黑名单 1是 0否
|
*/
|
@ApiModelProperty(value = "是否为黑名单 1是 0否")
|
private Integer ifBlack;
|
|
|
|
@TableField(exist = false)
|
@ApiModelProperty("角色名称")
|
private String roleName;
|
@TableField(exist = false)
|
private String deptName;
|
@ApiModelProperty(value = "部门id集合")
|
@TableField(exist = false)
|
private List<String> deptIds;
|
|
|
|
|
|
public String getRoleName() {
|
return roleName;
|
}
|
|
public void setRoleName(String roleName) {
|
this.roleName = roleName;
|
}
|
|
|
|
public SysUser()
|
{
|
|
}
|
|
public SysUser(Long userId)
|
{
|
this.userId = userId;
|
}
|
|
public Long getUserId()
|
{
|
return userId;
|
}
|
|
public void setUserId(Long userId)
|
{
|
this.userId = userId;
|
}
|
|
public boolean isAdmin()
|
{
|
return isAdmin(this.userId);
|
}
|
|
public static boolean isAdmin(Long userId)
|
{
|
return userId != null && 1L == userId;
|
}
|
|
public String getDeptId()
|
{
|
return deptId;
|
}
|
|
public void setDeptId(String deptId)
|
{
|
this.deptId = deptId;
|
}
|
|
@Xss(message = "用户昵称不能包含脚本字符")
|
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
public String getNickName()
|
{
|
return nickName;
|
}
|
|
public void setNickName(String nickName)
|
{
|
this.nickName = nickName;
|
}
|
|
@Xss(message = "用户账号不能包含脚本字符")
|
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
public String getUserName()
|
{
|
return userName;
|
}
|
|
public void setUserName(String userName)
|
{
|
this.userName = userName;
|
}
|
|
|
|
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
public String getPhonenumber()
|
{
|
return phonenumber;
|
}
|
|
public void setPhonenumber(String phonenumber)
|
{
|
this.phonenumber = phonenumber;
|
}
|
|
public String getSex()
|
{
|
return sex;
|
}
|
|
public void setSex(String sex)
|
{
|
this.sex = sex;
|
}
|
|
|
public String getPassword()
|
{
|
return password;
|
}
|
|
public void setPassword(String password)
|
{
|
this.password = password;
|
}
|
|
public String getStatus()
|
{
|
return status;
|
}
|
|
public void setStatus(String status)
|
{
|
this.status = status;
|
}
|
|
public String getDelFlag()
|
{
|
return delFlag;
|
}
|
|
public void setDelFlag(String delFlag)
|
{
|
this.delFlag = delFlag;
|
}
|
|
public String getLoginIp()
|
{
|
return loginIp;
|
}
|
|
public void setLoginIp(String loginIp)
|
{
|
this.loginIp = loginIp;
|
}
|
|
public Date getLoginDate()
|
{
|
return loginDate;
|
}
|
|
public void setLoginDate(Date loginDate)
|
{
|
this.loginDate = loginDate;
|
}
|
|
public SysDept getDept()
|
{
|
return dept;
|
}
|
|
public void setDept(SysDept dept)
|
{
|
this.dept = dept;
|
}
|
|
public List<SysRole> getRoles()
|
{
|
return roles;
|
}
|
|
public void setRoles(List<SysRole> roles)
|
{
|
this.roles = roles;
|
}
|
|
public Long[] getRoleIds()
|
{
|
return roleIds;
|
}
|
|
public void setRoleIds(Long[] roleIds)
|
{
|
this.roleIds = roleIds;
|
}
|
|
public Long[] getPostIds()
|
{
|
return postIds;
|
}
|
|
public void setPostIds(Long[] postIds)
|
{
|
this.postIds = postIds;
|
}
|
|
public Long getRoleId()
|
{
|
return roleId;
|
}
|
|
public void setRoleId(Long roleId)
|
{
|
this.roleId = roleId;
|
}
|
|
public Integer getIfBlack() {
|
return ifBlack;
|
}
|
|
public void setIfBlack(Integer ifBlack) {
|
this.ifBlack = ifBlack;
|
}
|
|
@Override
|
public String toString() {
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
.append("userId", getUserId())
|
.append("deptId", getDeptId())
|
.append("userName", getUserName())
|
.append("nickName", getNickName())
|
.append("phonenumber", getPhonenumber())
|
.append("sex", getSex())
|
.append("password", getPassword())
|
.append("status", getStatus())
|
.append("delFlag", getDelFlag())
|
.append("loginIp", getLoginIp())
|
.append("loginDate", getLoginDate())
|
.append("createBy", getCreateBy())
|
.append("createTime", getCreateTime())
|
.append("updateBy", getUpdateBy())
|
.append("updateTime", getUpdateTime())
|
.append("remark", getRemark())
|
.append("dept", getDept())
|
.toString();
|
}
|
}
|