package com.iformall.domain.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.iformall.domain.po.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.text.DecimalFormat;
import java.util.Date;

@TableName(value = "wx_coupon_order")
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class WxCouponOrder extends BaseEntity {

    protected Long id;


    @io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId")
    private String tenantId;
    @io.swagger.annotations.ApiModelProperty(value = "卡券ID", name = "couponId")
    private Long couponId;
    @io.swagger.annotations.ApiModelProperty(value = "券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,100.消费卡)", name = "couponType")
    private Integer couponType;
    @io.swagger.annotations.ApiModelProperty(value = "c端用户id", name = "cUserId")
    private Long cUserId;
    @io.swagger.annotations.ApiModelProperty(value = "持有者ID", name = "ownerId")
    private Long ownerId;
    @io.swagger.annotations.ApiModelProperty(value = "操作券B端小程序用户ID", name = "bUserId")
    private Long bUserId;
    @io.swagger.annotations.ApiModelProperty(value = "用户订单ID", name = "orderId")
    private Long orderId;
    @io.swagger.annotations.ApiModelProperty(value = "该订单对应券的实际过期时间 ", name = "expiredTime")
    private Date expiredTime;
    @io.swagger.annotations.ApiModelProperty(value = "状态：0-待使用 1-已核销 2-已过期 3-已作废 4-卡使用中 5-卡已过期 6-卡已用完 7-卡已线下退款 100-预核销", name = "couponOrderStatus")
    private Integer couponOrderStatus;
    @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createDate")
    private Date createDate;
    @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateDate")
    private Date updateDate;
    @io.swagger.annotations.ApiModelProperty(value = "单券实际购买价格", name = "couponPrice")
    private Integer couponPrice;

    @io.swagger.annotations.ApiModelProperty(value="过期退款(0:正常,1不退)",name="autoRefund")
    private Integer autoRefund;

    @io.swagger.annotations.ApiModelProperty(value="核销类型(0:B端核销, 1:POS独立核销 2:POS交易核销)",name="verifyType")
    private Integer verifyType;

    @TableField(exist = false)
    private String couponName;
    @TableField(exist = false)
    private String couponPriceStr;
   
    @TableField(exist = false)
    private String salePriceStr;
    @TableField(exist = false)
    private Integer salePrice;

    @TableField(exist = false)
    private Date startTime;
    @TableField(exist = false)
    private Date endTime;

    @TableField(exist = false)
    @io.swagger.annotations.ApiModelProperty(value="时段(0,工作日白天,1,工作日晚上,2周末白天,3周末晚上)",name="timeSlot")
    private Integer timeSlot;

    @TableField(exist = false)
    private Integer businessId;

    @TableField(exist = false)
    private Integer subBusinessId;

    @TableField(exist = false)
    private String merchantName;

    public String getCouponPriceStr() {
    	if(couponPrice!=null) {
			DecimalFormat df=new DecimalFormat("0.00");
			couponPriceStr = df.format((float)couponPrice/100);
		}
		return couponPriceStr;
	}

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

    public Long getcUserId() {
        return cUserId;
    }

    public void setcUserId(Long cUserId) {
        this.cUserId = cUserId;
    }


    public Long getCUserId() {
        return cUserId;
    }

    public void setCUserId(Long cUserId) {
        this.cUserId = cUserId;
    }

}
