InfoUser.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  1. package com.ruoyi.system.domain;
  2. import com.baomidou.mybatisplus.annotation.FieldFill;
  3. import com.baomidou.mybatisplus.annotation.IdType;
  4. import com.baomidou.mybatisplus.annotation.TableField;
  5. import com.baomidou.mybatisplus.annotation.TableId;
  6. import com.baomidou.mybatisplus.annotation.TableName;
  7. import com.ruoyi.common.annotation.Excel;
  8. import lombok.Data;
  9. import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  10. import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  11. import lombok.EqualsAndHashCode;
  12. import org.apache.commons.lang3.builder.ToStringBuilder;
  13. import org.apache.commons.lang3.builder.ToStringStyle;
  14. import java.math.BigDecimal;
  15. import java.util.Date;
  16. import java.util.LinkedHashSet;
  17. import java.util.Locale;
  18. import java.util.Set;
  19. import javax.persistence.GeneratedValue;
  20. /**
  21. * 用户信息对象 info_user
  22. *
  23. * @author ruoyi
  24. * @date 2023-06-25
  25. */
  26. @Data
  27. @TableName(value = "info_user")
  28. @EqualsAndHashCode(callSuper = false)
  29. public class InfoUser
  30. {
  31. private static final long serialVersionUID = 1L;
  32. @TableId(type = IdType.AUTO)
  33. @GeneratedValue
  34. /** 用户ID */
  35. private Long userId;
  36. /** 用户名 */
  37. @Excel(name = "用户名")
  38. private String userName;
  39. /** 手机号码 */
  40. @Excel(name = "手机号码")
  41. private String phone;
  42. /** 用户昵称 */
  43. @Excel(name = "用户昵称")
  44. private String nickName;
  45. /** 用户类型: 0普通用户 1 商家 2 骑手 3夜市 */
  46. @Excel(name = "用户类型")
  47. private String userType;
  48. /** 用户邮箱 */
  49. @Excel(name = "用户邮箱")
  50. private String email;
  51. /** 用户性别(0男 1女 2未知) */
  52. @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
  53. private String sex;
  54. /** 头像地址 */
  55. @Excel(name = "头像地址")
  56. private String avatar;
  57. /** 密码 */
  58. @Excel(name = "密码")
  59. private String password;
  60. /** 帐号状态(0正常 1停用) */
  61. @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
  62. private String status;
  63. /** 分管账号所属商家主账号ID */
  64. private Long merchantOwnerId;
  65. /** 主账号控制状态(0正常 1停用) */
  66. private String subaccountStatus;
  67. /** 最近一次商家端成功登录时间 */
  68. private Date lastLoginAt;
  69. /** 删除标志(0代表存在 1代表删除) */
  70. @Excel(name = "删除标志", readConverterExp = "0=代表存在,1=代表删除")
  71. private String delFlag;
  72. /** 会员标识 */
  73. @Excel(name = "会员标识")
  74. private transient String vip;
  75. /** 用户唯一标识 */
  76. @Excel(name = "用户唯一标识")
  77. private String cid;
  78. /** 设备类型(如 ios/android),区分设备类型 */
  79. private String cidType;
  80. /** 我的邀请码 */
  81. @Excel(name = "我的邀请码")
  82. private String mycode;
  83. /** 被邀请标识 */
  84. @Excel(name = "被邀请标识")
  85. private String thiscode;
  86. /** 抽成 */
  87. @Excel(name = "抽成")
  88. private Double commission;
  89. /** 附件 */
  90. @Excel(name = "附件")
  91. private String annex;
  92. /** 审核状态 */
  93. @Excel(name = "审核状态", readConverterExp = "0=待审核,1=审核通过,2=审核不通过")
  94. private String auditStatus;
  95. /** 审核不通过原因 */
  96. @Excel(name = "审核不通过原因")
  97. private String auditRejectReason;
  98. /** 司机审核状态 */
  99. @Excel(name = "司机审核状态", readConverterExp = "0=未审核,1=已审核")
  100. private String shijStatus;
  101. /** 联系电话 */
  102. @Excel(name = "联系电话")
  103. private String telPhone;
  104. /** 驾驶证 */
  105. @Excel(name = "驾驶证")
  106. private String driversLicense;
  107. /** 行驶证 */
  108. @Excel(name = "行驶证")
  109. private String drivingLicense;
  110. /** 车辆照片 */
  111. @Excel(name = "车辆照片")
  112. private String vehiclePhotos;
  113. /** 车牌 */
  114. @Excel(name = "车牌")
  115. private String licensePlate;
  116. /** 骑手车型(1机车 2轿车) */
  117. @Excel(name = "骑手车型")
  118. private String vehicleType;
  119. /** 骑手配送类型(FOOD美食外送、FLASH闪送,逗号分隔多选;空视为两者兼容) */
  120. @Excel(name = "配送类型")
  121. private String deliveryType;
  122. /** 骑手审核大头照(图片URL) */
  123. @Excel(name = "骑手审核大头照")
  124. private String riderHeadPhoto;
  125. /** 预上线城市(骑手申请时选择) */
  126. @Excel(name = "预上线城市")
  127. private String preLaunchCity;
  128. /** 出生日期(yyyy-MM-dd,骑手申请时填写,用于年满18岁校验) */
  129. @Excel(name = "出生日期")
  130. private String birthday;
  131. /** 强制险或电子保险卡(图片URL,多张逗号分隔) */
  132. @Excel(name = "强制险或电子保险卡")
  133. private String insurancePhoto;
  134. /** 良民证(图片URL,可后补) */
  135. @Excel(name = "良民证")
  136. private String policeCertificate;
  137. /** 负责人 */
  138. @Excel(name = "负责人")
  139. private String fullName;
  140. /** 身份证/护照号 */
  141. @Excel(name = "身份证/护照号")
  142. private String idNumber;
  143. /** 商户类型 */
  144. @Excel(name = "商户类型")
  145. private String merchantType;
  146. /** 银行信息 */
  147. @Excel(name = "银行信息")
  148. private String bankAccount;
  149. /** 身份证照片 */
  150. @Excel(name = "身份证照片")
  151. private String passportPhoto;
  152. /** 银行信息照片 */
  153. @Excel(name = "银行信息照片")
  154. private String bankPhoto;
  155. /** 银行账户户名(商家审核资料:收款账户的户名,如负责人姓名或公司户名) */
  156. @Excel(name = "银行账户户名")
  157. private String bankAccountName;
  158. /** 银行名称(商家审核资料:下拉选择,取字典 taiwan_bank_list 的银行中文名) */
  159. @Excel(name = "银行名称")
  160. private String bankName;
  161. /** 银行账号(商家审核资料:收款银行账号) */
  162. @Excel(name = "银行账号")
  163. private String bankAccountNo;
  164. /** 商家接受的支付方式组代码 CSV(031):NULL/空=全部启用,存量商家零行为变化。 */
  165. private String payMethods;
  166. /** 骑手接受的闪送收款方式组代码 CSV(031):NULL/空=平台开放的全部方式。 */
  167. private String flashPayMethods;
  168. /** 商家说明 */
  169. @Excel(name = "商家说明")
  170. private String merchantIntroduction;
  171. /** 營業登記證證明(图片URL,多张逗号分隔,如有) */
  172. @Excel(name = "營業登記證")
  173. private String businessLicense;
  174. /** 董監事資料查詢截圖(图片URL,多张逗号分隔) */
  175. @Excel(name = "董監事资料查询截图")
  176. private String directorsScreenshot;
  177. /** 食品業者登錄字號證明(图片URL,如有) */
  178. @Excel(name = "食品業者登錄字號證明")
  179. private String foodPermit;
  180. /** 實質受益人聲明書 UBO(图片URL,如有) */
  181. @Excel(name = "實質受益人聲明書")
  182. private String uboStatement;
  183. /** 创建时间 */
  184. @TableField(fill = FieldFill.INSERT)
  185. private Date createdAt;
  186. /** 积分钱包 */
  187. @TableField(exist = false)
  188. private Long pointsWallet;
  189. /** 骑手星数 */
  190. @TableField(exist = false)
  191. private Double star;
  192. /** 离线标识 :0 在线 1 离线*/
  193. private String offline;
  194. /** 关联摊位ID(摊位主使用) */
  195. private Long storeId;
  196. /** 夜市地址 */
  197. private String address;
  198. /** 夜市经度 */
  199. private BigDecimal longitude;
  200. /** 夜市纬度 */
  201. private BigDecimal latitude;
  202. /** 距离(km) */
  203. @TableField(exist = false)
  204. private Double juli;
  205. /** IM 平台 API 密钥(extCreate 返回) */
  206. @Excel(name = "IM apiKey")
  207. private String imApiKey;
  208. /** IM 平台用户ID(extCreate 返回,长整型)。序列化为字符串,规避前端 Long 精度丢失 */
  209. @Excel(name = "IM userId")
  210. @JsonSerialize(using = ToStringSerializer.class)
  211. private Long imUserId;
  212. /** 设备推送 token(普通推送):Android FCM token / iOS APNs device token */
  213. private String deviceToken;
  214. /** iOS VoIP 推送 token(PushKit,用于语音/视频来电推送)。显式映射列 voip_token,避免 MyBatis-Plus 驼峰转下划线歧义 */
  215. @TableField("voip_token")
  216. private String voIPToken;
  217. /**
  218. * 补充用户信息(商家、骑手调整用户信息)
  219. */
  220. @TableField(exist = false)
  221. private Boolean updateUserInfo;
  222. public void setUserId(Long userId)
  223. {
  224. this.userId = userId;
  225. }
  226. public Long getUserId()
  227. {
  228. return userId;
  229. }
  230. public void setUserName(String userName) {this.userName = userName;}
  231. public String getUserName() { return userName; }
  232. public void setPhone(String phone)
  233. {
  234. this.phone = phone;
  235. }
  236. public String getPhone()
  237. {
  238. return phone;
  239. }
  240. public void setNickName(String nickName)
  241. {
  242. this.nickName = nickName;
  243. }
  244. public String getNickName()
  245. {
  246. return nickName;
  247. }
  248. public void setUserType(String userType)
  249. {
  250. this.userType = userType;
  251. }
  252. public String getUserType()
  253. {
  254. return userType;
  255. }
  256. public void setEmail(String email)
  257. {
  258. this.email = email;
  259. }
  260. public String getEmail()
  261. {
  262. return email;
  263. }
  264. public void setSex(String sex)
  265. {
  266. this.sex = sex;
  267. }
  268. public String getSex()
  269. {
  270. return sex;
  271. }
  272. public void setAvatar(String avatar)
  273. {
  274. this.avatar = avatar;
  275. }
  276. public String getAvatar()
  277. {
  278. return avatar;
  279. }
  280. public void setPassword(String password)
  281. {
  282. this.password = password;
  283. }
  284. public String getPassword()
  285. {
  286. return password;
  287. }
  288. public void setStatus(String status)
  289. {
  290. this.status = status;
  291. }
  292. public String getStatus()
  293. {
  294. return status;
  295. }
  296. public Long getMerchantOwnerId() {
  297. return merchantOwnerId;
  298. }
  299. public void setMerchantOwnerId(Long merchantOwnerId) {
  300. this.merchantOwnerId = merchantOwnerId;
  301. }
  302. public String getSubaccountStatus() {
  303. return subaccountStatus;
  304. }
  305. public void setSubaccountStatus(String subaccountStatus) {
  306. this.subaccountStatus = subaccountStatus;
  307. }
  308. public Date getLastLoginAt() {
  309. return lastLoginAt;
  310. }
  311. public void setLastLoginAt(Date lastLoginAt) {
  312. this.lastLoginAt = lastLoginAt;
  313. }
  314. public void setDelFlag(String delFlag)
  315. {
  316. this.delFlag = delFlag;
  317. }
  318. public String getDelFlag()
  319. {
  320. return delFlag;
  321. }
  322. public void setCid(String cid)
  323. {
  324. this.cid = cid;
  325. }
  326. public String getCid()
  327. {
  328. return cid;
  329. }
  330. public void setMycode(String mycode)
  331. {
  332. this.mycode = mycode;
  333. }
  334. public String getMycode()
  335. {
  336. return mycode;
  337. }
  338. public void setThiscode(String thiscode)
  339. {
  340. this.thiscode = thiscode;
  341. }
  342. public String getThiscode()
  343. {
  344. return thiscode;
  345. }
  346. public void setCommission(Double commission)
  347. {
  348. this.commission = commission;
  349. }
  350. public Double getCommission()
  351. {
  352. return commission;
  353. }
  354. public String getAnnex() {
  355. return annex;
  356. }
  357. public void setAnnex(String annex) {
  358. this.annex = annex;
  359. }
  360. public String getAuditStatus() {
  361. return auditStatus;
  362. }
  363. public void setAuditStatus(String auditStatus) {
  364. this.auditStatus = auditStatus;
  365. }
  366. public String getAuditRejectReason() {
  367. return auditRejectReason;
  368. }
  369. public void setAuditRejectReason(String auditRejectReason) {
  370. this.auditRejectReason = auditRejectReason;
  371. }
  372. public String getTelPhone() {
  373. return telPhone;
  374. }
  375. public void setTelPhone(String telPhone) {
  376. this.telPhone = telPhone;
  377. }
  378. public String getShijStatus() {
  379. return shijStatus;
  380. }
  381. public void setShijStatus(String shijStatus) {
  382. this.shijStatus = shijStatus;
  383. }
  384. public String getDriversLicense() {
  385. return driversLicense;
  386. }
  387. public void setDriversLicense(String driversLicense) {
  388. this.driversLicense = driversLicense;
  389. }
  390. public String getDrivingLicense() {
  391. return drivingLicense;
  392. }
  393. public void setDrivingLicense(String drivingLicense) {
  394. this.drivingLicense = drivingLicense;
  395. }
  396. public String getVehiclePhotos() {
  397. return vehiclePhotos;
  398. }
  399. public void setVehiclePhotos(String vehiclePhotos) {
  400. this.vehiclePhotos = vehiclePhotos;
  401. }
  402. public String getLicensePlate() {
  403. return licensePlate;
  404. }
  405. public void setLicensePlate(String licensePlate) {
  406. this.licensePlate = licensePlate;
  407. }
  408. public String getVehicleType() {
  409. return vehicleType;
  410. }
  411. public void setVehicleType(String vehicleType) {
  412. this.vehicleType = vehicleType;
  413. }
  414. public String getDeliveryType() {
  415. return deliveryType;
  416. }
  417. public void setDeliveryType(String deliveryType) {
  418. this.deliveryType = deliveryType;
  419. }
  420. /**
  421. * 骑手是否承接指定配送类型。
  422. * 配送类型为空的历史骑手视为同时兼容美食外送与闪送,保持既有派单行为不变。
  423. */
  424. public boolean supportsDeliveryType(String type) {
  425. if (deliveryType == null || deliveryType.isBlank()) {
  426. return true;
  427. }
  428. for (String value : deliveryType.split(",")) {
  429. if (type.equalsIgnoreCase(value.trim())) {
  430. return true;
  431. }
  432. }
  433. return false;
  434. }
  435. /**
  436. * 归一化客户端提交的配送类型:大写、去空白、去重并按固定顺序输出。
  437. * 为空返回 null;包含无法识别的值时抛出 IllegalArgumentException。
  438. */
  439. public static String normalizeDeliveryTypes(String value) {
  440. if (value == null || value.isBlank()) {
  441. return null;
  442. }
  443. Set<String> types = new LinkedHashSet<>();
  444. for (String token : value.split(",")) {
  445. String type = token.trim().toUpperCase(Locale.ROOT);
  446. if (!"FOOD".equals(type) && !"FLASH".equals(type)) {
  447. throw new IllegalArgumentException("invalid delivery type: " + token);
  448. }
  449. types.add(type);
  450. }
  451. if (types.isEmpty()) {
  452. return null;
  453. }
  454. return String.join(",", types);
  455. }
  456. public String getRiderHeadPhoto() {
  457. return riderHeadPhoto;
  458. }
  459. public void setRiderHeadPhoto(String riderHeadPhoto) {
  460. this.riderHeadPhoto = riderHeadPhoto;
  461. }
  462. public String getPreLaunchCity() {
  463. return preLaunchCity;
  464. }
  465. public void setPreLaunchCity(String preLaunchCity) {
  466. this.preLaunchCity = preLaunchCity;
  467. }
  468. public String getBirthday() {
  469. return birthday;
  470. }
  471. public void setBirthday(String birthday) {
  472. this.birthday = birthday;
  473. }
  474. public String getInsurancePhoto() {
  475. return insurancePhoto;
  476. }
  477. public void setInsurancePhoto(String insurancePhoto) {
  478. this.insurancePhoto = insurancePhoto;
  479. }
  480. public String getPoliceCertificate() {
  481. return policeCertificate;
  482. }
  483. public void setPoliceCertificate(String policeCertificate) {
  484. this.policeCertificate = policeCertificate;
  485. }
  486. public String getFullName() {
  487. return fullName;
  488. }
  489. public void setFullName(String fullName) {
  490. this.fullName = fullName;
  491. }
  492. public String getIdNumber() {
  493. return idNumber;
  494. }
  495. public void setIdNumber(String idNumber) {
  496. this.idNumber = idNumber;
  497. }
  498. public String getMerchantType() {
  499. return merchantType;
  500. }
  501. public void setMerchantType(String merchantType) {
  502. this.merchantType = merchantType;
  503. }
  504. public String getBankAccount() {
  505. return bankAccount;
  506. }
  507. public void setBankAccount(String bankAccount) {
  508. this.bankAccount = bankAccount;
  509. }
  510. public String getPassportPhoto() {
  511. return passportPhoto;
  512. }
  513. public void setPassportPhoto(String passportPhoto) {
  514. this.passportPhoto = passportPhoto;
  515. }
  516. public String getBankPhoto() {
  517. return bankPhoto;
  518. }
  519. public void setBankPhoto(String bankPhoto) {
  520. this.bankPhoto = bankPhoto;
  521. }
  522. public String getMerchantIntroduction() {
  523. return merchantIntroduction;
  524. }
  525. public void setMerchantIntroduction(String merchantIntroduction) {
  526. this.merchantIntroduction = merchantIntroduction;
  527. }
  528. public String getBusinessLicense() {
  529. return businessLicense;
  530. }
  531. public void setBusinessLicense(String businessLicense) {
  532. this.businessLicense = businessLicense;
  533. }
  534. public String getDirectorsScreenshot() {
  535. return directorsScreenshot;
  536. }
  537. public void setDirectorsScreenshot(String directorsScreenshot) {
  538. this.directorsScreenshot = directorsScreenshot;
  539. }
  540. public String getFoodPermit() {
  541. return foodPermit;
  542. }
  543. public void setFoodPermit(String foodPermit) {
  544. this.foodPermit = foodPermit;
  545. }
  546. public String getUboStatement() {
  547. return uboStatement;
  548. }
  549. public void setUboStatement(String uboStatement) {
  550. this.uboStatement = uboStatement;
  551. }
  552. public Date getCreatedAt() {
  553. return createdAt;
  554. }
  555. public void setCreatedAt(Date createdAt) {
  556. this.createdAt = createdAt;
  557. }
  558. @Override
  559. public String toString() {
  560. return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  561. .append("userId", getUserId())
  562. .append("userName", getUserName())
  563. .append("phone", getPhone())
  564. .append("nickName", getNickName())
  565. .append("userType", getUserType())
  566. .append("email", getEmail())
  567. .append("sex", getSex())
  568. .append("avatar", getAvatar())
  569. .append("password", getPassword())
  570. .append("status", getStatus())
  571. .append("merchantOwnerId", getMerchantOwnerId())
  572. .append("subaccountStatus", getSubaccountStatus())
  573. .append("lastLoginAt", getLastLoginAt())
  574. .append("delFlag", getDelFlag())
  575. .append("cid", getCid())
  576. .append("mycode", getMycode())
  577. .append("mycode", getMycode())
  578. .append("thiscode", getThiscode())
  579. .append("commission", getCommission())
  580. .append("annex", getAnnex())
  581. .append("auditStatus", getAuditStatus())
  582. .append("auditRejectReason", getAuditRejectReason())
  583. .append("telPhone", getTelPhone())
  584. .append("shijStatus", getShijStatus())
  585. .append("driversLicense", getDriversLicense())
  586. .append("drivingLicense", getDrivingLicense())
  587. .append("vehiclePhotos", getVehiclePhotos())
  588. .append("licensePlate", getLicensePlate())
  589. .append("fullName", getFullName())
  590. .append("idNumber", getIdNumber())
  591. .append("merchantType", getMerchantType())
  592. .append("bankAccount", getBankAccount())
  593. .append("passportPhoto", getPassportPhoto())
  594. .append("bankPhoto", getBankPhoto())
  595. .append("merchantIntroduction", getMerchantIntroduction())
  596. .toString();
  597. }
  598. }