# GmwrMonthEndEnum.java

    package cloud.wconnect.workperformance.cons.gmwr.monthend;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

    import java.util.Arrays;
    import java.util.Optional;

    /**
     * Enum: Month End
     *
     * @author zc
     * @date 2025/02/28
     */
    @Getter
    @AllArgsConstructor
    public enum GmwrMonthEndEnum {

        OCC_PERCENT(1, "OCC %"),
        REV_PAR(2, "REV PAR"),
        ADR(3, "ADR"),
        ROOM_REVENUE(4, "ROOM REVENUE"),
        FB_REVENUE(5, "FB REVENUE"),
        OTHERS_REVENUE(6, "OTHERS REVENUE"),
        TOTAL_REVENUE(7, "TOTAL REVENUE");

        private final int category;

        private final String categoryName;

        /**
         * 获取分类名称
         *
         * @param category 分类
         * @return java.lang.String
         * @author zc
         * @date 2025/2/28
         */
        public static String getCategoryName(int category) {
            Optional<GmwrMonthEndEnum> optional = Arrays.stream(GmwrMonthEndEnum.values())
                    .filter(item -> item.getCategory() == category).findFirst();
            return optional.isPresent() ? optional.get().getCategoryName() : "";
        }

    }