SalesVO.java 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package org.springblade.modules.mall.vo;
  2. import io.swagger.annotations.ApiModelProperty;
  3. import lombok.Data;
  4. import org.springblade.common.enums.GoodsSourceEnum;
  5. import org.springblade.common.enums.ZoneTypeEnum;
  6. import java.math.BigDecimal;
  7. import java.util.Date;
  8. /**
  9. * 销售信息
  10. */
  11. @Data
  12. public class SalesVO {
  13. @ApiModelProperty(value = "日期")
  14. private String time;
  15. @ApiModelProperty(value = "创建时间")
  16. private Date createTime;
  17. @ApiModelProperty(value = "来源")
  18. private String source;
  19. @ApiModelProperty(value = "来源名称")
  20. private String sourceName;
  21. @ApiModelProperty(value = "品牌名称")
  22. private String brandName;
  23. @ApiModelProperty(value = "商品名称")
  24. private String goodsName;
  25. @ApiModelProperty(value = "规格Id")
  26. private String specId;
  27. @ApiModelProperty(value = "规格名称")
  28. private String goodsSpecNames;
  29. @ApiModelProperty(value = "名称字符串")
  30. private String nameStr;
  31. @ApiModelProperty(value = "销售价格")
  32. private String salePrice;
  33. @ApiModelProperty(value = "协议价格")
  34. private String agreementPrice;
  35. @ApiModelProperty(value = "销售数量")
  36. private String totalNum;
  37. @ApiModelProperty(value = "应收金额")
  38. private BigDecimal receivableAmount=BigDecimal.ZERO;
  39. @ApiModelProperty(value = "抵扣金额")
  40. private BigDecimal deductionAmount=BigDecimal.ZERO;
  41. @ApiModelProperty(value = "实收金额")
  42. private BigDecimal paidInAmount=BigDecimal.ZERO;
  43. @ApiModelProperty(value = "专区类型")
  44. private Integer zoneType;
  45. @ApiModelProperty(value = "专区类型名称")
  46. private String zoneTypeName;
  47. public String getNameStr() {
  48. StringBuilder sb = new StringBuilder();
  49. if (this.brandName != null) {
  50. sb.append(this.brandName);
  51. }
  52. if (this.goodsName != null) {
  53. sb.append(this.goodsName);
  54. }
  55. if (this.goodsSpecNames != null) {
  56. sb.append(this.goodsSpecNames);
  57. }
  58. return sb.toString();
  59. }
  60. public String getSourceName() {
  61. return GoodsSourceEnum.getNameByValue(source);
  62. }
  63. public String getZoneTypeName() {
  64. return ZoneTypeEnum.getNameByValue(zoneType);
  65. }
  66. public BigDecimal getPaidInAmount() {
  67. return receivableAmount.subtract(deductionAmount);
  68. }
  69. }