OrderDon.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. package com.cyksj.model.entity;
  2. import lombok.*;
  3. import java.io.Serializable;
  4. import java.math.BigDecimal;
  5. import java.util.Arrays;
  6. import java.util.Date;
  7. /**
  8. * @author chan
  9. * @date 2021/10/11 下午4:04
  10. */
  11. @Getter
  12. @Setter
  13. public class OrderDon extends BaseEntity implements Serializable {
  14. /**
  15. * 座位id
  16. */
  17. private Long relationId;
  18. /**
  19. * 商品id
  20. */
  21. private Long skuId;
  22. /** 订单号 */
  23. private String orderNo ;
  24. private Long goodsId;
  25. /**
  26. * 微信订单号
  27. */
  28. private String transactionId;
  29. /** 用户id */
  30. private Long userId ;
  31. /**
  32. * openId
  33. */
  34. private String openId;
  35. /** 金额 */
  36. private BigDecimal money ;
  37. /**
  38. * 退款金额
  39. */
  40. private BigDecimal refundMoney;
  41. /**
  42. * 购买数量
  43. */
  44. private Integer num;
  45. /** 支付状态 */
  46. private Status status ;
  47. /**
  48. * 支付类型
  49. */
  50. private Type type;
  51. /**
  52. * 订单类型 1普通订单、2续费订单
  53. * 默认值为1
  54. */
  55. private Integer orderType;
  56. /**
  57. * 支付时间
  58. */
  59. private Date payTime;
  60. public enum Status {
  61. /**
  62. * 订单状态
  63. */
  64. close("关闭订单"),
  65. noPayment("待付款"),
  66. hasPayment("已付款"),
  67. transport("已发货"),
  68. received("已签收"),
  69. complete("已完成"),
  70. refund("已退款"),
  71. ;
  72. private String desc;
  73. Status(String desc) {
  74. this.desc = desc;
  75. }
  76. public String getDesc() {
  77. return desc;
  78. }
  79. }
  80. @Getter
  81. @AllArgsConstructor
  82. public enum Type{
  83. WeChat("wechat","微信"),
  84. ALI_PAY("zfb","支付宝"),
  85. EX_CODE("exchange_code","兑换码"),
  86. ;
  87. String type;
  88. String desc;
  89. public static Type getType(String type) {
  90. return Arrays.stream(Type.values()).filter(tp -> tp.getType().equals(type)).findFirst().orElse(WeChat);
  91. }
  92. }
  93. }