SysUser.java 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. package com.dgtly.system.domain;
  2. import java.util.Date;
  3. import java.util.List;
  4. import javax.validation.constraints.*;
  5. import com.dgtly.common.core.domain.Ztree;
  6. import com.fasterxml.jackson.annotation.JsonFormat;
  7. import org.apache.commons.lang3.builder.ToStringBuilder;
  8. import org.apache.commons.lang3.builder.ToStringStyle;
  9. import com.dgtly.common.annotation.Excel;
  10. import com.dgtly.common.annotation.Excel.ColumnType;
  11. import com.dgtly.common.annotation.Excel.Type;
  12. import com.dgtly.common.annotation.Excels;
  13. import com.dgtly.common.core.domain.BaseEntity;
  14. /**
  15. * 用户对象 sys_user
  16. *
  17. * @author dgtly
  18. */
  19. public class SysUser extends BaseEntity
  20. {
  21. private static final long serialVersionUID = 1L;
  22. /** 用户ID */
  23. @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
  24. private Long userId;
  25. /** 公司ID */
  26. @Excel(name = "公司编号", type = Type.IMPORT)
  27. private Long companyId;
  28. /** 部门ID */
  29. @Excel(name = "部门编号", type = Type.IMPORT)
  30. private Long deptId;
  31. /** 部门父ID */
  32. private Long parentId;
  33. /** 角色ID */
  34. private Long roleId;
  35. /** 登录名称 */
  36. @Excel(name = "登录名称")
  37. private String loginName;
  38. /** 用户名称 */
  39. @Excel(name = "用户名称")
  40. private String userName;
  41. /** 用户邮箱 */
  42. @Excel(name = "用户邮箱")
  43. private String email;
  44. /** 手机号码 */
  45. @Excel(name = "手机号码")
  46. private String phonenumber;
  47. /** 用户性别 */
  48. @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
  49. private String sex;
  50. /** 用户头像 */
  51. private String avatar;
  52. /** 密码 */
  53. private String password;
  54. /** 盐加密 */
  55. private String salt;
  56. /** 帐号状态(0正常 1停用) */
  57. @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
  58. private String status;
  59. /** 删除标志(0代表存在 2代表删除) */
  60. private String delFlag;
  61. /** 最后登陆IP */
  62. @Excel(name = "最后登陆IP", type = Type.EXPORT)
  63. private String loginIp;
  64. /** 最后登陆时间 */
  65. @Excel(name = "最后登陆时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
  66. private Date loginDate;
  67. /** 部门对象 */
  68. @Excels({
  69. @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
  70. @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
  71. })
  72. private SysDept dept;
  73. private SysCompany company;
  74. private List<SysRole> roles;
  75. /** 角色组 */
  76. private Long[] roleIds;
  77. /** 岗位组 */
  78. private Long[] postIds;
  79. /** 证件类型 */
  80. private String idType;
  81. /** 证件号 */
  82. private String idNumber;
  83. /** 注册后id */
  84. private String accountId;
  85. /** 是否认证 */
  86. private String isAuthentication;
  87. /** 更新时间 */
  88. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  89. private Date personAttestationTime;
  90. /** 接受认证的手机号 */
  91. private String receiveUrlMobileNo;
  92. /** 用户销售信息扩展 */
  93. private SysUserExt sysUserExt;
  94. /** 用户销售信息扩展 */
  95. private List<SysUserExt> sysUserExtLsit;
  96. /** 是否收货人 */
  97. private String isConsignee;
  98. /*企业认证状态0未认证1已认证*/
  99. private String isOrgAuthentication;
  100. /*企业认证时间*/
  101. private Date orgAttestationTime;
  102. /** 是否同步 */
  103. private String isSync;
  104. /**
  105. * 订单在线权限
  106. */
  107. private List<Ztree> author;
  108. /** 用户权限 TUC*/
  109. private String authorType;
  110. //2离职authorType
  111. private String quit;
  112. public String getQuit(){return quit;}
  113. public void setQuit(String quit){this.quit=quit;}
  114. public String getAuthorType() {
  115. return authorType;
  116. }
  117. public void setAuthorType(String authorType) {
  118. this.authorType = authorType;
  119. }
  120. // /** 所属销售组织等级 详见字典(sales_level) */
  121. // private String salesLevel;
  122. //
  123. // /** 所属销售组织名称 */
  124. // private String orgName;
  125. //
  126. // /** 所属销售组织code */
  127. // private String orgCode;
  128. public SysUser()
  129. {
  130. }
  131. public List<Ztree> getAuthor() {
  132. return author;
  133. }
  134. public void setAuthor(List<Ztree> author) {
  135. this.author = author;
  136. }
  137. public SysUser(Long userId)
  138. {
  139. this.userId = userId;
  140. }
  141. public Long getCompanyId() {
  142. return companyId;
  143. }
  144. public void setCompanyId(Long companyId) {
  145. this.companyId = companyId;
  146. }
  147. public Long getUserId()
  148. {
  149. return userId;
  150. }
  151. public void setUserId(Long userId)
  152. {
  153. this.userId = userId;
  154. }
  155. public boolean isAdmin()
  156. {
  157. return isAdmin(this.userId);
  158. }
  159. public static boolean isAdmin(Long userId)
  160. {
  161. return userId != null && 1L == userId;
  162. }
  163. public Long getDeptId()
  164. {
  165. return deptId;
  166. }
  167. public void setDeptId(Long deptId)
  168. {
  169. this.deptId = deptId;
  170. }
  171. public Long getParentId()
  172. {
  173. return parentId;
  174. }
  175. public void setParentId(Long parentId)
  176. {
  177. this.parentId = parentId;
  178. }
  179. public Long getRoleId()
  180. {
  181. return roleId;
  182. }
  183. public void setRoleId(Long roleId)
  184. {
  185. this.roleId = roleId;
  186. }
  187. @NotBlank(message = "登录账号不能为空")
  188. @Size(min = 0, max = 30, message = "登录账号长度不能超过30个字符")
  189. public String getLoginName()
  190. {
  191. return loginName;
  192. }
  193. public void setLoginName(String loginName)
  194. {
  195. this.loginName = loginName;
  196. }
  197. @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
  198. public String getUserName()
  199. {
  200. return userName;
  201. }
  202. public void setUserName(String userName)
  203. {
  204. this.userName = userName;
  205. }
  206. @Email(message = "邮箱格式不正确")
  207. @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
  208. public String getEmail()
  209. {
  210. return email;
  211. }
  212. public void setEmail(String email)
  213. {
  214. this.email = email;
  215. }
  216. @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
  217. public String getPhonenumber()
  218. {
  219. return phonenumber;
  220. }
  221. public void setPhonenumber(String phonenumber)
  222. {
  223. this.phonenumber = phonenumber;
  224. }
  225. public String getSex()
  226. {
  227. return sex;
  228. }
  229. public void setSex(String sex)
  230. {
  231. this.sex = sex;
  232. }
  233. public String getAvatar()
  234. {
  235. return avatar;
  236. }
  237. public void setAvatar(String avatar)
  238. {
  239. this.avatar = avatar;
  240. }
  241. public String getPassword()
  242. {
  243. return password;
  244. }
  245. public void setPassword(String password)
  246. {
  247. this.password = password;
  248. }
  249. public String getSalt()
  250. {
  251. return salt;
  252. }
  253. public void setSalt(String salt)
  254. {
  255. this.salt = salt;
  256. }
  257. public String getStatus()
  258. {
  259. return status;
  260. }
  261. public void setStatus(String status)
  262. {
  263. this.status = status;
  264. }
  265. public String getDelFlag()
  266. {
  267. return delFlag;
  268. }
  269. public void setDelFlag(String delFlag)
  270. {
  271. this.delFlag = delFlag;
  272. }
  273. public String getLoginIp()
  274. {
  275. return loginIp;
  276. }
  277. public void setLoginIp(String loginIp)
  278. {
  279. this.loginIp = loginIp;
  280. }
  281. public Date getLoginDate()
  282. {
  283. return loginDate;
  284. }
  285. public void setLoginDate(Date loginDate)
  286. {
  287. this.loginDate = loginDate;
  288. }
  289. public SysDept getDept()
  290. {
  291. if (dept == null)
  292. {
  293. dept = new SysDept();
  294. }
  295. return dept;
  296. }
  297. public SysCompany getCompany() {
  298. return company;
  299. }
  300. public void setCompany(SysCompany company) {
  301. this.company = company;
  302. }
  303. public void setDept(SysDept dept)
  304. {
  305. this.dept = dept;
  306. }
  307. public List<SysRole> getRoles()
  308. {
  309. return roles;
  310. }
  311. public void setRoles(List<SysRole> roles)
  312. {
  313. this.roles = roles;
  314. }
  315. public Long[] getRoleIds()
  316. {
  317. return roleIds;
  318. }
  319. public void setRoleIds(Long[] roleIds)
  320. {
  321. this.roleIds = roleIds;
  322. }
  323. public Long[] getPostIds()
  324. {
  325. return postIds;
  326. }
  327. public void setPostIds(Long[] postIds)
  328. {
  329. this.postIds = postIds;
  330. }
  331. private String workAddr;
  332. private String workSchedul;
  333. private String addrNum;
  334. private String schedulDetail;
  335. public String getWorkAddr() {
  336. return workAddr;
  337. }
  338. public void setWorkAddr(String workAddr) {
  339. this.workAddr = workAddr;
  340. }
  341. public String getWorkSchedul() {
  342. return workSchedul;
  343. }
  344. public void setWorkSchedul(String workSchedul) {
  345. this.workSchedul = workSchedul;
  346. }
  347. public String getAddrNum() {
  348. return addrNum;
  349. }
  350. public void setAddrNum(String addrNum) {
  351. this.addrNum = addrNum;
  352. }
  353. public String getSchedulDetail() {
  354. return schedulDetail;
  355. }
  356. public void setSchedulDetail(String schedulDetail) {
  357. this.schedulDetail = schedulDetail;
  358. }
  359. public SysUserExt getSysUserExt() {
  360. return sysUserExt;
  361. }
  362. public void setSysUserExt(SysUserExt sysUserExt) {
  363. this.sysUserExt = sysUserExt;
  364. }
  365. public String getIdType() {
  366. return idType;
  367. }
  368. public void setIdType(String idType) {
  369. this.idType = idType;
  370. }
  371. public String getIdNumber() {
  372. return idNumber;
  373. }
  374. public void setIdNumber(String idNumber) {
  375. this.idNumber = idNumber;
  376. }
  377. public String getAccountId() {
  378. return accountId;
  379. }
  380. public void setAccountId(String accountId) {
  381. this.accountId = accountId;
  382. }
  383. public String getIsAuthentication() {
  384. return isAuthentication;
  385. }
  386. public void setIsAuthentication(String isAuthentication) {
  387. this.isAuthentication = isAuthentication;
  388. }
  389. public Date getPersonAttestationTime() {
  390. return personAttestationTime;
  391. }
  392. public void setPersonAttestationTime(Date personAttestationTime) {
  393. this.personAttestationTime = personAttestationTime;
  394. }
  395. public String getReceiveUrlMobileNo() {
  396. return receiveUrlMobileNo;
  397. }
  398. public void setReceiveUrlMobileNo(String receiveUrlMobileNo) {
  399. this.receiveUrlMobileNo = receiveUrlMobileNo;
  400. }
  401. public String getIsConsignee() {
  402. return isConsignee;
  403. }
  404. public void setIsConsignee(String isConsignee) {
  405. this.isConsignee = isConsignee;
  406. }
  407. public String getIsOrgAuthentication() {
  408. return isOrgAuthentication;
  409. }
  410. public void setIsOrgAuthentication(String isOrgAuthentication) {
  411. this.isOrgAuthentication = isOrgAuthentication;
  412. }
  413. public Date getOrgAttestationTime() {
  414. return orgAttestationTime;
  415. }
  416. public void setOrgAttestationTime(Date orgAttestationTime) {
  417. this.orgAttestationTime = orgAttestationTime;
  418. }
  419. public List<SysUserExt> getSysUserExtLsit() {
  420. return sysUserExtLsit;
  421. }
  422. public void setSysUserExtLsit(List<SysUserExt> sysUserExtLsit) {
  423. this.sysUserExtLsit = sysUserExtLsit;
  424. }
  425. public String getIsSync() {
  426. return isSync;
  427. }
  428. public void setIsSync(String isSync) {
  429. this.isSync = isSync;
  430. }
  431. @Override
  432. public String toString() {
  433. return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  434. .append("userId", getUserId())
  435. .append("deptId", getDeptId())
  436. .append("companyId", getDeptId())
  437. .append("loginName", getLoginName())
  438. .append("userName", getUserName())
  439. .append("email", getEmail())
  440. .append("phonenumber", getPhonenumber())
  441. .append("sex", getSex())
  442. .append("avatar", getAvatar())
  443. .append("password", getPassword())
  444. .append("salt", getSalt())
  445. .append("status", getStatus())
  446. .append("delFlag", getDelFlag())
  447. .append("loginIp", getLoginIp())
  448. .append("loginDate", getLoginDate())
  449. .append("createBy", getCreateBy())
  450. .append("createTime", getCreateTime())
  451. .append("updateBy", getUpdateBy())
  452. .append("updateTime", getUpdateTime())
  453. .append("remark", getRemark())
  454. .append("dept", getDept())
  455. .toString();
  456. }
  457. @Override
  458. public int hashCode() {
  459. int result = 20;
  460. result = 31 * result + (loginName == null ? 0 : loginName.hashCode());
  461. return result;
  462. }
  463. @Override
  464. public boolean equals(Object object) {
  465. boolean result = false;
  466. if (object instanceof SysUser) {
  467. SysUser that = (SysUser) object;
  468. if (this.hashCode() == that.hashCode()) {
  469. result = true;
  470. }
  471. }
  472. return result;
  473. }
  474. }