/*
 * Author: wangjian
 * 生成entity
 */
package com.tofly.stocks.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.tofly.utils.NullHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;

import org.apache.ibatis.type.JdbcType;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.stream.Collectors;


/**
 * 库存出库信息表
 *
 * @author admin
 * @date Fri Nov 25 00:00:00 CST 2022
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "TF_STOCKS_OUTSTOCK_INFO", resultMap = "outstockInfoMap")
@KeySequence("TF_STOCKS_OUTSTOCK_INFO")
@ApiModel
public class OutstockInfo extends Model<OutstockInfo> {
    private static final long serialVersionUID = 1L;

    /**
     * 出库信息主键ID
     */
    @TableId(value = "ID", type = IdType.INPUT)
    @ApiModelProperty(value = "出库信息主键ID")
    private Long id;
    /**
     * 出库编号（WLCK+年+月+0001三位序号）
     */
    @ApiModelProperty(value = "出库编号（WLCK+年+月+0001三位序号）")
    private String outstockNo;
    /**
     * 出库时间
     */
    @ApiModelProperty(value = "出库时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date outstockTime;
    /**
     * 仓库ID
     */
    @ApiModelProperty(value = "仓库ID")
    private Long storeId;


    /**
     * 水厂Id
     */
    @ApiModelProperty(value = "水厂Id")
    @NotNull(message = "水厂Id不能为空")
    private Long waterworksId;

    /**
     * 出库人用户ID
     */
    @ApiModelProperty(value = "出库人用户ID")
    private Long outstockUserId;
    /**
     * 出库类别 外键ID
     */
    @ApiModelProperty(value = "出库类别 外键ID")
    private Long outstockTypeId;
    /**
     * 业务类型
     */
    @ApiModelProperty(value = "业务类型")
    private Long buninessType;
    /**
     * 出库备注
     */
    @ApiModelProperty(value = "出库备注")
    @TableField(jdbcType = JdbcType.VARCHAR,updateStrategy = FieldStrategy.IGNORED,typeHandler = NullHandler.class)
    private String outstockRemark;
    /**
     * 入库状态，1出库中（待确认） 2、已确认
     */
    @ApiModelProperty(value = "入库状态，1出库中（待确认） 2、已确认")
    private Short outstockStatus;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "UPDATE_TIME", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /**
     * 附件json
     */
    @ApiModelProperty(value = "附件json")
    private String annex;
    /**
     * 出库类型 1 物料，2 设备，3药品
     */
    @ApiModelProperty(value = "出库类型 1 物料，2 设备，3药品")
    private Integer outstockCategory;

    /**
     * 出库部门Id
     */
    @ApiModelProperty(value = "出库部门Id")
    private Long outstockDpt;


    /**
     * 出库部门名称
     */
    @ApiModelProperty(value = "出库部门名称",hidden = true)
    @TableField(exist = false)
    private String outstockDptName;

    /**
     * 客户
     */
    @ApiModelProperty(value = "客户")
    @TableField(jdbcType = JdbcType.VARCHAR,updateStrategy = FieldStrategy.IGNORED,typeHandler = NullHandler.class)
    private String outstockCustom;

}
