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

import cn.afterturn.easypoi.excel.annotation.Excel;
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 java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 *  账务明细
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ExportTitle("账务明细")
@TableName(value = "t_mac_account_item", autoResultMap = true, schema = "dkic_b")
@ApiModel(value="实体类：账务明细", description="表名：t_mac_account_item")
public class AccountItem extends PageInfo<AccountItem> implements Serializable {

    /*
     * 数据库字段
     */

    /**
     * 账务明细ID
     */
    @TableId(value = "item_id", type = IdType.AUTO)
    @ApiModelProperty(value = "账务明细ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String itemId;


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


    /**
     * 账务对象 (客户、供应商)
     */
    @Excel(name = "账务对象 (客户、供应商)")
    @ApiModelProperty(value = "账务对象 (客户、供应商)")
    @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 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 = "账务日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class)
    private LocalDate accDate;


    /**
     * 账务状态 (【系统字典】确定、部分、完成)
     */
    @Excel(name = "账务状态 (【系统字典】确定、部分、完成)")
    @ApiModelProperty(value = "账务状态 (【系统字典】确定、部分、完成)")
    private String recStatus;

    /**
     * 收款金额
     */
    @Excel(name = "收款金额（对客户（收款为正数、退收款为负数））")
    @ApiModelProperty(value = "收款金额（对客户（收款为正数、退收款为负数））")
    private BigDecimal amtRec;


    /**
     * 付款金额
     */
    @Excel(name = "付款金额（对供应商（付款为正数、退付款为负数））")
    @ApiModelProperty(value = "付款金额（对供应商（付款为正数、退付款为负数））")
    private BigDecimal amtPay;

    /**
     * 应收/应付金额
     */
    @Excel(name = "应收/应付金额")
    @ApiModelProperty(value = "应收/应付金额")
    private BigDecimal amtShould;


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


    /**
     * 优惠金额
     */
    @Excel(name = "优惠金额")
    @ApiModelProperty(value = "优惠金额")
    private BigDecimal amtWaive;


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


    /**
     * 锁定标识 (开单收款，自动锁定)
     */
    @Excel(name = "锁定标识 (开单收款，自动锁定)")
    @ApiModelProperty(value = "锁定标识 (开单收款，自动锁定)")
    private Boolean flgLock;


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


    /**
     * 制单员
     */
    @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;


    /*
     * 相关属性
     * @TableField(exist = false)
     */

    /*
     * 关联属性 + 查询条件
     * @TableField(exist = false)
     */


    private static final long serialVersionUID = 1L;

}
