#
zjj
2024-11-03 242586527d932f0608c3ddf3e25964a47b0763cc
src/main/java/com/zy/core/enums/CrnStatusType.java
@@ -16,7 +16,8 @@
    WAITING(10, "任务完成等待WCS确认"),
    PAUSE(11, "任务暂停"),
    SOS(99, "报警"),
    UNKNOW(100,"其他")
    UNKNOW(100,"其他"),
    UNKNOW1000(1000,"未知")
    ;
    public Integer id;
@@ -28,25 +29,29 @@
    public static CrnStatusType get(Short id) {
        if (null == id) {
            return null;
            System.out.println("id为空");
            return UNKNOW1000;
        }
        for (CrnStatusType type : CrnStatusType.values()) {
            if (type.id.equals(id.intValue())) {
                return type;
            }
        }
        return NONE;
        System.out.println("id未知"+id);
        return UNKNOW1000;
    }
    public static CrnStatusType get(CrnStatusType type) {
        if (null == type) {
            return null;
            System.out.println("type为空");
            return UNKNOW1000;
        }
        for (CrnStatusType crnStatusType : CrnStatusType.values()) {
            if (crnStatusType == type) {
                return crnStatusType;
            }
        }
        return null;
        System.out.println("type未知"+type);
        return UNKNOW1000;
    }
}