# HotelKpiStrWeekDateEnum.java

    package cloud.wconnect.workperformance.cons.hotelkpi.strdata;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

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

    /**
     * Enum: STR Week - Date
     *
     * @author zc
     * @date 2025/08/22
     */
    @Getter
    @AllArgsConstructor
    public enum HotelKpiStrWeekDateEnum {

        WEEK(1, "Week"),
        R28D(2, "R28D");

        private final int category;

        private final String categoryName;

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

    }