package com.iformall.domain.vo;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.iformall.domain.po.WxCoupon;

import javax.persistence.Id;
import javax.persistence.Transient;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@JsonIgnoreProperties(value = {"handler"})
public class WxCouponCVo extends WxCoupon implements Serializable  {
    private static final long serialVersionUID = 1L;

    /*投放券频道id**/
    @Id
    protected Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Transient
    private String salePriceStr;

    @Transient
    private String usePriceStr;

    @Transient
    private String priceStr;


    @Transient
    private Integer activityStatus;

    public Integer getActivityStatus() {
        return activityStatus;
    }

    public void setActivityStatus(Integer activityStatus) {
        this.activityStatus = activityStatus;
    }


    /*券ID**/
    @io.swagger.annotations.ApiModelProperty(value="券ID",name="couponId")
    private Long couponId;
    /*投放频道位置（1.列表, 2.限时抢购）**/
    @io.swagger.annotations.ApiModelProperty(value="投放频道位置（1.列表, 2.限时抢购）",name="targetAd")
    private Integer targetAd;

    /*发放相关参数*/
    /*开始时间**/
    @io.swagger.annotations.ApiModelProperty(value="开始时间",name="beginTime")
    private Date beginTime;
    /*结束时间**/
    @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endTime")
    private Date endTime;


    /*发券商户信息*/
    @io.swagger.annotations.ApiModelProperty(value="商户列表",name="merchantVoList")
    private List<WxMerchantVo> merchantVoList;

    @io.swagger.annotations.ApiModelProperty(value = "是否支持转送(0:不支持,1支持)", name = "supportTransfer")
    private Integer supportTransfer;

    @io.swagger.annotations.ApiModelProperty(value = "限制人数", name = "pressLimitNum")
    private Integer pressLimitNum;

    public Long getCouponId() {
        return couponId;
    }

    public void setCouponId(Long couponId) {
        this.couponId = couponId;
    }

    public Integer getTargetAd() {
        return targetAd;
    }

    public void setTargetAd(Integer targetAd) {
        this.targetAd = targetAd;
    }

    public List<WxMerchantVo> getMerchantVoList() {
        return merchantVoList;
    }

    public void setMerchantVoList(List<WxMerchantVo> merchantVoList) {
        this.merchantVoList = merchantVoList;
    }

    public Date  getBeginTime() {
        return beginTime;
    }
    public void setBeginTime(Date _beginTime) {
        beginTime = _beginTime;
    }
    public Date  getEndTime() {
        return endTime;
    }
    public void setEndTime(Date _endTime) {
        endTime = _endTime;
    }

    public String getSalePriceStr() {
        if(getSalePrice()!=null) {
            salePriceStr = new BigDecimal(getSalePrice()).divide(new BigDecimal(100)).toString();
        }
        return salePriceStr;
    }

    public void setSalePriceStr(String salePriceStr) {
        this.salePriceStr = salePriceStr;
    }

    public String getUsePriceStr() {
        if(getUsePrice()!=null) {
            usePriceStr = new BigDecimal(getUsePrice()).divide(new BigDecimal(100)).toString();
        }
        return usePriceStr;
    }

    public void setUsePriceStr(String usePriceStr) {
        this.usePriceStr = usePriceStr;
    }

    public String getPriceStr() {
        if(getPrice()!=null) {
            priceStr = new BigDecimal(getPrice()).divide(new BigDecimal(100)).toString();
        }
        return priceStr;
    }

    public void setPriceStr(String priceStr) {
        this.priceStr = priceStr;
    }

    @Override
    public Integer getSupportTransfer() {
        return supportTransfer;
    }

    @Override
    public void setSupportTransfer(Integer supportTransfer) {
        this.supportTransfer = supportTransfer;
    }

    @Override
    public Integer getPressLimitNum() {
        return pressLimitNum;
    }

    @Override
    public void setPressLimitNum(Integer pressLimitNum) {
        this.pressLimitNum = pressLimitNum;
    }
}
