SysUser.java 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  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. //大区
  120. private String officeName;
  121. //销售部
  122. private String subOfficeName;
  123. //销售部编码
  124. private String subOfficeCode;
  125. //公司名称
  126. private String companyName;
  127. /** 雇员id */
  128. private String sapEmployeeId;
  129. /** 是否刷新供应商标识*/
  130. private String isRefreshProvider;
  131. //应用类型对应关系
  132. private List<Map<String,Object> >loginTypeList;
  133. //门店对应关系
  134. private List<Map<String,Object> >loginTypeInfo;
  135. public String getSapEmployeeId() {
  136. return sapEmployeeId;
  137. }
  138. public void setSapEmployeeId(String sapEmployeeId) {
  139. this.sapEmployeeId = sapEmployeeId;
  140. }
  141. public void setLoginTypeInfo(List<Map<String, Object>> loginTypeInfo) {
  142. this.loginTypeInfo = loginTypeInfo;
  143. }
  144. public List<Map<String, Object>> getLoginTypeInfo() {
  145. return loginTypeInfo;
  146. }
  147. public void setLoginTypeList(List<Map<String, Object>> loginTypeList) {
  148. this.loginTypeList = loginTypeList;
  149. }
  150. public List<Map<String, Object>> getLoginTypeList() {
  151. return loginTypeList;
  152. }
  153. public String getCompanyName() {
  154. return companyName;
  155. }
  156. public String getSubOfficeCode() {
  157. return subOfficeCode;
  158. }
  159. public void setSubOfficeCode(String subOfficeCode) {
  160. this.subOfficeCode = subOfficeCode;
  161. }
  162. public void setCompanyName(String companyName) {
  163. this.companyName = companyName;
  164. }
  165. private String shopType;
  166. public String getQuit(){return quit;}
  167. public String getShopType() {
  168. return shopType;
  169. }
  170. public void setShopType(String shopType) {
  171. this.shopType = shopType;
  172. }
  173. public String getIsShopAccount() {
  174. return isShopAccount;
  175. }
  176. public void setIsShopAccount(String isShopAccount) {
  177. this.isShopAccount = isShopAccount;
  178. }
  179. public void setQuit(String quit){this.quit=quit;}
  180. public String getAuthorType() {
  181. return authorType;
  182. }
  183. public void setAuthorType(String authorType) {
  184. this.authorType = authorType;
  185. }
  186. public String getIsRefreshProvider() {
  187. return isRefreshProvider;
  188. }
  189. public void setIsRefreshProvider(String isRefreshProvider) {
  190. this.isRefreshProvider = isRefreshProvider;
  191. }
  192. // /** 所属销售组织等级 详见字典(sales_level) */
  193. // private String salesLevel;
  194. //
  195. // /** 所属销售组织名称 */
  196. // private String orgName;
  197. //
  198. // /** 所属销售组织code */
  199. // private String orgCode;
  200. public SysUser()
  201. {
  202. }
  203. public String getIsSelfDelivery() {
  204. return isSelfDelivery;
  205. }
  206. public String getOfficeName() {
  207. return officeName;
  208. }
  209. public void setOfficeName(String officeName) {
  210. this.officeName = officeName;
  211. }
  212. public String getSubOfficeName() {
  213. return subOfficeName;
  214. }
  215. public void setSubOfficeName(String subOfficeName) {
  216. this.subOfficeName = subOfficeName;
  217. }
  218. public void setIsSelfDelivery(String isSelfDelivery) {
  219. this.isSelfDelivery = isSelfDelivery;
  220. }
  221. public String getIsIndependently() {
  222. return isIndependently;
  223. }
  224. public void setIsIndependently(String isIndependently) {
  225. this.isIndependently = isIndependently;
  226. }
  227. public List<Ztree> getAuthor() {
  228. return author;
  229. }
  230. public void setAuthor(List<Ztree> author) {
  231. this.author = author;
  232. }
  233. public SysUser(Long userId)
  234. {
  235. this.userId = userId;
  236. }
  237. public Long getCompanyId() {
  238. return companyId;
  239. }
  240. public void setCompanyId(Long companyId) {
  241. this.companyId = companyId;
  242. }
  243. public Long getUserId()
  244. {
  245. return userId;
  246. }
  247. public void setUserId(Long userId)
  248. {
  249. this.userId = userId;
  250. }
  251. public boolean isAdmin()
  252. {
  253. return isAdmin(this.userId);
  254. }
  255. public static boolean isAdmin(Long userId)
  256. {
  257. return userId != null && 1L == userId;
  258. }
  259. public Long getDeptId()
  260. {
  261. return deptId;
  262. }
  263. public void setDeptId(Long deptId)
  264. {
  265. this.deptId = deptId;
  266. }
  267. public Long getParentId()
  268. {
  269. return parentId;
  270. }
  271. public void setParentId(Long parentId)
  272. {
  273. this.parentId = parentId;
  274. }
  275. public Long getRoleId()
  276. {
  277. return roleId;
  278. }
  279. public void setRoleId(Long roleId)
  280. {
  281. this.roleId = roleId;
  282. }
  283. @NotBlank(message = "登录账号不能为空")
  284. @Size(min = 0, max = 30, message = "登录账号长度不能超过30个字符")
  285. public String getLoginName()
  286. {
  287. return loginName;
  288. }
  289. public void setLoginName(String loginName)
  290. {
  291. this.loginName = loginName;
  292. }
  293. @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
  294. public String getUserName()
  295. {
  296. return userName;
  297. }
  298. public void setUserName(String userName)
  299. {
  300. this.userName = userName;
  301. }
  302. @Email(message = "邮箱格式不正确")
  303. @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
  304. public String getEmail()
  305. {
  306. return email;
  307. }
  308. public void setEmail(String email)
  309. {
  310. this.email = email;
  311. }
  312. @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
  313. public String getPhonenumber()
  314. {
  315. return phonenumber;
  316. }
  317. public void setPhonenumber(String phonenumber)
  318. {
  319. this.phonenumber = phonenumber;
  320. }
  321. public String getSex()
  322. {
  323. return sex;
  324. }
  325. public void setSex(String sex)
  326. {
  327. this.sex = sex;
  328. }
  329. public String getAvatar()
  330. {
  331. return avatar;
  332. }
  333. public void setAvatar(String avatar)
  334. {
  335. this.avatar = avatar;
  336. }
  337. public String getPassword()
  338. {
  339. return password;
  340. }
  341. public void setPassword(String password)
  342. {
  343. this.password = password;
  344. }
  345. public String getSalt()
  346. {
  347. return salt;
  348. }
  349. public void setSalt(String salt)
  350. {
  351. this.salt = salt;
  352. }
  353. public String getStatus()
  354. {
  355. return status;
  356. }
  357. public void setStatus(String status)
  358. {
  359. this.status = status;
  360. }
  361. public String getDelFlag()
  362. {
  363. return delFlag;
  364. }
  365. public void setDelFlag(String delFlag)
  366. {
  367. this.delFlag = delFlag;
  368. }
  369. public String getLoginIp()
  370. {
  371. return loginIp;
  372. }
  373. public void setLoginIp(String loginIp)
  374. {
  375. this.loginIp = loginIp;
  376. }
  377. public Date getLoginDate()
  378. {
  379. return loginDate;
  380. }
  381. public void setLoginDate(Date loginDate)
  382. {
  383. this.loginDate = loginDate;
  384. }
  385. public SysDept getDept()
  386. {
  387. if (dept == null)
  388. {
  389. dept = new SysDept();
  390. }
  391. return dept;
  392. }
  393. public SysCompany getCompany() {
  394. return company;
  395. }
  396. public void setCompany(SysCompany company) {
  397. this.company = company;
  398. }
  399. public void setDept(SysDept dept)
  400. {
  401. this.dept = dept;
  402. }
  403. public List<SysRole> getRoles()
  404. {
  405. return roles;
  406. }
  407. public void setRoles(List<SysRole> roles)
  408. {
  409. this.roles = roles;
  410. }
  411. public Long[] getRoleIds()
  412. {
  413. return roleIds;
  414. }
  415. public void setRoleIds(Long[] roleIds)
  416. {
  417. this.roleIds = roleIds;
  418. }
  419. public Long[] getPostIds()
  420. {
  421. return postIds;
  422. }
  423. public void setPostIds(Long[] postIds)
  424. {
  425. this.postIds = postIds;
  426. }
  427. private String workAddr;
  428. private String workSchedul;
  429. private String addrNum;
  430. private String schedulDetail;
  431. public String getWorkAddr() {
  432. return workAddr;
  433. }
  434. public void setWorkAddr(String workAddr) {
  435. this.workAddr = workAddr;
  436. }
  437. public String getWorkSchedul() {
  438. return workSchedul;
  439. }
  440. public void setWorkSchedul(String workSchedul) {
  441. this.workSchedul = workSchedul;
  442. }
  443. public String getAddrNum() {
  444. return addrNum;
  445. }
  446. public void setAddrNum(String addrNum) {
  447. this.addrNum = addrNum;
  448. }
  449. public String getSchedulDetail() {
  450. return schedulDetail;
  451. }
  452. public void setSchedulDetail(String schedulDetail) {
  453. this.schedulDetail = schedulDetail;
  454. }
  455. public SysUserExt getSysUserExt() {
  456. return sysUserExt;
  457. }
  458. public void setSysUserExt(SysUserExt sysUserExt) {
  459. this.sysUserExt = sysUserExt;
  460. }
  461. public String getIdType() {
  462. return idType;
  463. }
  464. public void setIdType(String idType) {
  465. this.idType = idType;
  466. }
  467. public String getIdNumber() {
  468. return idNumber;
  469. }
  470. public void setIdNumber(String idNumber) {
  471. this.idNumber = idNumber;
  472. }
  473. public String getAccountId() {
  474. return accountId;
  475. }
  476. public void setAccountId(String accountId) {
  477. this.accountId = accountId;
  478. }
  479. public String getIsAuthentication() {
  480. return isAuthentication;
  481. }
  482. public void setIsAuthentication(String isAuthentication) {
  483. this.isAuthentication = isAuthentication;
  484. }
  485. public Date getPersonAttestationTime() {
  486. return personAttestationTime;
  487. }
  488. public void setPersonAttestationTime(Date personAttestationTime) {
  489. this.personAttestationTime = personAttestationTime;
  490. }
  491. public String getReceiveUrlMobileNo() {
  492. return receiveUrlMobileNo;
  493. }
  494. public void setReceiveUrlMobileNo(String receiveUrlMobileNo) {
  495. this.receiveUrlMobileNo = receiveUrlMobileNo;
  496. }
  497. public String getIsConsignee() {
  498. return isConsignee;
  499. }
  500. public void setIsConsignee(String isConsignee) {
  501. this.isConsignee = isConsignee;
  502. }
  503. public String getIsOrgAuthentication() {
  504. return isOrgAuthentication;
  505. }
  506. public void setIsOrgAuthentication(String isOrgAuthentication) {
  507. this.isOrgAuthentication = isOrgAuthentication;
  508. }
  509. public Date getOrgAttestationTime() {
  510. return orgAttestationTime;
  511. }
  512. public void setOrgAttestationTime(Date orgAttestationTime) {
  513. this.orgAttestationTime = orgAttestationTime;
  514. }
  515. public List<SysUserExt> getSysUserExtLsit() {
  516. return sysUserExtLsit;
  517. }
  518. public void setSysUserExtLsit(List<SysUserExt> sysUserExtLsit) {
  519. this.sysUserExtLsit = sysUserExtLsit;
  520. }
  521. public String getIsSync() {
  522. return isSync;
  523. }
  524. public void setIsSync(String isSync) {
  525. this.isSync = isSync;
  526. }
  527. @Override
  528. public String toString() {
  529. return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  530. .append("userId", getUserId())
  531. .append("deptId", getDeptId())
  532. .append("companyId", getDeptId())
  533. .append("loginName", getLoginName())
  534. .append("userName", getUserName())
  535. .append("email", getEmail())
  536. .append("phonenumber", getPhonenumber())
  537. .append("sex", getSex())
  538. .append("avatar", getAvatar())
  539. .append("password", getPassword())
  540. .append("salt", getSalt())
  541. .append("status", getStatus())
  542. .append("delFlag", getDelFlag())
  543. .append("loginIp", getLoginIp())
  544. .append("loginDate", getLoginDate())
  545. .append("createBy", getCreateBy())
  546. .append("createTime", getCreateTime())
  547. .append("updateBy", getUpdateBy())
  548. .append("updateTime", getUpdateTime())
  549. .append("remark", getRemark())
  550. .append("dept", getDept())
  551. .toString();
  552. }
  553. }