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

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dk.common.infrastructure.annotaiton.ExportTitle;
import com.dk.common.infrastructure.handler.UuidTypeHandler;
import com.dk.common.model.pojo.PageInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

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

/**
 *  账款对象
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ExportTitle("账款对象")
@TableName(value = "t_mac_account", autoResultMap = true)
@ApiModel(value="实体类：账款对象", description="表名：t_mac_account")
public class AccountResponse extends PageInfo<AccountResponse> implements Serializable {

    /*
     * 数据库字段
     */

    /**
     * 账务对象ID
     */
//    @TableId(value = "object_id", type = IdType.AUTO)
    @ApiModelProperty(value = "账务对象ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String objectId;


    /**
     * 对象类型 (【系统字典】客户、供应商)
     */
    @Excel(name = "对象类型 (【系统字典】客户、供应商)")
    @ApiModelProperty(value = "对象类型 (【系统字典】客户、供应商)")
    private String objectType;


    /**
     * 总收款金额 (SUM(收款+退收款)（不包含锁定金额）)
     */
    @Excel(name = "总收款金额 (SUM(收款+退收款)（不包含锁定金额）)")
    @ApiModelProperty(value = "总收款金额 (SUM(收款+退收款)（不包含锁定金额）)")
    private BigDecimal receipt;


    /**
     * 总收款锁定金额 (SUM(收款+退收款)（锁定金额）)
     */
    @Excel(name = "总收款锁定金额 (SUM(收款+退收款)（锁定金额）)")
    @ApiModelProperty(value = "总收款锁定金额 (SUM(收款+退收款)（锁定金额）)")
    private BigDecimal receiptLock;


    /**
     * 销售订单未出库金额 (SUM(销售订单金额-出库金额）+SUM(销售退货-出库金额)合同资产)
     */
    @Excel(name = "销售订单未出库金额 (SUM(销售订单金额-出库金额）+SUM(销售退货-出库金额)合同资产)")
    @ApiModelProperty(value = "销售订单未出库金额 (SUM(销售订单金额-出库金额）+SUM(销售退货-出库金额)合同资产)")
    private BigDecimal contractAssets;


    /**
     * 总应收账款 (SUM(应收账款.应收账款）)
     */
    @Excel(name = "总应收账款 (SUM(应收账款.应收账款）)")
    @ApiModelProperty(value = "总应收账款 (SUM(应收账款.应收账款）)")
    private BigDecimal receivable;


    /**
     * 总应收收款金额 (SUM(应收账款.还款金额))
     */
    @Excel(name = "总应收收款金额 (SUM(应收账款.还款金额))")
    @ApiModelProperty(value = "总应收收款金额 (SUM(应收账款.还款金额))")
    private BigDecimal receivableHandle;


    /**
     * 总应收优惠金额 (SUM(应收账款.优惠金额))
     */
    @Excel(name = "总应收优惠金额 (SUM(应收账款.优惠金额))")
    @ApiModelProperty(value = "总应收优惠金额 (SUM(应收账款.优惠金额))")
    private BigDecimal receivableWaive;


    /**
     * 总剩余应收 (总应收账款-总应收收款金额-总应收优惠金额)
     */
    @Excel(name = "总剩余应收 (总应收账款-总应收收款金额-总应收优惠金额)")
    @ApiModelProperty(value = "总剩余应收 (总应收账款-总应收收款金额-总应收优惠金额)")
    private BigDecimal receivableResidue;


    /**
     * 总收款可退金额 (总收款金额-总应收收款金额+总应收优惠金额（现金池）)
     */
    @Excel(name = "总收款可退金额 (总收款金额-总应收收款金额+总应收优惠金额（现金池）)")
    @ApiModelProperty(value = "总收款可退金额 (总收款金额-总应收收款金额+总应收优惠金额（现金池）)")
    private BigDecimal receiptResidue;


    /**
     * 总付款金额 (SUM(付款+退付款))
     */
    @Excel(name = "总付款金额 (SUM(付款+退付款))")
    @ApiModelProperty(value = "总付款金额 (SUM(付款+退付款))")
    private BigDecimal payment;


    /**
     * 采购订单未入库金额 (SUM(采购订单金额-入库金额）+SUM(采购退货-入库金额)采购暂估)
     */
    @Excel(name = "采购订单未入库金额 (SUM(采购订单金额-入库金额）+SUM(采购退货-入库金额)采购暂估)")
    @ApiModelProperty(value = "采购订单未入库金额 (SUM(采购订单金额-入库金额）+SUM(采购退货-入库金额)采购暂估)")
    private BigDecimal purEstimate;


    /**
     * 总应付账款 (SUM(应付账款.应付金额))
     */
    @Excel(name = "总应付账款 (SUM(应付账款.应付金额))")
    @ApiModelProperty(value = "总应付账款 (SUM(应付账款.应付金额))")
    private BigDecimal payable;


    /**
     * 总应付付款金额 (SUM(应付账款.总应付付款金额))
     */
    @Excel(name = "总应付付款金额 (SUM(应付账款.总应付付款金额))")
    @ApiModelProperty(value = "总应付付款金额 (SUM(应付账款.总应付付款金额))")
    private BigDecimal payableHandle;


    /**
     * 总应付优惠金额 (SUM(应付账款.总应付优惠金额))
     */
    @Excel(name = "总应付优惠金额 (SUM(应付账款.总应付优惠金额))")
    @ApiModelProperty(value = "总应付优惠金额 (SUM(应付账款.总应付优惠金额))")
    private BigDecimal payableWaive;


    /**
     * 总剩余应付 (总应付账款-总应付付款金额-总应付优惠金额)
     */
    @Excel(name = "总剩余应付 (总应付账款-总应付付款金额-总应付优惠金额)")
    @ApiModelProperty(value = "总剩余应付 (总应付账款-总应付付款金额-总应付优惠金额)")
    private BigDecimal payableResidue;


    /**
     * 总付款可退金额 (总付款金额-总应付付款金额+总应付优惠金额)
     */
    @Excel(name = "总付款可退金额 (总付款金额-总应付付款金额+总应付优惠金额)")
    @ApiModelProperty(value = "总付款可退金额 (总付款金额-总应付付款金额+总应付优惠金额)")
    private BigDecimal paymentResidue;


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


    /**
     * 有效标识 (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;


    @ApiModelProperty(value = "明细")
    private List<AccountItemResponse> list;

    @ApiModelProperty(value = "客户欠款")
    private BigDecimal receivableBalance;

    @ApiModelProperty(value = "对象类型")
    private String objectTypeName;

    @ApiModelProperty(value = "供应商名称")
    private String supName;

    @ApiModelProperty(value = "客户名称")
    private String cusName;

    @ApiModelProperty(value = "客户电话")
    private String cusPhone;

    private static final long serialVersionUID = 1L;

}
