package com.muchinfo.mtp3pojos.entity;

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.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

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

/**
 * <p>
 * 履约计划表 （履约完成导历史)
 * </p>
 *
 * @author XKF
 * @since 2024-11-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("PERFORMANCEPLAN")
@ApiModel(value="Performanceplan对象", description="履约计划表 （履约完成导历史)")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Performanceplan extends Model<Performanceplan> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "履约计划ID(130+yyMMddHHmmss+xxxx)")
    private Long performanceplanid;

    @ApiModelProperty(value = "履约类型 - 0:通用 1:交割 2:仓单贸易 3:预售集采 4:竞拍-降价式 (无仓单) 5:挂牌期权 6:竞拍-降价式 7:竞拍-竞价式 8:竞拍-大宗式 9:荷兰式 10:法币C2C 11:报价系统 12:挂牌系统")
    @TableField("PERFORMANCETYPE")
    private Integer performancetype;

    @ApiModelProperty(value = "关联单号(履约类型的关联单号)")
    @TableField("RELATEDORDERID")
    private Long relatedorderid;

    @ApiModelProperty(value = "履约金额")
    @TableField("AMOUNT")
    private BigDecimal amount;

    @ApiModelProperty(value = "买方支付方式 - 1:冻结 2:扣款(不支持,对接银行会导致当日进出资金不平)")
    @TableField("PAYMENTTYPE")
    private Integer paymenttype;

    @ApiModelProperty(value = "履约状态 -  1:待激活 2:正常 3:处理错误 4:违约待处理 5:违约处理中 6:完成 7.违约已完成 8:释放冻结失败 9:超时待处理 10:超时关闭")
    @TableField("PERFORMANCESTATUS")
    private Integer performancestatus;

    @ApiModelProperty(value = "当前步骤ID")
    @TableField("CURSTEPID")
    private Long curstepid;

    @ApiModelProperty(value = "买方账号")
    @TableField("BUYACCOUNTID")
    private Long buyaccountid;

    @ApiModelProperty(value = "仓单受让用户")
    @TableField("WRTRANSFERUSERID")
    private Long wrtransferuserid;

    @ApiModelProperty(value = "买方已冻/已扣金额")
    @TableField("BUYPAIDAMOUNT")
    private BigDecimal buypaidamount;

    @ApiModelProperty(value = "卖方账号")
    @TableField("SELLACCOUNTID")
    private Long sellaccountid;

    @ApiModelProperty(value = "卖方已收金额")
    @TableField("SELLRECEIVEDAMOUNT")
    private BigDecimal sellreceivedamount;

    @ApiModelProperty(value = "买方今日扣/冻金额 (待开市时清零)")
    @TableField("BUYTODAYAMOUNT")
    private BigDecimal buytodayamount;

    @ApiModelProperty(value = "卖方今日收取金额(待开市时清零)")
    @TableField("SELLTODAYAMOUNT")
    private BigDecimal selltodayamount;

    @ApiModelProperty(value = "创建时间")
    @TableField("CREATETIME")
    private Date createtime;

    @ApiModelProperty(value = "创建人")
    @TableField("CREATORID")
    private Long creatorid;

    @ApiModelProperty(value = "备注")
    @TableField("REMARK")
    private String remark;

    @ApiModelProperty(value = "买方履约前冻结资金")
    @TableField("BUYERFREEZEAMOUNT")
    private BigDecimal buyerfreezeamount;

    @ApiModelProperty(value = "买方履约前冻结资金剩余")
    @TableField("BUYERFREEZEAMOUNTREMAIN")
    private BigDecimal buyerfreezeamountremain;

    @ApiModelProperty(value = "卖方履约前冻结资金")
    @TableField("SELLERFREEZEAMOUNT")
    private BigDecimal sellerfreezeamount;

    @ApiModelProperty(value = "卖方履约前冻结资金剩余")
    @TableField("SELLERFREEZEAMOUNTREMAIN")
    private BigDecimal sellerfreezeamountremain;

    @ApiModelProperty(value = "溢短金额")
    @TableField("OVERSHORTAMOUNT")
    private BigDecimal overshortamount;

    @ApiModelProperty(value = "是否确认溢短 - 0:没有 1:买方确认 2:卖方确认")
    @TableField("HASOVERSHORT")
    private Integer hasovershort;

    @ApiModelProperty(value = "发货备注[物流单号]")
    @TableField("SHIPREMARK")
    private String shipremark;

    @ApiModelProperty(value = "中间商用户ID")
    @TableField("MIDDLEUSERID")
    private Long middleuserid;

    @ApiModelProperty(value = "中间商资金账号ID")
    @TableField("MIDDLEACCOUNTID")
    private Long middleaccountid;

    @ApiModelProperty(value = "是否有仓单 - 0:无仓单 1:有仓单")
    @TableField("HASWR")
    private Integer haswr;

    @ApiModelProperty(value = "买方联系信息 - 存JSON字符串, 根据枚举‘BuyerContactInfo'，显示隐藏字段，若数据不为JSON，则直接显示 { 'ContactInfo': 'xxxxxxxx', 'ReceiveInfo': 'xxxxxxxxx', 'ReceiptInfo': 'xxxxxxxxxxxx'}")
    @TableField("BUYERINFO")
    private String buyerinfo;

    @ApiModelProperty(value = "卖方联系信息 - 存JSON字符串, 根据枚举‘SellerContactInfo'，显示隐藏字段，若数据不为JSON，则直接显示 { 'ContactInfo': 'xxxxxxxx' }")
    @TableField("SELLERINFO")
    private String sellerinfo;

    @ApiModelProperty(value = "溢短数量")
    @TableField("OVERSHORTQTY")
    private Integer overshortqty;

    @ApiModelProperty(value = "市场ID")
    @TableField("MARKETID")
    private Long marketid;

    @ApiModelProperty(value = "是否确认运费 - 0:无 1:买方确认 2:卖方确认")
    @TableField("EXPRESSFEECONFIRMED")
    private Integer expressfeeconfirmed;

    @ApiModelProperty(value = "运费")
    @TableField("EXPRESSFEE")
    private BigDecimal expressfee;

    @ApiModelProperty(value = "合同ID")
    @TableField("CONTRACTID")
    private Long contractid;

    @ApiModelProperty(value = "当前步骤到期时间")
    @TableField("CURSTEPDEADLINE")
    private Date curstepdeadline;

    @ApiModelProperty(value = "履约数量")
    @TableField("QTY")
    private Integer qty;

    @ApiModelProperty(value = "履约激活方式 - 1:自动激活 2:到月可激活(手动)")
    @TableField("ACTIVATEMODE")
    private String activatemode;

    @ApiModelProperty(value = "履约激活月 [无仓单的交易收月](yyyy-MM)")
    @TableField("ACTIVATEMONTH")
    private String activatemonth;


    @Override
    public Serializable pkVal() {
        return this.performanceplanid;
    }

}
