package com.dk.mdm.model.pojo.mac;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;

import com.dk.common.infrastructure.annotaiton.ExportTitle;
import com.dk.common.infrastructure.handler.*;
import com.dk.common.model.pojo.PageInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.alibaba.fastjson.JSONObject;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
import java.time.LocalDateTime;

/**
 *  收付款单
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ExportTitle("收付款单")
@TableName(value = "t_mac_rec_pay", autoResultMap = true, schema = "dkic_b")
@ApiModel(value="实体类：收付款单", description="表名：t_mac_rec_pay")
public class RecPay extends PageInfo<RecPay> implements Serializable {

    /*
     * 数据库字段
     */

    /**
     * 收款单ID
     */
//    @TableId(value = "rp_id", type = IdType.AUTO)
    @ApiModelProperty(value = "收款单ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String rpId;


    /**
     * 收付款单号
     */
    @Excel(name = "收付款单号")
    @ApiModelProperty(value = "收付款单号")
    private String rpNo;


    /**
     * 收付款类型 (【系统字典】收款、付款)
     */
    @Excel(name = "收付款类型 (【系统字典】收款、付款)")
    @ApiModelProperty(value = "收付款类型 (【系统字典】收款、付款)")
    private String rpType;


    /**
     * 账务对象ID (账务对象：客户、供应商)
     */
    @Excel(name = "账务对象ID (账务对象：客户、供应商)")
    @ApiModelProperty(value = "账务对象ID (账务对象：客户、供应商)")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String objectId;


    /**
     * 部门
     */
    @Excel(name = "部门")
    @ApiModelProperty(value = "部门")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String orgId;


    /**
     * 员工
     */
    @Excel(name = "员工")
    @ApiModelProperty(value = "员工")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String staffId;


    /**
     * 收款金额
     */
    @Excel(name = "收款金额")
    @ApiModelProperty(value = "收款金额")
    private BigDecimal sumAmtRec;


    /**
     * 付款金额
     */
    @Excel(name = "付款金额")
    @ApiModelProperty(value = "付款金额")
    private BigDecimal sumAmtPay;


    @Excel(name = "待核销金额")
    @ApiModelProperty(value = "待核销金额")
    private BigDecimal sumShouldHandle;


    @Excel(name = "预收抵扣")
    @ApiModelProperty(value = "预收抵扣")
    private BigDecimal sumUseReceiptResidue;


    @Excel(name = "预付抵扣")
    @ApiModelProperty(value = "预付抵扣")
    private BigDecimal sumUsePaymentResidue;


    @Excel(name = "合计应收冲抵金额")
    @ApiModelProperty(value = "合计应收冲抵金额")
    private BigDecimal sumAmtReceivableHandle;


    @Excel(name = "合计应付冲抵金额")
    @ApiModelProperty(value = "合计应付冲抵金额")
    private BigDecimal sumAmtPayableHandle;


    @Excel(name = "合计优惠金额")
    @ApiModelProperty(value = "合计核销金额")
    private BigDecimal sumWaiveAmt;


    /**
     * 收付款日期 (账务日期)
     */
    @Excel(name = "收付款日期 (账务日期)")
    @ApiModelProperty(value = "收付款日期 (账务日期)")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class)
    private LocalDate accDate;


    /**
     * 备注
     */
    @Excel(name = "备注")
    @ApiModelProperty(value = "备注")
    private String remarks;


    /**
     * 附件 (index（显示顺序）、name（文件名）、path（路径）、type（类型）、time（上传时间）...)
     */
    @Excel(name = "附件 (index（显示顺序）、name（文件名）、path（路径）、type（类型）、time（上传时间）...)")
    @ApiModelProperty(value = "附件 (index（显示顺序）、name（文件名）、path（路径）、type（类型）、time（上传时间）...)")
    @TableField(typeHandler = JsonTypeHandler.class)
    private JSONArray annexPaths;


    /**
     * 业务单据 (表名（哪个业务单据触发的收款）)
     */
    @Excel(name = "业务单据 (表名（哪个业务单据触发的收款）)")
    @ApiModelProperty(value = "业务单据 (表名（哪个业务单据触发的收款）)")
    private String biznisType;


    /**
     * 业务单ID
     */
    @Excel(name = "业务单ID")
    @ApiModelProperty(value = "业务单ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String biznisId;


    /**
     * 业务单号
     */
    @Excel(name = "业务单号")
    @ApiModelProperty(value = "业务单号")
    private String biznisNo;

    /**
     * 核销标识（是否是订单的出库的核销单）
     */
    @Excel(name = "核销标识（是否是订单的出库的核销单）")
    @ApiModelProperty(value = "核销标识（是否是订单的出库的核销单）")
    private Boolean flgOrderHandle;

    /**
     * 锁定标识
     */
    @Excel(name = "锁定标识")
    @ApiModelProperty(value = "锁定标识")
    private Boolean flgLock;


    /**
     * 制单员
     */
    @Excel(name = "制单员")
    @ApiModelProperty(value = "制单员")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String makeStaff;


    /**
     * 制单时间
     */
    @Excel(name = "制单时间")
    @ApiModelProperty(value = "制单时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class)
    private LocalDateTime makeTime;


    /**
     * 有效标识 (1：正常 0：停用)
     */
    @Excel(name = "有效标识 (1：正常 0：停用)")
    @ApiModelProperty(value = "有效标识 (1：正常 0：停用)")
    private Boolean flgValid;


    /**
     * 企业ID
     */
    @TableField(fill = FieldFill.INSERT)
    @Excel(name = "企业ID")
    @ApiModelProperty(value = "企业ID")
    private Integer cpId;


    private static final long serialVersionUID = 1L;

}
