package com.iformall.domain.vo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.iformall.domain.po.WxCouponOrder;

import javax.persistence.Id;
import javax.persistence.Transient;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.List;
@JsonIgnoreProperties(value = {"handler"})
public class WxCouponOrderBVo extends WxCouponOrder{

	private static final long serialVersionUID = 6687954932922444531L;
	@Id
	@Excel(name="券码",width = 20)
	protected Long id;

	public Long getId() {
		return id;
	}

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


	/* 基础购买到的券信息 */
	/***/
	@io.swagger.annotations.ApiModelProperty(value = "", name = "tenantId")
	private String tenantId;
	/*用户订单ID**/
	@Excel(name="订单号",width = 20)
	@io.swagger.annotations.ApiModelProperty(value = "用户订单ID", name = "orderId")
	private Long orderId;
	/*该订单对应券的实际过期时间**/
	@io.swagger.annotations.ApiModelProperty(value = "该订单对应券的实际过期时间 ", name = "expiredTime")
	private Date expiredTime;



	/*券名称**/
	@Excel(name="券名称",width = 50)
	@io.swagger.annotations.ApiModelProperty(value="券名称",name="title")
	private String title;

	/**c用户绑定的手机号**/
	@Excel(name="用户手机号",width = 20)
	@io.swagger.annotations.ApiModelProperty(value="用户绑定的手机号",name="cUserPhone")
	private String cUserPhone;

	/***/
	@Excel(name="交易时间",width = 20,exportFormat="yyyy-MM-dd HH:mm:ss")
	@io.swagger.annotations.ApiModelProperty(value = "", name = "createDate")
	private Date createDate;

	@Transient
	@Excel(name="面额",width = 20)
	private String priceStr;

	@Transient
	@Excel(name="交易价格",width = 20)
	private String salePriceStr;

	/***/
	/*状态：0，待使用 1，已核销 2，已过期 3，已作废 **/
	@Excel(name="订单状态",width = 20,replace = { "可以退款_0", "已经使用_1","已经过期_2","已经退款_3"})
	@io.swagger.annotations.ApiModelProperty(value = "状态：0，待使用 1，已核销 2，已过期 3，已作废 ", name = "couponOrderStatus")
	private Integer couponOrderStatus;

	/***/
	@Excel(name="核销/过期/退款时间",width = 20,exportFormat="yyyy-MM-dd HH:mm:ss")
	@io.swagger.annotations.ApiModelProperty(value = "", name = "updateDate")
	private Date updateDate;
	/*单券实际购买价格**/
	@io.swagger.annotations.ApiModelProperty(value = "单券实际购买价格", name = "couponPrice")
	private Integer couponPrice;


	/*券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)**/
	@io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)",name="type")
	private Integer type;

	/*售价（适用于类型2，3，4，5）**/
	@io.swagger.annotations.ApiModelProperty(value="售价（适用于类型2，3，4，5）",name="salePrice")
	private Integer salePrice;
	/*使用条件金额（适用于类型1,2,3,4）**/
	@io.swagger.annotations.ApiModelProperty(value="使用条件金额（适用于类型1,2,3,4）",name="usePrice")
	private Integer usePrice;
	/*面额**/
	@io.swagger.annotations.ApiModelProperty(value="面额",name="price")
	private Integer price;


	/**b端用户姓名**/
	@Excel(name="商户管理员(核销人)姓名",width = 50)
	@io.swagger.annotations.ApiModelProperty(value="b端用户姓名",name="bUserName")
	private String bUserName;
	/**b端用户手机号**/
	@Excel(name="商户管理员手机",width = 20)
	@io.swagger.annotations.ApiModelProperty(value="b端用户手机号",name="bUserPhone")
	private String bUserPhone;
	/**使用券商户名**/
	@Excel(name="使用券商户名",width = 50)
	@io.swagger.annotations.ApiModelProperty(value="使用券商户名",name="merchantName")
	private String merchantName;


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

	@Transient
	private Date startDate;

	@Transient
	private Date endDate;

	@Transient
	private Long couponId;
	@Transient
	private Integer couponType;


	@Override
	public Long getCouponId() {
		return couponId;
	}

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

	@Override
	public Integer getCouponType() {
		return couponType;
	}

	@Override
	public void setCouponType(Integer couponType) {
		this.couponType = couponType;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}


	public String getTenantId() {
		return tenantId;
	}
	public void setTenantId(String _tenantId) {
		tenantId = _tenantId;
	}
    public Long getOrderId() {
		return orderId;
	}
	public void setOrderId(Long _orderId) {
		orderId = _orderId;
	}
	public Date getExpiredTime() {
		return expiredTime;
	}
	public void setExpiredTime(Date _expiredTime) {
		expiredTime = _expiredTime;
	}
	public Integer getCouponOrderStatus() {
		return couponOrderStatus;
	}
	public void setCouponOrderStatus(Integer _couponOrderStatus) {
		couponOrderStatus = _couponOrderStatus;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date _createDate) {
		createDate = _createDate;
	}
	public Date getUpdateDate() {
		return updateDate;
	}
	public void setUpdateDate(Date _updateDate) {
		updateDate = _updateDate;
	}
	public Integer getCouponPrice() {
		return couponPrice;
	}
	public void setCouponPrice(Integer _couponPrice) {
		couponPrice = _couponPrice;
	}


	public Integer  getType() {
		return type;
	}
	public void setType(Integer _type) {
		type = _type;
	}
	public String  getTitle() {
		return title;
	}
	public void setTitle(String _title) {
		title = _title;
	}
	public Integer  getSalePrice() {
		return salePrice;
	}
	public void setSalePrice(Integer _salePrice) {
		salePrice = _salePrice;
	}
	public Integer  getUsePrice() {
		return usePrice;
	}
	public void setUsePrice(Integer _usePrice) {
		usePrice = _usePrice;
	}
	public Integer  getPrice() {
		return price;
	}
	public void setPrice(Integer _price) {
		price = _price;
	}

	public String getMerchantName() {
		return merchantName;
	}

	public void setMerchantName(String merchantName) {
		this.merchantName = merchantName;
	}

	public String getbUserName() {
		return bUserName;
	}

	public void setbUserName(String bUserName) {
		this.bUserName = bUserName;
	}

	public String getbUserPhone() {
		return bUserPhone;
	}

	public void setbUserPhone(String bUserPhone) {
		this.bUserPhone = bUserPhone;
	}

	public String getcUserPhone() {
		return cUserPhone;
	}

	public void setcUserPhone(String cUserPhone) {
		this.cUserPhone = cUserPhone;
	}

	public String getSalePriceStr() {
		if(salePrice!=null) {
			DecimalFormat df=new DecimalFormat("0.00");
			salePriceStr = df.format((float)salePrice/100);
		}
		return salePriceStr;
	}

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

	public String getPriceStr() {
		if(price!=null) {
			DecimalFormat df=new DecimalFormat("0.00");
			priceStr = df.format((float)price/100);
		}
		return priceStr;
	}

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


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

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

}
