package com.bohuikeji.delivery.backstage.entity.discount;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bohuikeji.frame.module.admin.annotation.TableNewField;
import com.bohuikeji.frame.module.admin.annotation.TableQueryField;
import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import com.bohuikeji.frame.module.admin.entity.web.block.FileBlock;
import com.bohuikeji.frame.module.admin.entity.web.block.TextBlock;
import com.bohuikeji.frame.module.admin.enums.ColumnTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**

/**
 * <p>
 * 创建代金券批次
 * </p>
 *
 * @author zhouliwu
 * @since 2021-03-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="TDiscountMall对象", description="创建代金券批次")
@TableName("t_discount_mall")
public class TDiscountMall extends EntityBase<TDiscountMall> {

    private static final long serialVersionUID = 1L;

    /**
     * 优惠卷id
     */
    @ApiModelProperty(value="优惠券id")
    @TableShowField(value = "ID",id = true)
    @TableId(value = "dis_id", type = IdType.AUTO)
    @TableNewField(show = false,required = false)
    private Integer disId;

    /**
     * 优惠券名称
     */
    @ApiModelProperty(value = "优惠券名称")
    @TableQueryField(show = false)
    @TableShowField(value = "优惠券名称")
    @TableNewField
    @TableField("dis_name")
    private String disName;

    /**
     * 优惠批次号
     */
    /*@ApiModelProperty(value = "优惠批次号")
    @TableQueryField(show = false)
    @TableShowField(value = "优惠批次号")
    @TableNewField(required = false,edit = false,add = false,show = false)
    @TableField("coupon_stock")
    private String couponStock=NumberUtils.get("YH");*/


    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @TableQueryField(like = false)
    @TableShowField(value = "创建时间",show = false)
    @TableNewField(required = false,edit = false,add = false)
    @TableField("create_time")
    private LocalDateTime createTime=LocalDateTime.now();


    /**
     * 优惠券类型
     */
    @ApiModelProperty(value = "优惠类型(立减卷、满减卷、折扣卷、会员卡")
    @TableQueryField()
    @TableShowField(value = "优惠券类型")
    @TableNewField(options = {"立减卷","满减卷","折扣卷","会员卡"},edit = false)
    @TableField("dis_type")
    private String disType;

    /**
     * 发放类型
     */
    @ApiModelProperty(value = "发放类型（新客户、老客户）")
    @TableQueryField()
    @TableShowField(value = "发放类型")
    @TableNewField(options = {"全部","新客户","老客户"},edit = false)
    @TableField("grant_type")
    private String grantType;

    /**
     * 发放类型
     */
    @ApiModelProperty(value = "消费类型（同城急送、全国快递、同城快递、跨城直送，全部）")
    @TableQueryField()
    @TableShowField(value = "消费类型")
    @TableNewField(options = {"会员","急送","快递","跨城","拉货"},edit = false)
    @TableField("cons_type")
    private String consType;

    /**
     * 发放方式
     */
    @ApiModelProperty(value = "领取方式（充值发放、免费赠送、后台方法）")
    @TableQueryField()
    @TableShowField(value = "发放方式")
    @TableNewField(options = {"充值发放","免费赠送","后台发放"})
    @TableField("receive_method")
    private String receiveMethod;


    /**
     * 优惠图片
     */
    @ApiModelProperty(value = "优惠图片")
    @TableQueryField(show = false)
    @TableShowField(value = "优惠图片",type = ColumnTypeEnum.IMAGE)
    @TableNewField(block = FileBlock.class,required = false,add = false,edit = false,show = false)
    @TableField("url_picture")
    private String urlPicture;

    /**
     * 弹框图片
     */
    @ApiModelProperty(value = "弹框模板")
    @TableQueryField(show = false)
    @TableShowField(value = "弹框模板",type = ColumnTypeEnum.IMAGE)
    @TableNewField(block = FileBlock.class,required = false,add = false,edit = false,show = false)
    @TableField("frame_url")
    private String frameUrl;


    /**
     * 可用开始时间
     */
    @ApiModelProperty(value = "可用开始时间")
    @TableQueryField(show = true)
    @TableShowField(value = "可用开始时间")
    @TableNewField(required = false)
    @TableField("begin_date")
    private LocalDate beginDate;
    /**
     * 可用结束时间
     */
    @ApiModelProperty(value = "可用结束时间")
    @TableQueryField(show = true)
    @TableShowField(value = "可用结束时间")
    @TableNewField(required = false)
    @TableField("end_date")
    private LocalDate endDate;

    /**
     * 起始金额
     */
    @ApiModelProperty(value = "使用起始金额")
    @TableQueryField(show = false)
    @TableShowField(value = "使用起始金额")
    @TableNewField(required = false)
    @TableField("start_amount")
    private BigDecimal startAmount=new BigDecimal("0.00").setScale(2, BigDecimal.ROUND_DOWN);

    /**
     * 优惠面额
     */
    @ApiModelProperty(value = "优惠面额")
    @TableQueryField(show = false)
    @TableShowField(value = "优惠面额")
    @TableNewField(required = false)
    @TableField("dis_value")
    private BigDecimal disValue=new BigDecimal("0.00").setScale(2, BigDecimal.ROUND_DOWN);

    /**
     * 购买价格
     */
    @ApiModelProperty(value = "购买价格")
    @TableQueryField(show = false)
    @TableShowField(value = "购买价格（元）")
    @TableNewField()
    @TableField("dis_price")
    private BigDecimal disPrice=new BigDecimal("0.00").setScale(2, BigDecimal.ROUND_DOWN);


    /**
     * 领取张数
     */
    @ApiModelProperty(value = "领取数量")
    @TableQueryField(show = false)
    @TableShowField(value = "领取数量")
    @TableNewField(required = false,add = false,edit = false,show = false)
    @TableField("receive_num")
    private Integer receiveNum=0;


    /**
     * 操作状态（发放中、已暂停、已结束）
     */
    @ApiModelProperty(value = "操作状态")
    @TableQueryField()
    @TableShowField(value = "操作状态")
    @TableField("dis_state")
    @TableNewField(options = {"发放中","已暂停","已结束"},required = false,add = false,show = false)
    private String disState="待发放";


    /**
     * 显示方式（正常、弹框）
     */
    @ApiModelProperty(value = "显示方式（正常、弹框）")
    @TableQueryField()
    @TableShowField(value = "显示方式（正常、弹框）")
    @TableField("dis_mode")
    @TableNewField(options = {"正常","弹框"},required = false,show = false)
    private String disMode;

    /**
     * 优惠标志
     */
    @ApiModelProperty(value = "优惠标识")
    @TableQueryField()
    @TableShowField(value = "优惠标识")
    @TableField("dis_sign")
    @TableNewField(options = {"无标识","弹框","立减弹框","满减弹框","折扣弹框","万能弹框"})
    private String disSign;

    /**
     * 备注说明
     */
    @ApiModelProperty(value = "备注说明")
    @TableQueryField(show = false)
    @TableShowField(value = "备注说明")
    @TableNewField(block = TextBlock.class,required = false)
    @TableField("dis_remark")
    private String disRemark;

    /**
     * 使用说明
     */
    @ApiModelProperty(value = "使用说明")
    @TableQueryField(show = false)
    @TableShowField(value = "使用说明",show = false)
    @TableNewField(block = TextBlock.class,required = false)
    @TableField("use_explain")
    private String useExplain;

    /**
     * g购买优惠请求标识
     */
    @ApiModelProperty(value = "请求标识")
    @TableField(exist = false) //不为数据库字段
    private String type;

    /**
     * url优惠图标临时路径路径
     */
    /*@ApiModelProperty(value="url路径",name="url")
    @TableField(exist = false)
    private String urlone;*/

}
