package com.zcloud.primeport.domain.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * 菜单枚举
 *
 * @author zhangyue
 * @date 2025/12/6 13:48
 */
@Getter
public enum MenuEnum {
    /**
     * 门禁审批人管理
     */
    JGD_FIRST_LEVEL_APPROVER("/primeport/container/supervision/firstLevelDoor/approverUser", "jgd-first-level-approver"),
    /**
     * 一级口门信息管理
     */
    JGD_FIRST_LEVEL_DOOR_INFO("/primeport/container/supervision/firstLevelDoor/basicInfo/firstLevelDoorInfo/list", "jgd-first-level-door-info"),
    /**
     * 相关方人员进港审批
     */
    JGD_ENTRY_STK_PERSONNEL_APPROVAL("/primeport/container/supervision/firstLevelDoor/portEntryApproval/personnelApproval/relatedPersonnel", "jgd-entry-stk-personnel-approval"),
    /**
     * 相关方人员进港审批记录
     */
    JGD_ENTRY_STK_PERSONNEL_RECORDS("/primeport/container/supervision/firstLevelDoor/portEntryApproval/personnelApproval/relatedPersonnelRecords", "jgd-entry-stk-personnel-records"),
    /**
     * 股份车辆审批
     */
    JGD_ENTRY_SHARE_VEHICLE_APPROVAL("/primeport/container/supervision/firstLevelDoor/portEntryApproval/longTermVehicleApproval/shareVehicles", "jgd-entry-share-vehicle-approval"),
    /**
     * 股份车辆审批记录
     */
    JGD_ENTRY_SHARE_VEHICLE_RECORDS("/primeport/container/supervision/firstLevelDoor/portEntryApproval/longTermVehicleApproval/shareVehiclesRecords", "jgd-entry-share-vehicle-records"),
    /**
     * 相关方车辆审批
     */
    JGD_ENTRY_STK_VEHICLE_APPROVAL("/primeport/container/supervision/firstLevelDoor/portEntryApproval/longTermVehicleApproval/relatedVehicles", "jgd-entry-stk-vehicle-approval"),
    /**
     * 相关方车辆审批记录
     */
    JGD_ENTRY_STK_VEHICLE_RECORDS("/primeport/container/supervision/firstLevelDoor/portEntryApproval/longTermVehicleApproval/relatedVehiclesRecords", "jgd-entry-stk-vehicle-records"),
    /**
     * 临时人员管理
     */
    JGD_ENTRY_TEMP_PERSONNEL("/primeport/container/supervision/firstLevelDoor/portEntryApproval/temporaryVisitor/temporaryPersonnel/list", "jgd-entry-temp-personnel"),
    /**
     * 临时人员管理记录
     */
    JGD_ENTRY_TEMP_PERSONNEL_RECORDS("/primeport/container/supervision/firstLevelDoor/portEntryApproval/temporaryVisitor/temporaryPersonnelRecords/list", "jgd-entry-temp-personnel-records"),
    /**
     * 临时车辆管理
     */
    JGD_ENTRY_TEMP_VEHICLE("/primeport/container/supervision/firstLevelDoor/portEntryApproval/temporaryVisitor/temporaryVehicle/list", "jgd-entry-temp-vehicle"),
    /**
     * 临时车辆管理记录
     */
    JGD_ENTRY_TEMP_VEHICLE_RECORDS("/primeport/container/supervision/firstLevelDoor/portEntryApproval/temporaryVisitor/temporaryVehicleRecords/list", "jgd-entry-temp-vehicle-records"),
    /**
     * 股份人员及车辆管理
     */
    JGD_IO_STOCK_PV("/primeport/container/supervision/firstLevelDoor/importAndExportPortInfo/stockPersonnelAndVehicles/list", "jgd-io-stock-pv"),
    /**
     * 个人车辆管理
     */
    JGD_IO_PERSONAL_VEHICLE("/primeport/container/supervision/firstLevelDoor/importAndExportPortInfo/personalVehicle/list", "jgd-io-personal-vehicle"),
    /**
     * 股份单位车辆管理
     */
    JGD_IO_STOCK_UNIT_VEHICLE("/primeport/container/supervision/firstLevelDoor/importAndExportPortInfo/stockVehicles/list", "jgd-io-stock-unit-vehicle"),
    /**
     * 分公司人员及车辆管理
     */
    JGD_IO_BRANCH_PV("/primeport/container/supervision/firstLevelDoor/importAndExportPortInfo/branchPersonnelAndVehicles/list", "jgd-io-branch-pv"),
    /**
     * 相关方人员及车辆管理
     */
    JGD_IO_STK_PV("/primeport/container/supervision/firstLevelDoor/importAndExportPortInfo/stakeholderPersonnelAndVehicles/list", "jgd-io-stk-pv"),
    /**
     * 驻港单位人员及车辆管理
     */
    JGD_IO_PORT_UNIT_PV("/primeport/container/supervision/firstLevelDoor/importAndExportPortInfo/portBasedUnitsPersonnelAndVehicles/list", "jgd-io-port-unit-pv"),
    /**
     * 检查部门车辆管理
     */
    JGD_IO_INSPECT_VEHICLE("/primeport/container/supervision/firstLevelDoor/importAndExportPortInfo/inspectDepartmentVehicles/list", "jgd-io-inspect-vehicle"),
    /**
     * 车辆违规管理
     */
    JGD_CHE_LIANG_WEI_GUI_GUAN_LI("/primeport/container/supervision/firstLevelDoor/importAndExportPortInfo/vehiclesViolation/vehiclesViolation/list", "jgd-che-liang-wei-gui-guan-li"),
    /**
     * 车辆黑名单管理
     */
    JGD_IO_BLACKLIST("/primeport/container/supervision/firstLevelDoor/importAndExportPortInfo/vehiclesViolation/vehicleBlacklist/list", "jgd-io-blacklist"),
    /**
     * 封闭区域管理
     */
    JGD_FENG_BI_QU_YU_GUAN_LI("/primeport/container/supervision/enclosedArea/areaAndEntrance/enclosedArea/list", "jgd-feng-bi-qu-yu-guan-li"),
    /**
     * 封闭区域口门管理
     */
    JGD_ENCLOSED_DOOR("/primeport/container/supervision/enclosedArea/areaAndEntrance/enclosedAreaDoor/list", "jgd-enclosed-door"),
    /**
     * 人员封闭区域申请
     */
    JGD_ENCLOSED_PERSONNEL_APPLY("/primeport/container/supervision/enclosedArea/apply/personnel/list", "jgd-enclosed-personnel-apply"),
    /**
     * 车辆封闭区域申请
     */
    JGD_ENCLOSED_VEHICLE_APPLY("/primeport/container/supervision/enclosedArea/apply/vehicle/list", "jgd-enclosed-vehicle-apply"),
    /**
     * 人员封闭区域申请记录
     */
    JGD_ENCLOSED_PERSONNEL_RECORDS("/primeport/container/supervision/enclosedArea/apply/personnelRecords/list", "jgd-enclosed-personnel-records"),
    /**
     * 车辆封闭区域申请记录
     */
    JGD_ENCLOSED_VEHICLE_RECORDS("/primeport/container/supervision/enclosedArea/apply/vehicleRecords/list", "jgd-enclosed-vehicle-records"),
    /**
     * 区域人员及车辆统计
     */
    JGD_ENCLOSED_AREA_STATS("/primeport/container/supervision/enclosedArea/personnelAndVehicleStatistics/list", "jgd-enclosed-area-stats"),
    /**
     * 门禁审批人管理
     */
    FGS_FIRST_LEVEL_APPROVER("/primeport/container/enterprise/firstLevelDoor/approverUser", "fgs-first-level-approver"),
    /**
     * 相关方人员进港审批
     */
    FGS_ENTRY_STK_PERSON_APPROVAL("/primeport/container/enterprise/firstLevelDoor/portEntryApproval/personnelApproval/relatedPersonnel", "fgs-entry-stk-person-approval"),
    FGS_ENTRY_STK_PERSON_APPROVAL_RECORD("/primeport/container/enterprise/firstLevelDoor/portEntryApproval/personnelApproval/relatedPersonnelRecords", "fgs-entry-stk-person-approval-record"),
    /**
     * 长期车辆审批
     */
    FGS_STK_VEHICLE_APPROVAL("/primeport/container/enterprise/firstLevelDoor/portEntryApproval/longTermVehicleApproval/shareVehicles", "fgs-stk-vehicle-approval"),
    /**
     * 相关方车辆审批
     */
    FGS_XIANG_GUAN_FANG_CHE_LIANG_SHEN_PI("/primeport/container/enterprise/firstLevelDoor/portEntryApproval/longTermVehicleApproval/relatedVehicles", "fgs-xiang-guan-fang-che-liang-shen-pi"),
    /**
     * 长期车辆审批记录
     */
    FGS_STK_VEHICLE_APPROVAL_RECORD("/primeport/container/enterprise/firstLevelDoor/portEntryApproval/longTermVehicleApproval/shareVehiclesRecords", "fgs-cqclspjl-record"),
    /**
     * 相关方车辆审批记录
     */
    FGS_XIANG_GUAN_FANG_CHE_LIANG_SHEN_PI_RECORD("/primeport/container/enterprise/firstLevelDoor/portEntryApproval/longTermVehicleApproval/relatedVehiclesRecords", "fgs-xgfcqclspjl-record"),
    /**
     * 临时人员管理
     */
    FGS_LIN_SHI_REN_YUAN_GUAN_LI("/primeport/container/enterprise/firstLevelDoor/portEntryApproval/temporaryVisitor/temporaryPersonnel/list", "fgs-lin-shi-ren-yuan-guan-li"),
    /**
     * 临时车辆管理
     */
    FGS_LIN_SHI_CHE_LIANG_GUAN_LI("/primeport/container/enterprise/firstLevelDoor/portEntryApproval/temporaryVisitor/temporaryVehicle/list", "fgs-lin-shi-che-liang-guan-li"),
    /**
     * 临时人员管理记录
     */
    FGS_LIN_SHI_REN_YUAN_GUAN_LI_RECORD("/primeport/container/enterprise/firstLevelDoor/portEntryApproval/temporaryVisitor/temporaryPersonnelRecords/list", "fgs-lsyr-aduit-record"),
    /**
     * 临时车辆管理记录
     */
    FGS_LIN_SHI_CHE_LIANG_GUAN_LI_RECORD("/primeport/container/enterprise/firstLevelDoor/portEntryApproval/temporaryVisitor/temporaryVehicleRecords/list", "fgs-lscl-aduit-record"),

    /**
     * 人员及车辆管理
     */
    FGS_REN_YUAN_JI_CHE_LIANG_GUAN_LI("/primeport/container/enterprise/firstLevelDoor/importAndExportPortInfo/stockPersonnelAndVehicles/list", "fgs-ren-yuan-ji-che-liang-guan-li"),
    /**
     * 个人车辆管理
     */
    FGS_GE_REN_CHE_LIANG_GUAN_LI("/primeport/container/enterprise/firstLevelDoor/importAndExportPortInfo/personalVehicle/list", "fgs-grclgl"),
    /**
     * 单位车辆管理
     */
    FGS_DAN_WEI_CHE_LIANG_GUAN_LI("/primeport/container/enterprise/firstLevelDoor/importAndExportPortInfo/stockVehicles/list", "fgs-dwclgl"),
    /**
     * 相关方人员及车辆管理
     */
    FGS_XIANG_GUAN_FANG_REN_YUAN_JI_CHE_LIANG_GUAN_LI("/primeport/container/enterprise/firstLevelDoor/importAndExportPortInfo/stakeholderPersonnelAndVehicles/list", "fgs-xgfryjclgl"),
    /**
     * 车辆违规管理
     */
    FGS_CHE_LIANG_WEI_GUI_GUAN_LI("/primeport/container/enterprise/firstLevelDoor/importAndExportPortInfo/vehiclesViolation/vehiclesViolation/list", "fgs-che-liang-wei-gui-guan-li"),
    /**
     * 车辆黑名单管理
     */
    FGS_CHE_LIANG_HEI_MING_DAN_GUAN_LI("/primeport/container/enterprise/firstLevelDoor/importAndExportPortInfo/vehiclesViolation/vehicleBlacklist/list", "fgs-che-liang-hei-ming-dan-guan-li"),
    /**
     * 封闭区域管理
     */
    FGS_FENG_BI_QU_YU_GUAN_LI("/primeport/container/enterprise/enclosedArea/areaAndEntrance/enclosedArea/list", "fgs-feng-bi-qu-yu-guan-li"),
    /**
     * 封闭区域口门管理
     */
    FGS_FENG_BI_QU_YU_KOU_MEN_GUAN_LI("/primeport/container/enterprise/enclosedArea/areaAndEntrance/enclosedAreaDoor/list", "fgs-feng-bi-qu-yu-kou-men-guan-li"),
    /**
     * 人员封闭区域申请
     */
    FGS_REN_YUAN_FENG_BI_QU_YU_SHEN_QING("/primeport/container/enterprise/enclosedArea/apply/personnel/list", "fgs-ren-yuan-feng-bi-qu-yu-shen-qing"),
    /**
     * 车辆封闭区域申请
     */
    FGS_CHE_LIANG_FENG_BI_QU_YU_SHEN_QING("/primeport/container/enterprise/enclosedArea/apply/vehicle/list", "fgs-che-liang-feng-bi-qu-yu-shen-qing"),
    /**
     * 人员封闭区域申请记录
     */
    FGS_REN_YUAN_FENG_BI_QU_YU_SHEN_QING_JI_LU("/primeport/container/enterprise/enclosedArea/apply/personnelRecords/list", "fgs-ren-yuan-feng-bi-qu-yu-shen-qing-ji-lu"),
    /**
     * 车辆封闭区域申请记录
     */
    FGS_CHE_LIANG_FENG_BI_QU_YU_SHEN_QING_JI_LU("/primeport/container/enterprise/enclosedArea/apply/vehicleRecords/list", "fgs-che-liang-feng-bi-qu-yu-shen-qing-ji-lu"),
    /**
     * 区域人员及车辆统计
     */
    FGS_QU_YU_REN_YUAN_JI_CHE_LIANG_TONG_JI("/primeport/container/enterprise/enclosedArea/personnelAndVehicleStatistics/list", "fgs-qu-yu-ren-yuan-ji-che-liang-tong-ji"),
    /**
     * 企业人员权限
     */
    FGS_ENT_PERMISSION("/primeport/container/enterprise/enclosedArea/enterprisePersonnelPermissions/list", "fgs-ent-permission"),
    /**
     * 长期人员审核
     */
    FGS_ENT_LONG_PERSONNEL_REVIEW("/primeport/container/enterprise/enclosedArea/personnelReview/longTermPersonnelReview/list", "fgs-ent-long-personnel-review"),
    /**
     * 临时人员审核
     */
    FGS_ENT_TEMP_PERSONNEL_REVIEW("/primeport/container/enterprise/enclosedArea/personnelReview/temporaryPersonnelReview/list", "fgs-ent-temp-personnel-review"),
    /**
     * 长期人员审核记录
     */
    FGS_ENT_LONG_PERSONNEL_RECORDS("/primeport/container/enterprise/enclosedArea/personnelReview/longTermPersonnelReviewRecords/list", "fgs-ent-long-personnel-records"),
    /**
     * 临时访客人员记录
     */
    FGS_ENT_TEMP_VISITOR_RECORDS("/primeport/container/enterprise/enclosedArea/personnelReview/temporaryPersonnelReviewRecords/list", "fgs-ent-temp-visitor-records"),
    /**
     * 长期车辆审核
     */
    FGS_ENT_LONG_VEHICLE_REVIEW("/primeport/container/enterprise/enclosedArea/vehicleReview/longTermVehicleReview/list", "fgs-ent-long-vehicle-review"),
    /**
     * 临时车辆审核
     */
    FGS_ENT_TEMP_VEHICLE_REVIEW("/primeport/container/enterprise/enclosedArea/vehicleReview/temporaryVehicleReview/list", "fgs-ent-temp-vehicle-review"),
    /**
     * 长期车辆审核记录
     */
    FGS_ENT_LONG_VEHICLE_RECORDS("/primeport/container/enterprise/enclosedArea/vehicleReview/longTermVehicleReviewRecords/list", "fgs-ent-long-vehicle-records"),
    /**
     * 临时车辆审核记录
     */
    FGS_ENT_TEMP_VEHICLE_RECORDS("/primeport/container/enterprise/enclosedArea/vehicleReview/temporaryVehicleReviewRecords/list", "fgs-ent-temp-vehicle-records"),
    /**
     * 人员权限记录
     */
    JGD_STK_PERSONNEL_PERMISSION_RECORDS("/primeport/container/stakeholder/firstLevelDoor/personnelPermissionRecords/list", "xgf-stk-personnel-permission-records"),
    /**
     * 人员申请
     */
    JGD_STK_PERSONNEL_APPLICATION("/primeport/container/stakeholder/firstLevelDoor/personnelApplication/list", "xgf-stk-personnel-application"),
    /**
     * 车辆申请
     */
    JGD_STK_VEHICLE_APPLICATION("/primeport/container/stakeholder/firstLevelDoor/vehicleApplication/list", "xgf-stk-vehicle-application"),
    /**
     * 人员申请记录
     */
    JGD_STK_PERSONNEL_APP_RECORDS("/primeport/container/stakeholder/firstLevelDoor/personnelApplicationRecords/list", "xgf-stk-personnel-app-records"),
    /**
     * 车辆申请记录
     */
    JGD_STK_VEHICLE_APP_RECORDS("/primeport/container/stakeholder/firstLevelDoor/vehicleApplicationRecords/list", "xgf-stk-vehicle-app-records"),
    /**
     * 人员封闭区域申请
     */
    XGS_REN_YUAN_FENG_BI_QU_YU_SHEN_QING("/primeport/container/stakeholder/enclosedArea/apply/personnel/list", "xgs-ren-yuan-feng-bi-qu-yu-shen-qing"),
    /**
     * 车辆封闭区域申请
     */
    XGS_CHE_LIANG_FENG_BI_QU_YU_SHEN_QING("/primeport/container/stakeholder/enclosedArea/apply/vehicle/list", "xgs-che-liang-feng-bi-qu-yu-shen-qing"),
    /**
     * 人员封闭区域申请记录
     */
    XGS_REN_YUAN_FENG_BI_QU_YU_SHEN_QING_JI_LU("/primeport/container/stakeholder/enclosedArea/apply/personnelRecords/list", "xgs-ren-yuan-feng-bi-qu-yu-shen-qing-ji-lu"),
    /**
     * 车辆封闭区域申请记录
     */
    XGS_CHE_LIANG_FENG_BI_QU_YU_SHEN_QING_JI_LU("/primeport/container/stakeholder/enclosedArea/apply/vehicleRecords/list", "xgs-che-liang-feng-bi-qu-yu-shen-qing-ji-lu"),

    ZGDW_MJSPR("/primeport/container/stakeholder/firstLevelDoor/approverUser", "zgdw-mjspr"),
    ZGDW_RYJCLGL("/primeport/container/stakeholder/firstLevelDoor/importAndExportPortInfo/stockPersonnelAndVehicles/list", "zgdw-ryjclgl"),
    ZGDW_GRCLGL("/primeport/container/stakeholder/firstLevelDoor/importAndExportPortInfo/personalVehicle/list", "zgdw-grclgl"),
    ZGDW_CLWGGL("/primeport/container/stakeholder/firstLevelDoor/importAndExportPortInfo/vehiclesViolation/vehiclesViolation/list", "zgdw-clwggl"),
    ZGDW_CLHMDGL("/primeport/container/stakeholder/firstLevelDoor/importAndExportPortInfo/vehiclesViolation/vehicleBlacklist/list", "zgdw-clhmdgl"),
    ZGDW_JGSP_CLSP("/primeport/container/stakeholder/firstLevelDoor/portEntryApproval/longTermVehicleApproval/shareVehicles", "zgdw-jgsp-clsp"),
    ZGDW_CLSPJL("/primeport/container/stakeholder/firstLevelDoor/portEntryApproval/longTermVehicleApproval/shareVehiclesRecords", "zgdw-clspjl"),
    ZGDW_LSRYGL("/primeport/container/stakeholder/firstLevelDoor/portEntryApproval/temporaryVisitor/temporaryPersonnel/list", "zgdw-lsrygl"),
    ZGDW_LSCLGL("/primeport/container/stakeholder/firstLevelDoor/portEntryApproval/temporaryVisitor/temporaryVehicle/list", "zgdw-lsclgl"),
    ZGDW_LSRYGLJL_RECORD("/primeport/container/stakeholder/firstLevelDoor/portEntryApproval/temporaryVisitor/temporaryPersonnelRecords/list", "zgdw-lsrygljl-record"),
    ZGDW_LSCLGLJL_RECORD("/primeport/container/stakeholder/firstLevelDoor/portEntryApproval/temporaryVisitor/temporaryVehicleRecords/list", "zgdw-lsclgljl-record");

    private final String path;
    private final String menuKey;

    private static final Map<String, MenuEnum> PATH_MAP =
            Arrays.stream(values()).collect(Collectors.toMap(MenuEnum::getPath, Function.identity()));

    MenuEnum(String path, String menuKey) {
        this.path = path;
        this.menuKey = menuKey;
    }

    public String getPath() {
        return path;
    }

    public String getMenuKey() {
        return menuKey;
    }

    /**
     * 通过path获取枚举
     */
    public static MenuEnum getByPath(String path) {
        return PATH_MAP.get(path);
    }

    /**
     * 通过path获取menuKey
     */
    public static String getMenuKeyByPath(String path) {
        MenuEnum entry = PATH_MAP.get(path);
        return entry != null ? entry.getMenuKey() : null;
    }
}
