OrderDon.java 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 Integer num;
  41. /** 支付状态 */
  42. private Status status ;
  43. /**
  44. * 支付类型
  45. */
  46. private Type type;
  47. /**
  48. * 支付时间
  49. */
  50. private Date payTime;
  51. public enum Status {
  52. /**
  53. * 订单状态
  54. */
  55. close("关闭订单"),
  56. noPayment("待付款"),
  57. hasPayment("已付款"),
  58. transport("已发货"),
  59. received("已签收"),
  60. complete("已完成");
  61. ;
  62. private String desc;
  63. Status(String desc) {
  64. this.desc = desc;
  65. }
  66. public String getDesc() {
  67. return desc;
  68. }
  69. }
  70. @Getter
  71. @AllArgsConstructor
  72. public enum Type{
  73. WeChat("wechat","微信"),
  74. ALI_PAY("zfb","支付宝"),
  75. ;
  76. String type;
  77. String desc;
  78. public static Type getType(String type) {
  79. return Arrays.stream(Type.values()).filter(tp -> tp.getType().equals(type)).findFirst().orElse(WeChat);
  80. }
  81. }
  82. }