chen.lin
17 小时以前 7c93f84a1fbd9532bd5f6a1adfb434bc17bda3f9
rsf-server/src/main/java/com/vincent/rsf/server/manager/enums/LocStsType.java
@@ -1,90 +1,90 @@
package com.vincent.rsf.server.manager.enums;
public enum LocStsType {
    //空板
    LOC_STS_TYPE_D("D", "空板"),
    //在库
    LOC_STS_TYPE_F("F", "在库"),
    //空库
    LOC_STS_TYPE_O("O", "空库"),
    //禁用
    LOC_STS_TYPE_X("X", "禁用"),
    //入库预约
    LOC_STS_TYPE_S("S", "入库预约"),
    //出库预约
    LOC_STS_TYPE_R("R", "出库预约"),
    ;
    public String type;
    public String desc;
    LocStsType(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }
    public static LocStsType get(String el) {
        for (LocStsType value : LocStsType.values()) {
            if (el.equals(value.toString())) {
                return value;
            }
        }
        return null;
    }
    /** 根据状态码(type)取描述,如 F -> 在库 */
    public static String getDescByType(String type) {
        if (type == null || type.isEmpty()) return type;
        for (LocStsType value : LocStsType.values()) {
            if (type.trim().equals(value.type)) return value.desc;
        }
        return type;
    }
    /**
     * @author Ryan
     * @date 2025/8/28
     * @description: RCS库位状态转换
     * @version 1.0
     */
    public static String getLocSts(String val) {
        if (val.equals(RcsLocStsType.LOC_STS_TYPE_D.type)) {
            return LocStsType.LOC_STS_TYPE_O.type;
        } else if (val.equals(RcsLocStsType.LOC_STS_TYPE_F.type)) {
            return LocStsType.LOC_STS_TYPE_F.type;
        } else if (val.equals(RcsLocStsType.LOC_STS_TYPE_S.type)) {
            return LocStsType.LOC_STS_TYPE_S.type;
        } else if (val.equals(RcsLocStsType.LOC_STS_TYPE_R.type)) {
            return LocStsType.LOC_STS_TYPE_R.type;
        } else if (val.equals(RcsLocStsType.LOC_STS_TYPE_X.type)) {
            return LocStsType.LOC_STS_TYPE_X.type;
        }
        return null;
    }
    /**
     * @author Ryan
     * @date 2025/8/28
     * @description: RCS库位状态转换
     * @version 1.0
     */
    public static String getRcsLocSts(String val) {
        if (val.equals(LocStsType.LOC_STS_TYPE_O.type)) {
            return RcsLocStsType.LOC_STS_TYPE_D.desc;
        } else if (val.equals(LocStsType.LOC_STS_TYPE_F.type)) {
            return RcsLocStsType.LOC_STS_TYPE_F.desc;
        } else if (val.equals(LocStsType.LOC_STS_TYPE_S.type)) {
            return RcsLocStsType.LOC_STS_TYPE_S.desc;
        } else if (val.equals(LocStsType.LOC_STS_TYPE_R.type)) {
            return RcsLocStsType.LOC_STS_TYPE_R.desc;
        } else if (val.equals(LocStsType.LOC_STS_TYPE_X.type)) {
            return RcsLocStsType.LOC_STS_TYPE_X.desc;
        }
        return null;
    }
}
package com.vincent.rsf.server.manager.enums;
public enum LocStsType {
    //空板
    LOC_STS_TYPE_D("D", "空板"),
    //在库
    LOC_STS_TYPE_F("F", "在库"),
    //空库
    LOC_STS_TYPE_O("O", "空库"),
    //禁用
    LOC_STS_TYPE_X("X", "禁用"),
    //入库预约
    LOC_STS_TYPE_S("S", "入库预约"),
    //出库预约
    LOC_STS_TYPE_R("R", "出库预约"),
    ;
    public String type;
    public String desc;
    LocStsType(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }
    public static LocStsType get(String el) {
        for (LocStsType value : LocStsType.values()) {
            if (el.equals(value.toString())) {
                return value;
            }
        }
        return null;
    }
    /** 根据状态码(type)取描述,如 F -> 在库 */
    public static String getDescByType(String type) {
        if (type == null || type.isEmpty()) return type;
        for (LocStsType value : LocStsType.values()) {
            if (type.trim().equals(value.type)) return value.desc;
        }
        return type;
    }
    /**
     * @author Ryan
     * @date 2025/8/28
     * @description: RCS库位状态转换
     * @version 1.0
     */
    public static String getLocSts(String val) {
        if (val.equals(RcsLocStsType.LOC_STS_TYPE_D.type)) {
            return LocStsType.LOC_STS_TYPE_O.type;
        } else if (val.equals(RcsLocStsType.LOC_STS_TYPE_F.type)) {
            return LocStsType.LOC_STS_TYPE_F.type;
        } else if (val.equals(RcsLocStsType.LOC_STS_TYPE_S.type)) {
            return LocStsType.LOC_STS_TYPE_S.type;
        } else if (val.equals(RcsLocStsType.LOC_STS_TYPE_R.type)) {
            return LocStsType.LOC_STS_TYPE_R.type;
        } else if (val.equals(RcsLocStsType.LOC_STS_TYPE_X.type)) {
            return LocStsType.LOC_STS_TYPE_X.type;
        }
        return null;
    }
    /**
     * @author Ryan
     * @date 2025/8/28
     * @description: RCS库位状态转换
     * @version 1.0
     */
    public static String getRcsLocSts(String val) {
        if (val.equals(LocStsType.LOC_STS_TYPE_O.type)) {
            return RcsLocStsType.LOC_STS_TYPE_D.desc;
        } else if (val.equals(LocStsType.LOC_STS_TYPE_F.type)) {
            return RcsLocStsType.LOC_STS_TYPE_F.desc;
        } else if (val.equals(LocStsType.LOC_STS_TYPE_S.type)) {
            return RcsLocStsType.LOC_STS_TYPE_S.desc;
        } else if (val.equals(LocStsType.LOC_STS_TYPE_R.type)) {
            return RcsLocStsType.LOC_STS_TYPE_R.desc;
        } else if (val.equals(LocStsType.LOC_STS_TYPE_X.type)) {
            return RcsLocStsType.LOC_STS_TYPE_X.desc;
        }
        return null;
    }
}