package cn.ezhizao.project.business.payment.domain;

import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
import cn.ezhizao.framework.web.domain.BaseEntity;
import cn.ezhizao.project.system.domain.SysFileStorage;
import com.baomidou.mybatisplus.annotation.TableField;
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.math.BigDecimal;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.List;

/**
 * @author 周晓
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel("payment 支出")
public class BizPayment extends BaseEntity {
    @ApiModelProperty(value = "支出流水号")
    private String flowNo;

    @ApiModelProperty(value = "服务公司id")
    private Long subsidiaryId;

    @ApiModelProperty(value = "服务公司")
    private String subsidiary;

    @ApiModelProperty(value = "服务公司账户")
    private String subsidiaryName;

    @ApiModelProperty(value = "服务公司账号")
    private String subsidiaryBankAccount;

    @ApiModelProperty(value = "服务公司开户行")
    private String subsidiaryBankName;

    @ApiModelProperty(value = "客户 Id")
    private Long companyId;

    @ApiModelProperty(value = "付款金额")
    private BigDecimal amount;

    @ApiModelProperty(value = "支出事由外键")
    private Long paymentCauseId;

    @TableField(exist = false)
    private String paymentCause;

    @ApiModelProperty(value = "支出科目")
    private Long paymentSubjectId;

    @ApiModelProperty(value = "支出状态 0-未支出 1-已支出")
    private Byte paymentStatus;

    @ApiModelProperty(value = "审核状态 0-待审核 1-审核通过 2-审核驳回 3-待提交")
    private Byte verifyStatus;

    @ApiModelProperty(value = "账户类型")
    private Long acceptAccountTypeId;

    @TableField(exist = false)
    private String acceptAccountType;

    @ApiModelProperty(value = "申请人")
    private Long applierId;

    @ApiModelProperty(value = "开户行")
    private String accountBank;

    @ApiModelProperty(value = "从表payment_contract")
    @TableField(exist = false)
    private List<BizPaymentDetail> details;

    @TableField(exist = false)
    private List<SysFileStorage> files;
    @TableField(exist = false)
    private String applierDept;

    @ApiModelProperty("确认时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp actuallyDate;

    @ApiModelProperty("等待审核")
    @TableField(exist = false)
    private String waitForVerify;

    @ApiModelProperty("总价")
    @TableField(exist = false)
    private BigDecimal allAmount;

    @ApiModelProperty("审核日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    @TableField(exist = false)
    private Timestamp verifyDate;
    @TableField(exist = false)
    private List<String> dateFilter;
    @ApiModelProperty("审核意见")
    private String verifyComment;

    @ApiModelProperty("服务公司")
    private String serviceCompanyName;

    @ApiModelProperty("账套外键")
    private Long tenantId;
    @ApiModelProperty("合同外键")
    private Long contractId;

    @ApiModelProperty("合同单号")
    @TableField(exist = false)
    private String contractNo;
    @TableField(exist = false)
    private BigDecimal contractAmount;
    @TableField(exist = false)
    private boolean nonpayment;
    @TableField(exist = false)
    private Date startDate;
    @TableField(exist = false)
    private Date endDate;
    @TableField(exist = false)
    private Timestamp verifyStartDate;
    @TableField(exist = false)
    private Timestamp verifyEndDate;
    @TableField(exist = false)
    private String keyword;
    @TableField(exist = false)
    private BigDecimal payedAmount;

    /** 导出数据 */

    @Excel(name="客户名称",width = 35)
    @ApiModelProperty(value = "客户 名称")
    private String companyName;

    @Excel(name="订单号",width = 20)
    @TableField(exist = false)
    private String formNo;

    @Excel(name="支出日期",width = 20,dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "支出日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Timestamp formDate;

    @Excel(name="支出科目")
    @TableField(exist = false)
    private String paymentSubject;

    @Excel(name="支出金额")
    @TableField(exist = false)
    private BigDecimal sumAmount;

    @Excel(name="审核状态")
    @TableField(exist = false)
    private String verifyStatusStr;

    @Excel(name="支付状态")
    @TableField(exist = false)
    private String paymentStatusStr;

    @Excel(name="收款账户名")
    @ApiModelProperty(value = "收款账号")
    private String acceptAccount;

    @Excel(name="收款账号")
    @ApiModelProperty(value = "收款账号")
    private String acceptAccountNo;

    @Excel(name="申请人")
    @TableField(exist = false)
    private String applierName;

    @ApiModelProperty(value = "收款账户开户银行")
    private String bankNo;

    @TableField(exist = false)
    private List<SysFileStorage> evidenceFiles;
    @TableField(exist = false)
    private String boss;
    @TableField(exist = false)
    private String party;
}
