/*
 * Copyright [2022] [https://www.xiaonuo.vip]
 *
 * Snowy采用APACHE LICENSE 2.0开源协议，您在使用过程中，需要注意以下几点：
 *
 * 1.请不要删除和修改根目录下的LICENSE文件。
 * 2.请不要删除和修改Snowy源码头部的版权声明。
 * 3.本项目代码可免费商业使用，商业使用请保留源码和相关描述文件的项目出处，作者声明等。
 * 4.分发源码时候，请注明软件出处 https://www.xiaonuo.vip
 * 5.不可二次分发开源参与同类竞品，如有想法可联系团队xiaonuobase@qq.com商议合作。
 * 6.若您的项目无法满足以上几点，需要更多功能代码，获取Snowy商业授权许可，请在官网购买授权，地址为 https://www.xiaonuo.vip
 */
package vip.xiaonuo.biz.modular.depotRepayOrder.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import vip.xiaonuo.biz.modular.depotGrain.entity.BaseDepotGrainName;

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

/**
 * 出库还款实体
 *
 * @author xiang
 * @date  2023/09/18 16:45
 **/
@Getter
@Setter
@TableName("DEPOT_REPAY_ORDER")
public class DepotRepayOrder extends BaseDepotGrainName {

    /** ID */
    @TableId
    @ApiModelProperty(value = "ID", position = 1)
    private String id;

    /** 项目编码 */
    @ApiModelProperty(value = "项目编码", position = 2)
    private String depotId;

    /** 贷款合同号 */
    @ApiModelProperty(value = "贷款合同号", position = 3)
    private String contractCode;

    /** 还款单号 */
    @ApiModelProperty(value = "还款单号", position = 3)
    private String repayOrderNo;

    /** 上次结转还款单号 */
    @ApiModelProperty(value = "上次结转还款单号", position = 3)
    private String repayBeforeOrderNo;

    /** 粮食种类 */
    @ApiModelProperty(value = "粮食种类", position = 4)
    private String grainGroup;

    /** 库位 */
    @ApiModelProperty(value = "库位", position = 8)
    private String shedName;

    /** 还款本金 */
    @ApiModelProperty(value = "还款本金", position = 5)
    private BigDecimal repayPrincipal;

    /** 利息 */
    @ApiModelProperty(value = "利息", position = 6)
    private BigDecimal repayInterest;

    /** 还款单价 */
    @ApiModelProperty(value = "还款单价", position = 7)
    private BigDecimal repayPrice;

    /** 还款金额 */
    @ApiModelProperty(value = "还款金额", position = 7)
    private BigDecimal repayAmount;

    /** 本单出库量(吨):本金/还款单价 */
    @ApiModelProperty(value = "本单出库量(吨)", position = 8)
    private BigDecimal repayTonThis;

    /** 总提货量(吨) */
    @ApiModelProperty(value = "总提货量(吨)", position = 9)
    private BigDecimal repayTonSum;

    /** 已出库重量(吨) */
    @ApiModelProperty(value = "已出库重量(吨)", position = 9)
    private BigDecimal repayTonOut;

    /** 待出库重量(吨) */
    @ApiModelProperty(value = "待出库重量(吨)", position = 9)
    private BigDecimal repayTonSurplus;

    /** 上次扭转余量(吨) */
    @ApiModelProperty(value = "上次扭转余量(吨)", position = 9)
    private BigDecimal repayBeforeTonSurplus;

    /** 车牌 */
    @ApiModelProperty(value = "车牌", position = 10)
    private String licensePlate;

    /** 候补车牌 */
    @ApiModelProperty(value = "候补车牌", position = 10)
    private String licensePlatePlug;

    /** 授权提货人 */
    @ApiModelProperty(value = "授权提货人", position = 11)
    private String keeperName;

    /** 授权提货人身份证号 */
    @ApiModelProperty(value = "授权提货人身份证号", position = 12)
    private String keeperCitizenId;

    /** 授权提货人身份证照片 */
    @ApiModelProperty(value = "授权提货人身份证照片", position = 13)
    private String keeperCitizenPic;

    /** 授权提货人联系方式 */
    @ApiModelProperty(value = "授权提货人联系方式", position = 14)
    private String keeperMobile;

    /** 还款审批状态:待审批/已确认/已上传凭证/已审批 */
    @ApiModelProperty(value = "还款审批状态:待审批/已确认/已上传凭证/已审批", position = 15)
    private String bankOpApprovalState;

    /** 审批人 */
    @ApiModelProperty(value = "审批人", position = 15)
    private String bankOpApprovalUser;

    /** 审批时间 */
    @ApiModelProperty(value = "审批时间", position = 15)
    private Date bankOpApprovalTime;

    /** 审批信息 */
    @ApiModelProperty(value = "审批信息", position = 15)
    private String bankOpApprovalMsg;

    /** 预约开启状态:预约开启/预约关闭 */
    @ApiModelProperty(value = "预约开启状态:预约开启/预约关闭", position = 16)
    private String bookFlag;

    /** 单据状态:未开始/进行中/已结束 */
    @ApiModelProperty(value = "单据状态:未开始/进行中/已结束", position = 17)
    private String repayState;

    /** 审批员 */
    @TableField(exist = false)
    private String approvalUserName;
    @TableField(exist = false)
    private String approvalUserAccount;

    public DepotRepayOrder() {
    }

    public DepotRepayOrder(String repayOrderNo) {
        this.repayOrderNo = repayOrderNo;
    }

    public DepotRepayOrder(String depotId, String grainGroup) {
        this.depotId = depotId;
        this.grainGroup = grainGroup;
    }

    public DepotRepayOrder(String id, String bookFlag, String repayState) {
        this.id = id;
        this.bookFlag = bookFlag;
        this.repayState = repayState;
    }

    public DepotRepayOrder(String id, String bankOpApprovalState, Date bankOpApprovalTime, String bookFlag) {
        this.id = id;
        this.bankOpApprovalState = bankOpApprovalState;
        this.bankOpApprovalTime = bankOpApprovalTime;
        this.bookFlag = bookFlag;
    }

}
