package com.prolog.eis.model.container;

import com.prolog.eis.constants.cfg.LocationCfgConstants;
import com.prolog.framework.core.annotation.AutoKey;
import com.prolog.framework.core.annotation.Column;
import com.prolog.framework.core.annotation.Id;
import com.prolog.framework.core.annotation.Table;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author zmr
 * @description: 关键点位配置表
 * @date 2023-07-06 11:29
 */
@Data
@Table("location_cfg")
public class LocationCfg {

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

	@Column("area_no")
	@ApiModelProperty("区域")
	private String areaNo;

	@Column("location_no")
	@ApiModelProperty("点位")
	private String locationNo;

	@Column("wms_area_no")
	@ApiModelProperty("wms区域")
	private String wmsAreaNo;

	@Column("wms_location_no")
	@ApiModelProperty("wms点位")
	private String wmsLocationNo;

	@Column("max_cache_position")
	@ApiModelProperty("最大可用位置")
	private Integer maxCachePosition;

	@Column("cur_num")
	@ApiModelProperty("当前数量")
	private Integer curNum;

	@Column("type")
	@ApiModelProperty("类型：10入库上架点位 20空托补给/出库点位 30回库点位")
	private Integer type;

	@Column("direction")
	@ApiModelProperty("方向（10入库方向  20出库方向）")
	private Integer direction;

	@Column("container_no")
	@ApiModelProperty("占用容器")
	private String containerNo;

	@Column("remark")
	@ApiModelProperty("点位描述")
	private String remark;

	@Column("create_time")
	@ApiModelProperty("创建时间")
	private LocalDateTime createTime;

	@Column("update_time")
	@ApiModelProperty("修改时间")
	private LocalDateTime updateTime;

	@Column("sqid")
	@ApiModelProperty("设备编号")
	private String sqid;

	@Column("route_direction_type")
	@ApiModelProperty("route对应的入、出库（和warehouse方向表对应，同站台入库方向所对应的值固定比出库的值小）")
	private String routeDirectionType;

	@Column("status")
	@ApiModelProperty("可用状态 1可用 0不可用")
	private Integer status;

	public boolean dpj2() {
		return this.getType() == LocationCfgConstants.DPJ2;
	}
}

