package com.estate.expert.admin.domain.role; import java.util.LinkedHashMap; import java.util.List; public class PermissionData { public static final LinkedHashMap>> Data = mapN( "智慧大屏设置", mapN( "大屏帐号设置", List.of( Permission.of("accountSetting", Permission.OP_ADD, "新增_帐号"), Permission.of("accountSetting", Permission.OP_EDIT, "编辑_帐号"), Permission.of("accountSetting", Permission.OP_DELETE, "删除_帐号"), Permission.of("accountSetting", "reset", "重置密码_账号"), Permission.of("accountSetting", "status", "禁用启用_账号") ), "事故分类设置", List.of( Permission.of("accidentTypeSetting", Permission.OP_ADD, "新增_分类"), Permission.of("accidentTypeSetting", Permission.OP_EDIT, "编辑_分类"), Permission.of("accidentTypeSetting", Permission.OP_DELETE, "删除_分类") ), "事故简讯", List.of( Permission.of("accidentMessageSetting", Permission.OP_ADD, "新增_简讯"), Permission.of("accidentMessageSetting", Permission.OP_EDIT, "编辑_简讯"), Permission.of("accidentMessageSetting", "status", "禁用启用_简讯号"), Permission.of("accidentMessageSetting", Permission.OP_DELETE, "删除_简讯") ) ,"项目进度设置", List.of( Permission.of("projectProgress", Permission.OP_ADD, "新增_进度"), Permission.of("projectProgress", Permission.OP_EDIT, "编辑_进度"), Permission.of("projectProgress", Permission.OP_DELETE, "删除_进度") ) ), "人事管理", mapN( "用户管理", List.of( Permission.of("user", Permission.OP_LIST, "查看_用户"), Permission.of("user", Permission.OP_ADD, "添加_用户"), Permission.of("user", Permission.OP_EDIT, "编辑_用户"), Permission.of("user", Permission.OP_DELETE, "删除_用户"), Permission.of("user", "resetPass", "重置密码") ), "岗位管理", List.of( Permission.of("role", Permission.OP_LIST, "查看_角色"), Permission.of("role", Permission.OP_ADD, "添加_角色"), Permission.of("role", Permission.OP_EDIT, "编辑_角色"), Permission.of("role", Permission.OP_DELETE, "删除_角色") ), "部门管理", List.of( Permission.of("department", Permission.OP_LIST, "查看_部门"), Permission.of("department", Permission.OP_ADD, "添加_部门"), Permission.of("department", Permission.OP_EDIT, "编辑_部门"), Permission.of("department", Permission.OP_DELETE, "删除_部门") ), "车辆调度", List.of( Permission.of("car", Permission.OP_LIST, "查看_车辆"), Permission.of("car", Permission.OP_ADD, "添加_车辆"), Permission.of("car", Permission.OP_EDIT, "编辑_车辆"), Permission.of("car", Permission.OP_DELETE, "删除_车辆") ) ), "业务信息", mapN( "委托方清单", List.of( Permission.of("client", Permission.OP_LIST, "查看_委托方"), Permission.of("client", Permission.OP_ADD, "添加_委托方"), Permission.of("client", Permission.OP_EDIT, "编辑_委托方"), Permission.of("client", Permission.OP_DELETE, "删除_委托方"), Permission.of("client", "setting", "参数设置_委托方") ), "合同管理", List.of( Permission.of("contract", Permission.OP_LIST, "查看_合同"), Permission.of("contract", Permission.OP_ADD, "添加_合同"), Permission.of("contract", Permission.OP_EDIT, "编辑_合同"), Permission.of("contract", Permission.OP_DELETE, "删除_合同") ), "设备管理", List.of( Permission.of("device", Permission.OP_LIST, "查看_设备"), Permission.of("device", Permission.OP_ADD, "添加_设备"), Permission.of("device", Permission.OP_EDIT, "编辑_设备"), Permission.of("device", Permission.OP_DELETE, "删除_设备") ), "项目列表", List.of( Permission.of("project", Permission.OP_LIST, "查看_项目"), Permission.of("project", Permission.OP_ADD, "添加_项目"), Permission.of("project", Permission.OP_EDIT, "编辑_项目"), Permission.of("project", Permission.OP_DELETE, "删除_项目"), Permission.of("project", "auth", "权限设置_项目"), Permission.of("project", "status", "修改状态_项目") ), "项目信息", List.of( Permission.of("projectInfo", Permission.OP_LIST, "查看_项目信息"), Permission.of("projectInfo", Permission.OP_ADD, "添加_项目信息"), Permission.of("projectInfo", Permission.OP_EDIT, "编辑_项目信息"), Permission.of("projectInfo", Permission.OP_DELETE, "删除_项目信息") ), "项目设备信息", List.of( Permission.of("deviceUsage", Permission.OP_LIST, "查看_项目设备"), Permission.of("deviceUsage", Permission.OP_ADD, "添加_项目设备"), Permission.of("deviceUsage", Permission.OP_EDIT, "编辑_项目设备"), Permission.of("deviceUsage", Permission.OP_DELETE, "删除_项目设备") ) ), "业务标准", mapN( "综合体系-层级", List.of( Permission.of("systemHierarchy", Permission.OP_LIST, "查看_层级"), Permission.of("systemHierarchy", Permission.OP_ADD, "添加_层级"), Permission.of("systemHierarchy", Permission.OP_EDIT, "编辑_层级"), Permission.of("systemHierarchy", Permission.OP_DELETE, "删除_层级") ), "综合体系-问题管理", List.of( Permission.of("systemProblem", Permission.OP_LIST, "查看_内容"), Permission.of("systemProblem", Permission.OP_ADD, "添加_内容"), Permission.of("systemProblem", Permission.OP_EDIT, "编辑_内容"), Permission.of("systemProblem", Permission.OP_DELETE, "删除_内容") ), "综合体系-模型管理", List.of( Permission.of("systemModel", Permission.OP_LIST, "查看_模型"), Permission.of("systemModel", Permission.OP_ADD, "添加_模型"), Permission.of("systemModel", Permission.OP_EDIT, "编辑_模型"), Permission.of("systemModel", Permission.OP_DELETE, "删除_模型") ), "综合体系-专家管理", List.of( Permission.of("systemExpert", Permission.OP_LIST, "查看_专家"), Permission.of("systemExpert", Permission.OP_ADD, "添加_专家"), Permission.of("systemExpert", Permission.OP_EDIT, "编辑_专家"), Permission.of("systemExpert", Permission.OP_DELETE, "删除_专家"), Permission.of("systemExpert", "compareMatrix", "专家_对比矩阵"), Permission.of("systemExpert", "membershipMatrix", "专家_隶属度") ), "设备体系-层级", List.of( Permission.of("deviceHierarchy", Permission.OP_LIST, "查看_层级"), Permission.of("deviceHierarchy", Permission.OP_ADD, "添加_层级"), Permission.of("deviceHierarchy", Permission.OP_EDIT, "编辑_层级"), Permission.of("deviceHierarchy", Permission.OP_DELETE, "删除_层级") ), "设备体系-问题管理", List.of( Permission.of("deviceProblem", Permission.OP_LIST, "查看_内容"), Permission.of("deviceProblem", Permission.OP_ADD, "添加_内容"), Permission.of("deviceProblem", Permission.OP_EDIT, "编辑_内容"), Permission.of("deviceProblem", Permission.OP_DELETE, "删除_内容") ), "设备体系-模型管理", List.of( Permission.of("deviceModel", Permission.OP_LIST, "查看_模型"), Permission.of("deviceModel", Permission.OP_ADD, "添加_模型"), Permission.of("deviceModel", Permission.OP_EDIT, "编辑_模型"), Permission.of("deviceModel", Permission.OP_DELETE, "删除_模型") ), "设备体系-专家管理", List.of( Permission.of("deviceExpert", Permission.OP_LIST, "查看_专家"), Permission.of("deviceExpert", Permission.OP_ADD, "添加_专家"), Permission.of("deviceExpert", Permission.OP_EDIT, "编辑_专家"), Permission.of("deviceExpert", Permission.OP_DELETE, "删除_专家"), Permission.of("deviceExpert", "compareMatrix", "专家_对比矩阵"), Permission.of("deviceExpert", "membershipMatrix", "专家_隶属度") ), "实测实量体系-层级", List.of( Permission.of("measureHierarchy", Permission.OP_LIST, "查看_层级"), Permission.of("measureHierarchy", Permission.OP_ADD, "添加_层级"), Permission.of("measureHierarchy", Permission.OP_EDIT, "编辑_层级"), Permission.of("measureHierarchy", Permission.OP_DELETE, "删除_层级") ), "实测实量体系-规则管理", List.of( Permission.of("measureRule", Permission.OP_LIST, "查看_规则"), Permission.of("measureRule", Permission.OP_ADD, "添加_规则"), Permission.of("measureRule", Permission.OP_EDIT, "编辑_规则"), Permission.of("measureRule", Permission.OP_DELETE, "删除_规则") ), "实测实量体系-模型管理", List.of( Permission.of("measureModel", Permission.OP_LIST, "查看_模型"), Permission.of("measureModel", Permission.OP_ADD, "添加_模型"), Permission.of("measureModel", Permission.OP_EDIT, "编辑_模型"), Permission.of("measureModel", Permission.OP_DELETE, "删除_模型") ), "岗位设置", List.of( Permission.of("position", Permission.OP_ADD, "新增_岗位"), Permission.of("position", Permission.OP_EDIT, "编辑_岗位"), Permission.of("position", Permission.OP_DELETE, "删除_岗位") ) ), "生产计划", mapN( "计划管理", List.of( Permission.of("plan", Permission.OP_LIST, "查看_计划"), Permission.of("plan", Permission.OP_ADD, "添加_计划"), Permission.of("plan", Permission.OP_EDIT, "编辑_计划"), Permission.of("plan", Permission.OP_DELETE, "删除_计划") ) ), "业务数据", mapN( "正确做法", List.of( Permission.of("warningRecord", Permission.OP_LIST, "查看_正确做法"), Permission.of("warningRecord", Permission.OP_ADD, "添加_正确做法"), Permission.of("warningRecord", Permission.OP_EDIT, "编辑_正确做法"), Permission.of("warningRecord", Permission.OP_DELETE, "删除_正确做法") ), "综合问题", List.of( Permission.of("errorRecord", Permission.OP_LIST, "查看_综合问题"), Permission.of("errorRecord", Permission.OP_ADD, "添加_综合问题"), Permission.of("errorRecord", Permission.OP_EDIT, "编辑_综合问题"), Permission.of("errorRecord", Permission.OP_DELETE, "删除_综合问题") ), "设备问题", List.of( Permission.of("deviceRecord", Permission.OP_LIST, "查看_设备问题"), Permission.of("deviceRecord", Permission.OP_ADD, "添加_设备问题"), Permission.of("deviceRecord", Permission.OP_EDIT, "编辑_设备问题"), Permission.of("deviceRecord", Permission.OP_DELETE, "删除_设备问题") ), "在岗情况", List.of( Permission.of("duty", Permission.OP_LIST, "详情_在岗") ), "检查情况", List.of( Permission.of("check", Permission.OP_LIST, "详情_检查") ) ), "报告管理", mapN( "模版清单", List.of( Permission.of("reportTemplate", Permission.OP_LIST, "查看_模版"), Permission.of("reportTemplate", Permission.OP_ADD, "添加_模版"), Permission.of("reportTemplate", Permission.OP_EDIT, "编辑_模版"), Permission.of("reportTemplate", Permission.OP_DELETE, "删除_模版"), Permission.of("reportTemplate", "style", "样式_模版") ) ), "档案管理", mapN( "档案管理", List.of( Permission.of("archive", Permission.OP_LIST, "查看_档案"), Permission.of("archive", Permission.OP_ADD, "添加_档案"), Permission.of("archive", Permission.OP_EDIT, "编辑_档案"), Permission.of("archive", Permission.OP_DELETE, "删除_档案") ) ), "项目评价", mapN( "模糊评价", List.of( Permission.of("fuzzyEvaluation", Permission.OP_LIST, "查看_模糊评价"), Permission.of("fuzzyEvaluation", "calcDetail", "计算详情"), Permission.of("fuzzyEvaluation", "report", "报告生成") ), "打分评价", List.of( Permission.of("scoreEvaluation", Permission.OP_LIST, "查看_打分评价"), Permission.of("scoreEvaluation", "calcDetail", "计算详情"), Permission.of("scoreEvaluation", "report", "报告生成") ) ) ); public static LinkedHashMap mapN(Object... input){ LinkedHashMap map = new LinkedHashMap(); for (int i = 0; i < input.length; i+=2) { map.put(input[i], input[i+1]); } return map; } public static List allPermissions() { var allModules = Data.keySet(); return allModules.stream() .flatMap(module -> getPermissions(module).stream()) .toList(); } public static List getPermissions(String module) { return (Data.get(module)).values().stream() .flatMap(List::stream) .toList(); } public static List getPermissions(String... modules){ return List.of(modules).stream() .flatMap(module -> getPermissions(module).stream()) .toList(); } }