SysUser.java 15 KB

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