package org.springblade.modules.mall.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 销售信息
 */
@Data
public class SalesVO {
	@ApiModelProperty(value = "日期")
	private String time;
	@ApiModelProperty(value = "创建时间")
	private Date createTime;
	@ApiModelProperty(value = "来源")
	private String source;
	@ApiModelProperty(value = "来源名称")
	private String sourceName;
	@ApiModelProperty(value = "品牌名称")
	private String brandName;
	@ApiModelProperty(value = "商品名称")
	private String goodsName;
	@ApiModelProperty(value = "规格Id")
	private String specId;
	@ApiModelProperty(value = "规格名称")
	private String goodsSpecNames;
	@ApiModelProperty(value = "名称字符串")
	private String nameStr;
	@ApiModelProperty(value = "销售价格")
	private String salePrice;
	@ApiModelProperty(value = "协议价格")
	private String agreementPrice;
	@ApiModelProperty(value = "销售数量")
	private String totalNum;
	@ApiModelProperty(value = "应收金额")
	private BigDecimal receivableAmount=BigDecimal.ZERO;
	@ApiModelProperty(value = "抵扣金额")
	private BigDecimal deductionAmount=BigDecimal.ZERO;
	@ApiModelProperty(value = "实收金额")
	private BigDecimal paidInAmount=BigDecimal.ZERO;
	@ApiModelProperty(value = "专区类型")
	private Integer zoneType;
	@ApiModelProperty(value = "专区类型名称")
	private String zoneTypeName;

	public String getNameStr() {
		StringBuilder sb = new StringBuilder();
		if (this.brandName != null) {
			sb.append(this.brandName);
		}
		if (this.goodsName != null) {
			sb.append(this.goodsName);
		}
		if (this.goodsSpecNames != null) {
			sb.append(this.goodsSpecNames);
		}
		return sb.toString();
	}
	public BigDecimal getPaidInAmount() {
		return receivableAmount.subtract(deductionAmount);
	}
}
