User.java 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. package com.xintong.visualinspection.bean;
  2. import java.util.Collection;
  3. import java.util.Date;
  4. import java.util.List;
  5. import lombok.Data;
  6. import org.springframework.security.core.GrantedAuthority;
  7. import org.springframework.security.core.userdetails.UserDetails;
  8. import com.fasterxml.jackson.annotation.JsonIgnore;
  9. /**
  10. * 文件名:User 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
  11. */
  12. @Data
  13. public class User implements UserDetails {
  14. private Integer id;
  15. // 登录名
  16. private String username;
  17. // 姓名
  18. private String truename;
  19. // 密码
  20. private String password;
  21. // 组织机构ID
  22. private Integer organid;
  23. private Integer parent_organid;
  24. // 组织机构ID
  25. private String organname;
  26. // 班次
  27. private Integer classid;
  28. // 班组
  29. private Integer teamid;
  30. // 电话号码
  31. private String phone;
  32. // 状态(-1-删除;1未删除)
  33. private int status;
  34. // 手机号
  35. private String mobile;
  36. // 短号
  37. private String cornet;
  38. // 手机号是否为外地 0:不是 1:是
  39. private String mobileaddress;
  40. // 座机号是否为外地 0:不是 1:是
  41. private String phoneadderss;
  42. // 工号
  43. // private String worknumber;
  44. // 工号+密码组合后的值
  45. private String workidpassword;
  46. // 是否内部人员(1-是 2-否)
  47. private String isinner;
  48. // 是否是经理
  49. private String ismanage;
  50. // 宅电
  51. private String homephone;
  52. // 宅电是否为外地 0:不是 1:是
  53. private String homephoneadderss;
  54. // 手机号2
  55. private String mobile2;
  56. // 手机号2是否为外地 0:不是 1:是
  57. private String ismobileaddress;
  58. // 生日
  59. private Date birth;
  60. // 年龄
  61. private Integer age;
  62. // 职位ID
  63. private Integer positionid;
  64. // 职位ID
  65. private String position_name;
  66. // 性别
  67. private String sex;
  68. // 工号
  69. private String workno;
  70. // 身份证号
  71. private String idno;
  72. private String token;
  73. private String email;
  74. private String pic;
  75. private String fee_station_name ;
  76. //道管中心ID
  77. private Integer road_manager_id;
  78. private List<String> roleids;
  79. private List<Role> roles;
  80. private List<? extends GrantedAuthority> authorities;
  81. private List<Integer> position_ids;
  82. public User() {
  83. super();
  84. }
  85. public User(String username, String password, List<GrantedAuthority> grantedAuthorities) {
  86. super();
  87. this.username = username;
  88. this.password = password;
  89. this.authorities = grantedAuthorities;
  90. }
  91. @JsonIgnore
  92. public Integer getId() {
  93. return id;
  94. }
  95. // @JsonIgnore
  96. // @Override
  97. // public String getPassword() {
  98. // return password;
  99. // }
  100. @Override
  101. public String getUsername() {
  102. return username;
  103. }
  104. // 账户是否未过期
  105. @JsonIgnore
  106. @Override
  107. public boolean isAccountNonExpired() {
  108. return true;
  109. }
  110. // 账户是否未锁定
  111. @JsonIgnore
  112. @Override
  113. public boolean isAccountNonLocked() {
  114. return true;
  115. }
  116. // 密码是否未过期
  117. @JsonIgnore
  118. @Override
  119. public boolean isCredentialsNonExpired() {
  120. return true;
  121. }
  122. // 账户是否激活
  123. @JsonIgnore
  124. @Override
  125. public boolean isEnabled() {
  126. return true;
  127. }
  128. // 返回分配给用户的角色列表
  129. @Override
  130. public Collection<? extends GrantedAuthority> getAuthorities() {
  131. return authorities;
  132. }
  133. public void setGrantedAuthorities(List<? extends GrantedAuthority> authorities) {
  134. this.authorities = authorities;
  135. }
  136. }