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

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.*;
import com.dk.common.infrastructure.annotaiton.ExportTitle;
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.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.time.LocalDate;
import java.time.LocalDateTime;

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

    /*
     * 数据库字段
     */

    /**
     * 存货批次明细ID
     */
    @TableId(value = "batch_id", type = IdType.AUTO)
    @ApiModelProperty(value = "存货批次明细ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String batchId;


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


    /**
     * 来源单ID (入库单、出库单、调库单)
     */
    @Excel(name = "来源单ID (入库单、出库单、调库单)")
    @ApiModelProperty(value = "来源单ID (入库单、出库单、调库单)")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String fromId;


    /**
     * 来源单明细ID (入库明细、出库明细、调库单明细)
     */
    @Excel(name = "来源单明细ID (入库明细、出库明细、调库单明细)")
    @ApiModelProperty(value = "来源单明细ID (入库明细、出库明细、调库单明细)")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String fromItemId;


    /**
     * 仓库ID
     */
    @Excel(name = "仓库ID")
    @ApiModelProperty(value = "仓库ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String whId;


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


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


    /**
     * 库存数量
     */
    @Excel(name = "库存数量")
    @ApiModelProperty(value = "库存数量")
    private BigDecimal invQty;


    /**
     * 存货单价
     */
    @Excel(name = "存货单价")
    @ApiModelProperty(value = "存货单价")
    private BigDecimal costPrice;


    /**
     * 存货资产
     */
    @Excel(name = "存货资产")
    @ApiModelProperty(value = "存货资产")
    private BigDecimal costAmt;


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


    /**
     * 备注
     */
    @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;


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


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


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


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


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


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


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


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

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


    private static final long serialVersionUID = 1L;

}
