package com.prolog.eis.enums.station;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;

@Getter
@AllArgsConstructor
public enum StationTypeEnum {
    SXKJX_TYPE(10, "1F四向库拣选站台"),
    SXKZT_TYPE(20, "1F四项库整托出库站台 "),
    DDDZT_TYPE(30, "1F单订单整托出库站台"),
    ZYYP_TYPE(40, "二楼中药库上架站台"),
    WLK_TYPE(50, "二楼物料库上架站台"),
    BHGP_TYPE(60, "不合格品上架站台"),
    CLSJ_TYPE(70, "二楼拆零库上架站台"),
    CL_TYPE(71, "拆零库叫料/盘点/养护站台"),
    JX_TYPE(80, "2F拣选站台"),
    ZJ_TYPE(90, "总拣站台"),
    LFZ_TYPE(91, "零发整站台"),
    ZJ_SON_TYPE(92, "总拣站台子站台"),
    AGVCACHE01(93, "总拣站台缓存位"),
    YC_TYPE(100, "异常处理区"),
    ZYYP_HJ_TYPE(110, "二楼中药库上架站台货架"),
    WLK_HJ_TYPE(120, "二楼物料库上架站台货架"),
    WMS_HJ_TYPE(130, "中药饮片物料库区出库站台"),
    ;
    private Integer code;
    private String msg;

    public static StationTypeEnum getByCode(Integer code) {
        StationTypeEnum statusEnum = null;

        for (StationTypeEnum value : values()) {
            if (value.getCode().equals(code)) {
                statusEnum = value;
            }
        }
        return statusEnum;
    }

    public final static List<Integer> ZJ_SON_CODE = Arrays.asList(StationTypeEnum.ZJ_SON_TYPE.getCode());

    public static List<Integer> wmsOutCarryCode() {
        return Arrays.asList(StationTypeEnum.SXKZT_TYPE.getCode(), StationTypeEnum.JX_TYPE.getCode(), StationTypeEnum.YC_TYPE.getCode(), StationTypeEnum.CLSJ_TYPE.getCode()
                , StationTypeEnum.CL_TYPE.getCode(), StationTypeEnum.WMS_HJ_TYPE.getCode(), StationTypeEnum.ZYYP_TYPE.getCode(), StationTypeEnum.WLK_TYPE.getCode());
    }
}
