| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- package com.xintong.visualinspection.bean;
- import java.util.Collection;
- import java.util.Date;
- import java.util.List;
- import lombok.Data;
- import org.springframework.security.core.GrantedAuthority;
- import org.springframework.security.core.userdetails.UserDetails;
- import com.fasterxml.jackson.annotation.JsonIgnore;
- /**
- * 文件名:User 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
- */
- @Data
- public class User implements UserDetails {
- private Integer id;
- // 登录名
- private String username;
- // 姓名
- private String truename;
- // 密码
- private String password;
- // 组织机构ID
- private Integer organid;
- private Integer parent_organid;
-
- // 组织机构ID
- private String organname;
- // 班次
- private Integer classid;
-
- // 班组
- private Integer teamid;
- // 电话号码
- private String phone;
- // 状态(-1-删除;1未删除)
- private int status;
- // 手机号
- private String mobile;
- // 短号
- private String cornet;
- // 手机号是否为外地 0:不是 1:是
- private String mobileaddress;
- // 座机号是否为外地 0:不是 1:是
- private String phoneadderss;
- // 工号
- // private String worknumber;
- // 工号+密码组合后的值
- private String workidpassword;
- // 是否内部人员(1-是 2-否)
- private String isinner;
- // 是否是经理
- private String ismanage;
- // 宅电
- private String homephone;
- // 宅电是否为外地 0:不是 1:是
- private String homephoneadderss;
- // 手机号2
- private String mobile2;
- // 手机号2是否为外地 0:不是 1:是
- private String ismobileaddress;
- // 生日
- private Date birth;
- // 年龄
- private Integer age;
- // 职位ID
- private Integer positionid;
- // 职位ID
- private String position_name;
- // 性别
- private String sex;
- // 工号
- private String workno;
- // 身份证号
- private String idno;
-
- private String token;
- private String email;
- private String pic;
-
- private String fee_station_name ;
-
- //道管中心ID
- private Integer road_manager_id;
-
- private List<String> roleids;
- private List<Role> roles;
- private List<? extends GrantedAuthority> authorities;
- private List<Integer> position_ids;
-
- public User() {
- super();
- }
- public User(String username, String password, List<GrantedAuthority> grantedAuthorities) {
- super();
- this.username = username;
- this.password = password;
- this.authorities = grantedAuthorities;
- }
- @JsonIgnore
- public Integer getId() {
- return id;
- }
- // @JsonIgnore
- // @Override
- // public String getPassword() {
- // return password;
- // }
- @Override
- public String getUsername() {
- return username;
- }
- // 账户是否未过期
- @JsonIgnore
- @Override
- public boolean isAccountNonExpired() {
- return true;
- }
- // 账户是否未锁定
- @JsonIgnore
- @Override
- public boolean isAccountNonLocked() {
- return true;
- }
-
- // 密码是否未过期
- @JsonIgnore
- @Override
- public boolean isCredentialsNonExpired() {
- return true;
- }
- // 账户是否激活
- @JsonIgnore
- @Override
- public boolean isEnabled() {
- return true;
- }
- // 返回分配给用户的角色列表
-
- @Override
- public Collection<? extends GrantedAuthority> getAuthorities() {
- return authorities;
- }
- public void setGrantedAuthorities(List<? extends GrantedAuthority> authorities) {
- this.authorities = authorities;
- }
-
- }
|