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

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.dk.common.infrastructure.handler.TimestampTypeHandler;
import com.dk.common.infrastructure.handler.UuidTypeHandler;
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 InOutRecordVO  {

    /*
     * 数据库字段
     */

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


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


    /**
     * 业务单据 (表名（哪个业务单据触发的库存变化）)
     */
    @ApiModelProperty(value = "业务单据 (表名（哪个业务单据触发的库存变化）)")
    private String biznisType;


    /**
     * 业务单ID
     */
    @ApiModelProperty(value = "业务单ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String biznisId;


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


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


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


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


    /**
     * 入库数量 (流入为正数，流出为负数)
     */
    @ApiModelProperty(value = "入库数量 (流入为正数，流出为负数)")
    private BigDecimal intoQty;


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


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


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


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


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


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

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


    @ApiModelProperty(value = "库存类型（入库，出库）")
    private String inventoryType;

    @ApiModelProperty(value = "库存业务类型（入库4种，出库4中）")
    private String inventoryDocCode;

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

    @ApiModelProperty(value = "入库单明细id")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String intoItemId;

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

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

    @TableField(typeHandler = UuidTypeHandler.class)
    @ApiModelProperty(value = "出库单id")
    private String outId;

    @ApiModelProperty(value = "出库价")
    private BigDecimal  priceOut;

    @ApiModelProperty(value = "出库金额")
    private BigDecimal  outAmt;

    @ApiModelProperty(value = "出库日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(typeHandler = TimestampTypeHandler.class, updateStrategy = FieldStrategy.IGNORED)
    private LocalDate outDate;

    @TableField(typeHandler = UuidTypeHandler.class)
    @ApiModelProperty(value = "明细id(出库，入库，调整单）")
    private String itemId;

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

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

    @ApiModelProperty(value = "数量编辑之前")
    private BigDecimal qtyBeforeUpdate;

    @ApiModelProperty(value = "金额编辑之前")
    private BigDecimal amtBeforeUpdate;


    @ApiModelProperty(value = "新建编辑标识true:新建,false:编辑")
    private Boolean addOrEditFlag;


    @ApiModelProperty(value = "可以输入负数出库标识")
    private Boolean canNegativeFlag;


    @ApiModelProperty(value = "源出库单明细ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String sOutItemId;

    @ApiModelProperty(value = "源出库单ID")
    @TableField(typeHandler = UuidTypeHandler.class)
    private String sOutId;

    @ApiModelProperty(value = "业务单单号")
    private String biznisNo;

    @ApiModelProperty(value = "出库商品顺序-库存调整给入库价")
    private Integer itemIndex;













    private static final long serialVersionUID = 1L;

}
