package com.bohuikeji.delivery.backstage.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
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.serializer.Decimal2Serializer;
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.LocalDateTime;

/**
 * 微信余额充值提现
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="t_extract_record对象", description="微信余额充值提现")
public class TExtractRecord extends EntityBase<TExtractRecord> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "提现id")
    @TableId(value = "extract_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(show = false)
    private Integer extractId;

    @ApiModelProperty(value = "商家提现单号")
    @TableField("extract_num")
    @TableShowField("商家提现单号")
    @TableNewField(edit = false)
    @TableQueryField(show = false)
    private String extractNum;

    @ApiModelProperty(value = "提现人姓名")
    @TableField("extract_name")
    @TableShowField("提现人姓名")
    @TableNewField(edit = false)
    @TableQueryField(show = false)
    private String extractName;

    @ApiModelProperty(value = "提现金额")
    @TableField("extract_amount")
    @TableShowField(value = "提现金额")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    @JSONField(serializeUsing = Decimal2Serializer.class)
    private BigDecimal extractAmount=new BigDecimal("0.00").setScale(2, BigDecimal.ROUND_DOWN);


    @ApiModelProperty(value = "提现时间")
    @TableField("extract_time")
    @TableShowField("提现时间")
    @TableNewField(edit = false)
    @TableQueryField(sort = 0,like = false)
    private LocalDateTime extractTime=LocalDateTime.now();

    @ApiModelProperty(value = "说明")
    @TableField("extract_dec")
    @TableShowField("说明")
    @TableNewField(edit = false)
    @TableQueryField(show = false)
    private String extractDec;

    @ApiModelProperty(value = "提现状态")
    @TableField("extract_status")
    @TableShowField("提现状态")
    @TableNewField(edit = false)
    @TableQueryField(show = false)
    private String extractStatus="已提现";
}
