package com.dk.mdm.model.query.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.pojo.PageInfo;
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;

/**
 *  入库明细
 */
@Data
@Accessors(chain = true)
public class InboundItemQuery extends PageInfo<InboundItemQuery>  {

    /*
     * 数据库字段
     */

    /**
     * 明细ID
     */
    @ApiModelProperty(value = "明细ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String itemId;


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


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


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


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


    /**
     * 商品顺序
     */
    @ApiModelProperty(value = "商品顺序")
    private Integer itemIndex;


    /**
     * 商品ID
     */
    @ApiModelProperty(value = "商品ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String skuId;


    /**
     * 入库价
     */
    @ApiModelProperty(value = "入库价")
    private BigDecimal priceInto;


    /**
     * 非标号
     */
    @ApiModelProperty(value = "非标号")
    private String nonStdCode;


    /**
     * 入库状态 (【系统字典】)
     */
    @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 = "备注")
    private String remarks;


    /**
     * 库存ID
     */
    @ApiModelProperty(value = "库存ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String invId;


    /**
     * 成本单价
     */
    @ApiModelProperty(value = "成本单价")
    private BigDecimal costPrice;


    /**
     * 成本金额
     */
    @ApiModelProperty(value = "成本金额")
    private BigDecimal costAmt;


    /**
     * 出库数量
     */
    @ApiModelProperty(value = "出库数量")
    private BigDecimal outQty;


    /**
     * 库存数量 (库存数量=商品数量-出库数量)
     */
    @ApiModelProperty(value = "库存数量 (库存数量=商品数量-出库数量)")
    private BigDecimal invQty;


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


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


    /**
     * 创建时间 (触发器自动处理)
     */
    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class)
    private LocalDateTime opCreateTime;


    /**
     * 创建用户 (触发器自动处理)
     */
    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String opCreateUserId;


    /**
     * 修改时间 (触发器自动处理)
     */
    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class)
    private LocalDateTime opUpdateTime;


    /**
     * 修改用户 (触发器自动处理)
     */
    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String opUpdateUserId;


    /**
     * 数据操作应用 (触发器自动处理)
     */
    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
    private String opAppCode;


    /**
     * 数据时间戳 (触发器自动处理)
     */
    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class)
    private LocalDateTime opTimestamp;


    /**
     * 数据操作数据库用户 (触发器自动处理)
     */
    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
    private String opDbUser;


    @ApiModelProperty(value = "源入库单ID（采购退货时记录）")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String sIntoId;

    @ApiModelProperty(value = "源入库单明细ID（采购退货时记录）")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String sIntoItemId;

    @ApiModelProperty(value = "源采购订单ID（采购退货时记录）")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String sPurId;

    @ApiModelProperty(value = "源采购明细ID（采购退货时记录）")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String sPurItemId;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class,exist = false)
    private LocalDate intoDateStart;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class,exist = false)
    private LocalDate  intoDateEnd;

    @Excel(name = "商品名称")
    @ApiModelProperty(value = "商品名称")
    private String skuName;

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

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


    private static final long serialVersionUID = 1L;

}
