package com.sqx.modules.reconciliation.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 对账管理表
 * </p>
 *
 * @author ceshi
 * @since 2025-02-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="PlatformBill对象", description="对账管理表")
public class PlatformBill implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "bill_id", type = IdType.AUTO)
    private Integer billId;

    @ApiModelProperty(value = "账期")
    private String dayId;

    @ApiModelProperty(value = "关联用户id")
    private Long userId;

    @ApiModelProperty(value = "店铺名称")
    private String shopName;

    @ApiModelProperty(value = "对账类型 1商户 2骑手 0平台")
    private String type;

    @ApiModelProperty(value = "期初金额")
    private BigDecimal startMoney;

    @ApiModelProperty(value = "总收入")
    private BigDecimal revenue;

    @ApiModelProperty(value = "收入笔数")
    private Integer revenueCount;

    @ApiModelProperty(value = "商家提现金额")
    private BigDecimal shopPayouts;

    @ApiModelProperty(value = "商家提现手续费")
    private BigDecimal shopPayoutsRates;

    @ApiModelProperty(value = "商家提现笔数")
    private Integer shopPayoutsCount;

    @ApiModelProperty(value = "骑手提现")
    private BigDecimal riderPayouts;

    @ApiModelProperty(value = "骑手提现手续费")
    private BigDecimal riderPayoutsRates;

    @ApiModelProperty(value = "骑手提现笔数")
    private Integer riderPayoutsCount;

    @ApiModelProperty(value = "退款金额")
    private BigDecimal refundMoney;

    @ApiModelProperty(value = "退款笔数")
    private Integer refundCount;

    @ApiModelProperty(value = "期末金额")
    private BigDecimal endMoney;

    @ApiModelProperty(value = "平台抽成手续费")
    private BigDecimal platformRates;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date updateTime;

    @ApiModelProperty(value = "系统赠送金额")
    private BigDecimal sysGiftAmount;

    @ApiModelProperty(value = "总收益")
    private BigDecimal totalIncome;

    @ApiModelProperty(value = "用户支付金额")
    private BigDecimal payMoney;

    @ApiModelProperty(value = "商户余额")
    private BigDecimal shopBalance;

    /**
     * 临时存储
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "商家已成功提现金额")
    private BigDecimal payoutsOfSuccess;

    /**
     * 临时存储
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "已成功提现手续费")
    private BigDecimal payoutsRatesOfSuccess;

    /**
     * 临时存储
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "已成功提现次数")
    private Integer payoutsCountOfSuccess;
}
