package com.ruoyi.invest.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotNull;
import java.util.Date;
/**
 * 网贷及分期历史对象 installment_history
 *
 * @author tianyongbao
 * @date 2024-03-20
 */
@ApiModel("网贷及分期历史对象")
@Data
public class InstallmentHistory extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private Long id;

    /** 借款名称 */
    private String name;

    /** 类型，2信用卡,3网贷 */
    private String type;

    /** 银行卡号 */
    private String code;

    /** 信用卡网贷 */
    @ApiModelProperty(value="信用卡网贷)")
    @NotNull(message="信用卡网贷不能为空")
    @Excel(name = "信用卡网贷")
    private Long bankCardLendId;

    /** 分期金额 */
    @ApiModelProperty(value="分期金额)")
    @NotNull(message="分期金额不能为空")
    @Excel(name = "分期金额")
    private Double installmentAmount;

    /** 分期日期 */
    @ApiModelProperty(value="分期日期)")
    @NotNull(message="分期日期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "分期日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date installmentDate;

    /** 期数 */
    @ApiModelProperty(value="期数)")
    @NotNull(message="期数不能为空")
    @Excel(name = "期数")
    private Integer period;

    /** 已还期数 */
    @ApiModelProperty(value="已还期数")
    @Excel(name = "已还期数")
    private Integer repaidPeriod;

    /** 总利息 */
    @ApiModelProperty(value="总利息)")
    @NotNull(message="总利息不能为空")
    @Excel(name = "总利息")
    private Double totalInterest;

    /** 余额 */
    @ApiModelProperty(value="余额)")
    @NotNull(message="余额")
    @Excel(name = "余额")
    private Double balance;

    /** 利率 */
    @ApiModelProperty(value="利率")
    @Excel(name = "利率")
    private String interestRate;

    /** 到期日期 */
    @ApiModelProperty(value="到期日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "到期日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date dueDate;

    /** 关闭日期 */
    @ApiModelProperty(value="关闭日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "关闭日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date closeDate;

    /** 账户状态，1已结清，0未结清 */
    @ApiModelProperty(value="账户状态，1已结清，0未结清)")
    @NotNull(message="账户状态，1已结清，0未结清不能为空")
    @Excel(name = "账户状态，1已结清，0未结清")
    private String state;

    /** 删除标志（0代表存在 1代表删除） */
    private String delFlag;

    /** 计算利率 */
    @ApiModelProperty(value="计算利率")
    @Excel(name = "计算利率")
    private String calculateInterestRate;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("name", getName())
            .append("type", getType())
            .append("code", getCode())
            .append("bankCardLendId", getBankCardLendId())
            .append("installmentAmount", getInstallmentAmount())
            .append("installmentDate", getInstallmentDate())
            .append("period", getPeriod())
            .append("repaidPeriod", getRepaidPeriod())
            .append("totalInterest", getTotalInterest())
            .append("interestRate", getInterestRate())
            .append("dueDate", getDueDate())
            .append("closeDate", getCloseDate())
            .append("state", getState())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("delFlag", getDelFlag())
            .append("remark", getRemark())
                .append("balance", getBalance())
                .append("calculateInterestRate", getCalculateInterestRate())
            .toString();
    }
}
