SysUser.java 14 KB

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