# GmwrCategoryEnum.java

    package cloud.wconnect.workperformance.cons.gmwr;

    import com.google.common.collect.Lists;
    import lombok.AllArgsConstructor;
    import lombok.Getter;

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

    /**
     * Enum: 项目分类
     *
     * @author zc
     * @date 2024/12/31
     */
    @Getter
    @AllArgsConstructor
    public enum GmwrCategoryEnum {

        MONTH_END(1, "Month End"),
        Monthly_OTB_Pace(2, "Monthly OTB Pace"),
        STR_DATA(3, "STR DATA"),
        REVENUE(4, "Revenue"),
        EXPENSE(5, "Expense"),
        QUALITY_AND_SERVICE(6, "Quality and Service"),
        SELLOUT_EFFICIENCY(7, "Sellout Efficiency"),
        COMMENT(8, "Comment");

        private final int category;

        private final String title;

        /**
         * 获取标题
         *
         * @param category 分类
         * @return java.lang.String
         * @author zc
         * @date 2024/12/30
         */
        public static String getTitle(int category) {
            Optional<GmwrCategoryEnum> optional = Arrays.stream(GmwrCategoryEnum.values())
                    .filter(item -> item.getCategory() == category).findFirst();
            return optional.isPresent() ? optional.get().getTitle() : "";
        }

        /**
         * 获取必要的分类
         *
         * @return java.util.List<java.lang.Integer>
         * @author zc
         * @date 2025/1/3
         */
        public static List<Integer> getNecessaryCategoryList() {
            return Lists.newArrayList(GmwrCategoryEnum.MONTH_END.getCategory(), GmwrCategoryEnum.Monthly_OTB_Pace.getCategory(),
                    GmwrCategoryEnum.STR_DATA.getCategory(), GmwrCategoryEnum.SELLOUT_EFFICIENCY.getCategory(), GmwrCategoryEnum.COMMENT.getCategory());
        }
    }