package com.slodon.b2b2c.vo.statistics;

import com.slodon.b2b2c.core.util.FileUrlUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 *
 * 封装交易分析-商品排行Vo对象
 * @author wuxy
 */
@Data
public class GoodsRankVO {

    @ApiModelProperty("商品id")
    private Long goodsId;

    @ApiModelProperty("商品名称")
    private String goodsName;

    @ApiModelProperty("商品图片")
    private String goodsImage;

    @ApiModelProperty("销售额")
    private BigDecimal saleAmount;

    @ApiModelProperty("销量")
    private Integer saleNum;

    @ApiModelProperty("浏览量")
    private Integer viewNum;

    @ApiModelProperty("访客数")
    private Integer visitorNum;

    @ApiModelProperty("收藏数")
    private Integer collectionNum;

    @ApiModelProperty("支付订单数")
    private Integer orderPayNum;

    /**
     * 商品销售排行
     *
     * @param goodsId
     * @param goodsName
     * @param goodsImage
     * @param saleAmount
     * @param saleNum
     */
    public GoodsRankVO(Long goodsId, String goodsName, String goodsImage, BigDecimal saleAmount, Integer saleNum) {
        this.goodsId = goodsId;
        this.goodsName = goodsName;
        this.goodsImage = FileUrlUtil.getFileUrl(goodsImage, null);
        this.saleAmount = saleAmount;
        this.saleNum = saleNum;
    }

    /**
     * 商品流量排行
     *
     * @param goodsId
     * @param goodsName
     * @param goodsImage
     * @param viewNum
     * @param visitorNum
     */
    public GoodsRankVO(Long goodsId, String goodsName, String goodsImage, Integer viewNum, Integer visitorNum) {
        this.goodsId = goodsId;
        this.goodsName = goodsName;
        this.goodsImage = FileUrlUtil.getFileUrl(goodsImage, null);
        this.viewNum = viewNum;
        this.visitorNum = visitorNum;
    }

    /**
     * 会员偏好商品排行
     *
     * @param goodsId
     * @param goodsName
     * @param goodsImage
     * @param viewNum
     * @param collectionNum
     * @param orderPayNum
     */
    public GoodsRankVO(Long goodsId, String goodsName, String goodsImage, Integer viewNum, Integer collectionNum, Integer orderPayNum) {
        this.goodsId = goodsId;
        this.goodsName = goodsName;
        this.goodsImage = FileUrlUtil.getFileUrl(goodsImage, null);
        this.viewNum = viewNum;
        this.collectionNum = collectionNum;
        this.orderPayNum = orderPayNum;
    }
}
