package com.dk.mdm.model.vo.ivt;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.dk.common.infrastructure.handler.TimestampTypeHandler;
import com.dk.common.infrastructure.handler.UuidTypeHandler;
import com.dk.common.model.vo.AnnexVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

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

/**
 *  入库单
 */
@Data
@Accessors(chain = true)
public class InboundVO {

    /*
     * 数据库字段
     */

    /**
     * 入库单ID
     */
    @ApiModelProperty(value = "入库单ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String intoId;




    /**
     * 入库单号
     */
    @ApiModelProperty(value = "入库单号")
    private String intoNo;


    /**
     * 入库类型 (【系统字典】采购入库、销退入库、其他入库)
     */
    @ApiModelProperty(value = "入库类型 (【系统字典】采购入库、销退入库、其他入库)")
    private String intoType;


    /**
     * 来源单ID (采购订单、出库退货)
     */
    @ApiModelProperty(value = "来源单ID (采购订单、出库退货)")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String fromId;


    /**
     * 来源单号
     */
    @ApiModelProperty(value = "来源单号")
    private String fromNo;


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


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


    /**
     * 客户
     */
    @ApiModelProperty(value = "客户")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String cusId;


    /**
     * 供应商
     */
    @ApiModelProperty(value = "供应商")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String supId;


    /**
     * 入库状态 (【系统字典】)
     */
    @ApiModelProperty(value = "入库状态 (【系统字典】)")
    private String intoStatus;


    /**
     * 入库中数量
     */
    @ApiModelProperty(value = "入库中数量")
    private BigDecimal intoingQty;


    /**
     * 入库中金额
     */
    @ApiModelProperty(value = "入库中金额")
    private BigDecimal intoingAmt;


    /**
     * 已入库数量
     */
    @ApiModelProperty(value = "已入库数量")
    private BigDecimal intoQty;


    /**
     * 已入库金额
     */
    @ApiModelProperty(value = "已入库金额")
    private BigDecimal intoAmt;


    /**
     * 已入库退货数量
     */
    @ApiModelProperty(value = "已入库退货数量")
    private BigDecimal returnQty;


    /**
     * 已入库退货金额
     */
    @ApiModelProperty(value = "已入库退货金额")
    private BigDecimal returnAmt;


    /**
     * 入库日期
     */
    @ApiModelProperty(value = "入库日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class)
    private LocalDate intoDate;


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


    /**
     * 附件 (index（显示顺序）、name（文件名）、path（路径）、type（类型）、time（上传时间）...)
     */
    @ApiModelProperty(value = "附件 (index（显示顺序）、name（文件名）、path（路径）、type（类型）、time（上传时间）...)")
    private List<AnnexVO> annexPaths;



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


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


    /**
     * 应收款单
     */
    @ApiModelProperty(value = "应收款单")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String receivableId;


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


    /**
     * 企业ID
     */
    @ApiModelProperty(value = "企业ID")
    private Integer cpId;


    @TableField(typeHandler = UuidTypeHandler.class)
    @ApiModelProperty(value = "入库仓库")
    private String whId;


    @ApiModelProperty(value = "入库原因")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String intoReason;


    @ApiModelProperty(value = "自动办理标识")
    private Boolean flgAutoHandle;

    @ApiModelProperty(value = "自动办理参数")
    private Boolean flgHandleSetting;


    @ApiModelProperty(value = "无货出库自动入库标识")
    private Boolean flgNegInto;

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

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


    /**
     * 自动入库标识
     */
    @ApiModelProperty(value = "自动入库标识")
    private Boolean automaticFlg;

    @ApiModelProperty(value = "明细")
    private List<InboundItemVO> itemList;


    @ApiModelProperty(value = "删除明细")
    private List<InboundItemVO> deleteItemList;


    @ApiModelProperty(value = "编辑标识")
    private Boolean limitEdit;

    private static final long serialVersionUID = 1L;

}
