package cn.estsh.i3plus.pojo.wms.bean;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @Description :存储区
 * @Reference :
 * @Author : hansen.ke
 * @CreateDate : 2018-11-06 11:50
 * @Modify:
 **/
@Data
@Entity
@Table(name="WMS_ZONES")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value="存储区信息表",description = "存储区信息表")
public class WmsZones extends BaseBean {

    private static final long serialVersionUID = 7759454799191378612L;
    @Column(name = "WH_NO")
    @ApiParam(value = "仓库代码")
    private String whNo;

    @Column(name = "AREA_NO")
    @ApiParam(value = "库存地代码")
    private String areaNo;

    @Column(name = "ZONE_NO")
    @ApiParam(value = "存储区代码")
    private String zoneNo;

    @Column(name = "ZONE_NAME")
    @ApiParam(value = "存储区名称")
    private String zoneName;

    @Column(name = "PARENT_ZONE_NO")
    @ApiParam(value = "父级存储区", example ="-1")
    private String parentZoneNo;

    @Column(name = "IS_SON_NODE")
    @ApiParam(value = "是否子节点")
    private Integer isSonNode;

    @Column(name = "IS_PM")
    @ApiParam(value = "零件级管控" , example = "2")
    private Integer isPm;

    @Column(name = "IS_LM")
    @ApiParam(value = "批次级管控" , example = "2")
    private Integer isLm;

    @Column(name = "IS_SN")
    @ApiParam(value = "条码级管控" , example = "1")
    private Integer isSn;

    @Column(name = "IS_MIX")
    @ApiParam(value = "允许混淆" , example = "1")
    private Integer isMix;

    @Column(name = "IS_SC")
    @ApiParam(value = "库容检查" , example = "1")
    private Integer isSc;

    @Column(name = "STRATEGY")
    @ApiParam(value = "堆放策略")
    private String strategy;

    @Column(name = "IS_NEGATIVE")
    @ApiParam(value = "允许负库存" , example = "1")
    private Integer isNegative;

    @Column(name = "CHECK_FIFO")
    @ApiParam(value = "校验先进先出" , example = "1")
    private Integer checkFifo;

    @Transient
    @ApiParam(value ="子存储区列表")
    private List<WmsZones> childList;

    public WmsZones(String zoneNo){
        this.zoneNo = zoneNo;
    }

    public WmsZones(String zoneNo,String areaNo){
        this.zoneNo = zoneNo;
        this.areaNo = areaNo;
    }

    public WmsZones(){}

}
