package com.prolog.eis.model.container;

import com.prolog.eis.constants.cfg.LocationCfgConstants;
import com.prolog.framework.core.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;


/**
    * 容器信息表
    */
@ApiModel(value="容器信息表")
@Data
@Table(value = "container_info")
public class ContainerInfo {
    public final static Integer CONTAINER_TYPE_EMPTY = 1;
    public final static Integer CONTAINER_TYPE_GOODS = 3;

    /**
     * id
     */
    @Id
    @Column("id")
    @AutoKey(type = AutoKey.TYPE_IDENTITY)
    @ApiModelProperty(value = "id")
    private Integer id;

    /**
     * 容器号
     */
    @Column(value = "container_no")
    @ApiModelProperty(value="容器号")
    private String containerNo;

    /**
     * 容器类型
     */
    @Column(value = "container_type")
    @ApiModelProperty(value="容器类型（1、空托盘，2、空托盘垛，3、商品托盘/周转箱/纸箱）4.货架")
    private Integer containerType;

    /**
     * 容器类型
     */
    @Column(value = "area_type")
    @ApiModelProperty(value="1.四向库  2.AGV药品托盘库 3.AGV食品托盘库：4.AGV器械托盘库 5.拆零库:(包含食品、器械、药品)\\n")
    private Integer areaType;


    @Column(value = "warehouse_area")
    @ApiModelProperty(value = "库区（四向库：SX01;AGV托盘：AGVTP01;AGV货架：AGVHJ01 ）")
    private String warehouseArea;
    /**
     * 任务类型
     */
    @Column(value = "task_type")
    @ApiModelProperty(value="任务类型")
    private Integer taskType;

    /**
     * 是否锁定
     */
    @Column(value = "is_lock")
    @ApiModelProperty(value="是否锁定")
    private Integer isLock;

    /**
     * 创建时间
     */
    @Column(value = "create_time")
    @ApiModelProperty(value="创建时间")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @Column(value = "update_time")
    @ApiModelProperty(value="修改时间")
    private LocalDateTime updateTime;

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

    /**
     * 备注
     */
    @Column(value = "source")
    @ApiModelProperty(value="存储位置")
    private String source;

    @Ignore
    private Integer deptNum;

    public Integer getAGVLCode() {
        return this.containerType == 4 ? LocationCfgConstants.AGVL_HJ : LocationCfgConstants.AGVL_TP;
    }
}