# FdProcedureCheckHandledResultEnum.java

    package cloud.wconnect.workperformance.cons.fdprocedurecheck;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

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

    /**
     * Enum: FD result status
     *
     * @author zc
     * @date 2023/10/07
     */
    @Getter
    @AllArgsConstructor
    public enum FdProcedureCheckHandledResultEnum {

        /**
         * 处理结果 0：Pending 1：Revise 2：Confirm
         */
        PENDING(0, "fd.result.pending"),
        REVISE(1, "fd.result.revise"),
        CONFIRM(2, "fd.result.confirm");

        private final int status;

        private final String i18nCode;

        /**
         * 获取状态对应的国际化code
         *
         * @param status 状态
         * @return java.lang.String
         * @author zc
         * @date 2024/1/16
         */
        public static String getI18nCode(int status) {
            Optional<FdProcedureCheckHandledResultEnum> optional = Arrays.stream(FdProcedureCheckHandledResultEnum.values())
                    .filter(item -> item.getStatus() == status).findFirst();
            return optional.isPresent() ? optional.get().getI18nCode() : "";
        }
    }