OrderVo.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package com.ruoyi.demo.entity.vo;
  2. import com.alibaba.excel.annotation.ExcelIgnore;
  3. import com.alibaba.excel.annotation.ExcelProperty;
  4. import com.alibaba.excel.annotation.format.DateTimeFormat;
  5. import com.alibaba.excel.annotation.format.NumberFormat;
  6. import com.alibaba.excel.converters.bigdecimal.BigDecimalNumberConverter;
  7. import com.alibaba.excel.converters.date.DateStringConverter;
  8. import com.ruoyi.demo.entity.Order;
  9. import lombok.Data;
  10. import java.math.BigDecimal;
  11. import java.util.Date;
  12. @Data
  13. public class OrderVo {
  14. @ExcelProperty(value = "订单编码")
  15. private String orderId;
  16. @ExcelIgnore
  17. private String appName;
  18. @ExcelProperty(value = "商品名称")
  19. private String goodsName;
  20. @ExcelProperty(value = "规格")
  21. private String specs;
  22. @ExcelProperty(value = "单价", converter = BigDecimalNumberConverter.class)
  23. @NumberFormat("#.##")
  24. private BigDecimal goodsPrice;
  25. @ExcelProperty(value = "订单总额", converter = BigDecimalNumberConverter.class)
  26. @NumberFormat("#.##")
  27. private BigDecimal totalPrice;
  28. @ExcelProperty(value = "交易状态")
  29. private String state;
  30. @ExcelProperty(value = "买家")
  31. private String userName;
  32. @ExcelProperty(value = "卖家")
  33. private String vendorName;
  34. @ExcelProperty(value = "创建时间", converter = DateStringConverter.class)
  35. @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
  36. private Date createTime;
  37. public OrderVo(){}
  38. public OrderVo(Order order){
  39. this.orderId = order.getOrderId();
  40. this.appName = order.getAppName();
  41. this.goodsName = order.getGoodsName();
  42. this.specs = order.getSpecs();
  43. this.goodsPrice = order.getGoodsPrice();
  44. this.totalPrice = order.getTotalPrice();
  45. this.state = order.getState();
  46. this.userName = order.getUserName();
  47. this.vendorName = order.getVendorName();
  48. this.createTime = order.getCreateTime();
  49. }
  50. }