package com.bohuikeji.delivery.backstage.entity;

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.TableKeyField;
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.TFranchiseeInformation;
import com.bohuikeji.frame.module.admin.entity.web.block.SelectBlock;
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;

/**
 * <p>
 * 派送员支付转帐记录表
 * </p>
 *
 * @author haoran
 * @since 2020-02-15
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@ApiModel(value="TCourierWithdraw对象", description="提现记录表")
public class TCourierWithdraw extends EntityBase<TCourierWithdraw> {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "withdraw_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(show = false)
    private Integer withdrawId;

    @ApiModelProperty(value = "结算综述")
    @TableField("withdraw_desc")
    private String withdrawDesc;

    @ApiModelProperty(value = "提现订单id集合，以逗号号分割")
    @TableField("order_ids")
    private String orderIds;

    @ApiModelProperty(value = "派送员")
    @TableField("courier_id")
    @TableKeyField(table = "t_courier",keyShowFields = {"courier_name"},keyLikeFields = {"courier_name"},where = "courier_auth='认证成功'  and fran_id in(##FRAN_IDS##)",key = TCourier.class)
    @TableShowField(value = "派送员")
    @TableQueryField(like = false)
    @TableNewField(edit = false,block = SelectBlock.class,add = false,required = false)
    private Integer courierId;

    @ApiModelProperty(value = "加盟商id")
    @TableField("fran_id")
    @TableShowField(value = "所属加盟商")
    @TableNewField(block = SelectBlock.class,edit = false)
    @TableQueryField
    @TableKeyField(table = "t_franchisee_information",keyShowFields = "fran_name", where = "fran_id in(##FRAN_IDS##)",key = TFranchiseeInformation.class)
    private Integer franId;

    @ApiModelProperty(value = "订单累计金额")
    @TableField("count_amount")
    @TableShowField("订单累计金额(￥)")
    @TableNewField(edit = false)
    private BigDecimal countAmount;

    @ApiModelProperty(value = "提现费率(%)")
    @TableField("rate")
    /*@TableShowField("费率")
    @TableNewField*/
    private BigDecimal rate=new BigDecimal(0);

    @ApiModelProperty(value = "申请提现金额")
    @TableField("apply_amount")
    @TableShowField("申请提现金额(￥)")
    @TableNewField(edit = false)
    private BigDecimal applyAmount;

    @ApiModelProperty(value = "实际到账金额")
    @TableField("reality_amount")
    @TableShowField("实际到账金额(￥)")
    @TableNewField(edit = false)
    private BigDecimal realityAmount;

    @ApiModelProperty(value = "累计超时扣款")
    @TableField("acc_over_deduction")
    @TableQueryField(like = false)
    @TableShowField(value = "累计超时扣款",show = false)
    @TableNewField()
    private BigDecimal accOverDeduction;

    @ApiModelProperty(value = "提交时间")
    @TableField("create_date")
    @TableShowField("提交时间")
    @TableQueryField(like = false,sort = 0)
    @TableNewField(edit = false)
    private LocalDateTime createDate;

    @ApiModelProperty(value = "累计超时时间（分）")
    @TableField("acc_time_out")
    @TableQueryField(like = false)
    @TableShowField(value = "累计超时时间（分）",show = false)
    @TableNewField()
    private Integer accTimeOut;


    @ApiModelProperty(value = "转账状态(已申请/已提现/提现失败)")
    @TableField("withdraw_state")
    @TableShowField("状态")
    @TableNewField(edit = false)
    private String withdrawState="审核中";

    @ApiModelProperty(value = "付款单号")
    @TableField("pay_way")
    @TableShowField(value = "付款方式")
    @TableQueryField(like = false)
    @TableNewField(edit = false)
    private String payWay;

    @ApiModelProperty(value = "微信商户订单号")
    @TableField("partner_trade_no")
    @TableShowField(value = "微信商户订单号")
    @TableQueryField(like = false)
    @TableNewField(edit = false)
    private String partnerTradeNo;

    @ApiModelProperty(value = "提交时间")
    @TableField("pay_date")
    @TableShowField(value = "付款时间",show = false)
    @TableQueryField(like = false,sort = 0)
    @TableNewField(edit = false)
    private LocalDateTime payDate;

    @ApiModelProperty(value = "付款单号")
    @TableField("pay_num")
    @TableShowField(value = "付款单号")
    @TableNewField(edit = false)
    private String payNum;

    @ApiModelProperty(value = "付款单号")
    @TableField("pay_card")
    @TableShowField("收款账户")
    @TableNewField(edit = false)
    private String payCard;

    @ApiModelProperty(value = "加盟商审核状态(待审核，已审核)")
    @TableField("fran_exam")
    @TableQueryField
    @TableShowField(value = "加盟商审核")
    @TableNewField(block = SelectBlock.class,edit = false)
    private String franExam="待审核";

    @ApiModelProperty(value = "加盟商审核人")
    @TableField("fran_audit_user")
    @TableQueryField(show = false)
    @TableShowField(value = "加盟商审核人")
    @TableNewField
    private String franAuditUser;


    @ApiModelProperty(value = "平台审核状态(待审核，已审核)")
    @TableField("platform_exam")
    @TableQueryField
    @TableShowField(value = "平台审核")
    @TableNewField(block = SelectBlock.class,edit = false)
    private String platformExam="待审核";

    @ApiModelProperty(value = "平台审核人")
    @TableField("platform_audit_user")
    @TableQueryField(show = false)
    @TableShowField(value = "平台审核人")
    @TableNewField
    private String platformAuditUser;

    @ApiModelProperty(value = "驳回说明")
    @TableField("withdraw_explain")
    @TableQueryField(show = false)
    @TableShowField(value = "驳回说明")
    @TableNewField
    private String withdrawExplain;

    @ApiModelProperty(value = "结算类型")
    @TableField("withdraw_type")
    @TableQueryField(show = false)
    @TableShowField(value = "结算类型")
    @TableNewField
    private String withdrawType;

    @ApiModelProperty(value = "结算组")
    @TableField("withdraw_group")
    @TableQueryField(show = false)
    @TableShowField(value = "结算组")
    @TableNewField
    private String withdrawGroup;

    @ApiModelProperty(value = "提现金额记录")
    @TableField("cash_amount")
    @TableQueryField(show = false)
    @TableShowField(value = "提现金额记录")
    @TableNewField
    private BigDecimal cashAmount = new BigDecimal("0.00");

    @ApiModelProperty(value = "原金额")
    @TableField("original_amount")
    @TableQueryField(show = false)
    @TableShowField(value = "原金额")
    @TableNewField
    private BigDecimal originalAmount = new BigDecimal("0.00");
}
