VipOrderDon.java 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. package com.cyksj.model.entity;
  2. import cn.hutool.core.util.StrUtil;
  3. import com.baomidou.mybatisplus.annotation.TableField;
  4. import com.ejlchina.searcher.bean.DbIgnore;
  5. import lombok.AllArgsConstructor;
  6. import lombok.Getter;
  7. import lombok.Setter;
  8. import java.math.BigDecimal;
  9. import java.util.Arrays;
  10. import java.util.Date;
  11. /**
  12. * 项目名: yhlxj2
  13. * 文件名: VipOrderDon
  14. * 创建者: JavaZou
  15. * 创建时间:2025/5/13 10:38
  16. */
  17. @Getter
  18. @Setter
  19. public class VipOrderDon extends BaseEntity{
  20. private Long goodsId;
  21. /**
  22. * cps后台推广id
  23. */
  24. private Long cpsPopularizeId;
  25. /** 订单号 */
  26. private String orderNo ;
  27. /**
  28. * 买家支付id
  29. */
  30. private String buyerId;
  31. /**
  32. * 微信订单号
  33. */
  34. private String transactionId;
  35. /** 用户id */
  36. private Long userId ;
  37. /**
  38. * openId
  39. */
  40. private String openId;
  41. /** 金额 */
  42. private BigDecimal money;
  43. /**
  44. * 海外支付金额
  45. */
  46. private BigDecimal abroadMoney;
  47. /**
  48. * 手续费
  49. */
  50. private BigDecimal abroadTransactionFee;
  51. /**
  52. * 退款金额
  53. */
  54. private BigDecimal refundMoney;
  55. /**
  56. * 退款余额
  57. */
  58. private BigDecimal refundBalance;
  59. /**
  60. * 退款原因
  61. */
  62. private String refundDesc;
  63. /** 支付状态 */
  64. private Status status ;
  65. /**
  66. * 支付类型
  67. */
  68. private Type type;
  69. /**
  70. * 订单类型 1普通订单、2续费订单
  71. * 默认值为1
  72. */
  73. private Integer orderType;
  74. /**
  75. * 是否是分销订单
  76. */
  77. private Boolean isDistribute;
  78. /**
  79. * 是否是固定推广者分销
  80. */
  81. private Boolean isFixedDistribute;
  82. private Integer num;
  83. /**
  84. * 支付时间
  85. */
  86. private Date payTime;
  87. /**
  88. * 商户id
  89. */
  90. private String shopId;
  91. /**
  92. * 渠道链接id
  93. */
  94. private Long popularizeId;
  95. /**
  96. * 是否是网页端支付 默认0移动端支付
  97. */
  98. private Boolean isWebPay;
  99. /**
  100. * 余额支付
  101. */
  102. private BigDecimal balance;
  103. private String payTitle;
  104. /**
  105. * 付款说明
  106. */
  107. @TableField(exist = false)
  108. @DbIgnore
  109. private String payDesc;
  110. public enum Status {
  111. /**
  112. * 订单状态
  113. */
  114. close("已关闭"),
  115. noPayment("待付款"),
  116. hasPayment("已付款"),
  117. complete("已完成"),
  118. refund("已退款"),
  119. ;
  120. private String desc;
  121. Status(String desc) {
  122. this.desc = desc;
  123. }
  124. public String getDesc() {
  125. return desc;
  126. }
  127. }
  128. @Getter
  129. @AllArgsConstructor
  130. public enum Type{
  131. WeChat("wechat","微信"),
  132. ALI_PAY("zfb","支付宝"),
  133. BALANCE("balance", "余额支付"),
  134. PAYPAL("paypal","paypal支付"),
  135. STRIPE("stripe","stripe支付"),
  136. GALAXY_COIN("galaxy_coin","银河币支付"),
  137. ;
  138. String type;
  139. String desc;
  140. public static VipOrderDon.Type getType(String type) {
  141. if (StrUtil.isEmpty(type)) {
  142. return ALI_PAY;
  143. }
  144. return Arrays.stream(VipOrderDon.Type.values()).filter(tp -> tp.getType().equals(type)).findFirst().orElse(ALI_PAY);
  145. }
  146. }
  147. }