Browse Source

整理数据结构

master
庄锐波 5 months ago
parent
commit
470699d494
  1. 1
      ruoyi-modules/pom.xml
  2. 9
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysMenuController.java
  3. 18
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysMenuMapper.java
  4. 9
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysMenuService.java
  5. 25
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysMenuServiceImpl.java
  6. 20
      ruoyi-modules/zdxt-enforcement-code/pom.xml
  7. 24
      script/sql/zfjd-refactoring-v1/005-重新生成菜单.sql
  8. 2010
      script/sql/zfjd-refactoring-v1/表关系图/EnforcementCode.drawio
  9. 8
      zdxt-web-client/zdxt-admin-plus-ui/package.json
  10. 2
      zdxt-web-client/zdxt-admin-plus-ui/src/api/menu.ts
  11. 2
      zdxt-web-server/zdxt-admin-web-server/src/main/resources/application-dev.yml

1
ruoyi-modules/pom.xml

@ -13,6 +13,7 @@
<module>ruoyi-demo</module>
<module>ruoyi-generator</module>
<module>ruoyi-system</module>
<module>zdxt-enforcement-code</module>
</modules>
<artifactId>ruoyi-modules</artifactId>

9
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/system/SysMenuController.java

@ -49,6 +49,15 @@ public class SysMenuController extends BaseController {
return R.ok(menuService.buildMenus(menus));
}
@GetMapping("/getRoutersBySystemCode")
public R<List<RouterVo>> getRoutersBySystemCode(String systemCode) {
if(StringUtils.isEmpty(systemCode)){
systemCode="authService";
}
List<SysMenu> menus = menuService.selectMenuTreeByUserId(LoginHelper.getUserId(), systemCode);
return R.ok(menuService.buildMenus(menus));
}
/**
* 获取菜单列表
*/

18
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysMenuMapper.java

@ -112,7 +112,7 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu, SysMenuVo> {
}
/**
* 根据用户ID查询菜单
* 查询所有菜单管理员
*
* @return 菜单列表
*/
@ -125,6 +125,22 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu, SysMenuVo> {
return this.selectList(lqw);
}
/**
* 根据系统编码查询菜单树管理员
*
* @param systemCode 系统编码为空时不过滤
* @return 菜单列表
*/
default List<SysMenu> selectMenuTreeAll(String systemCode) {
LambdaQueryWrapper<SysMenu> lqw = new LambdaQueryWrapper<SysMenu>()
.in(SysMenu::getMenuType, SystemConstants.TYPE_DIR, SystemConstants.TYPE_MENU)
.eq(SysMenu::getStatus, SystemConstants.NORMAL)
.eq(StringUtils.isNotBlank(systemCode), SysMenu::getSystemCode, systemCode)
.orderByAsc(SysMenu::getParentId)
.orderByAsc(SysMenu::getOrderNum);
return this.selectList(lqw);
}
/**
* 根据角色ID查询菜单树信息
*

9
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysMenuService.java

@ -57,6 +57,15 @@ public interface ISysMenuService {
*/
List<SysMenu> selectMenuTreeByUserId(Long userId);
/**
* 根据用户ID和系统编码查询菜单树信息
*
* @param userId 用户ID
* @param systemCode 系统编码
* @return 菜单列表
*/
List<SysMenu> selectMenuTreeByUserId(Long userId, String systemCode);
/**
* 根据角色ID查询菜单树信息
*

25
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysMenuServiceImpl.java

@ -133,6 +133,31 @@ public class SysMenuServiceImpl implements ISysMenuService {
return getChildPerms(menus, Constants.TOP_PARENT_ID);
}
/**
* 根据用户ID和系统编码查询菜单树
*
* @param userId 用户ID
* @param systemCode 系统编码
* @return 菜单列表
*/
@Override
public List<SysMenu> selectMenuTreeByUserId(Long userId, String systemCode) {
List<SysMenu> menus;
if (LoginHelper.isSuperAdmin(userId)) {
menus = baseMapper.selectMenuTreeAll(systemCode);
} else {
LambdaQueryWrapper<SysMenu> wrapper = new LambdaQueryWrapper<>();
menus = baseMapper.selectList(
wrapper.in(SysMenu::getMenuType, SystemConstants.TYPE_DIR, SystemConstants.TYPE_MENU)
.eq(SysMenu::getStatus, SystemConstants.NORMAL)
.eq(StringUtils.isNotBlank(systemCode), SysMenu::getSystemCode, systemCode)
.inSql(SysMenu::getMenuId, baseMapper.buildMenuByUserSql(userId))
.orderByAsc(SysMenu::getParentId)
.orderByAsc(SysMenu::getOrderNum));
}
return getChildPerms(menus, Constants.TOP_PARENT_ID);
}
/**
* 根据角色ID查询菜单树信息
*

20
ruoyi-modules/zdxt-enforcement-code/pom.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-modules</artifactId>
<version>5.6.0</version>
</parent>
<artifactId>zdxt-enforcement-code</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

24
script/sql/zfjd-refactoring-v1/005-重新生成菜单.sql

@ -128,3 +128,27 @@ UPDATE sys_menu SET menu_name = '菜单管理', parent_id = 1, order_num = 3, pa
UPDATE sys_menu SET menu_name = '字典管理', parent_id = 1, order_num = 6, path = 'dict', component = 'system/dict/index-manager', query_param = '', is_frame = 1, is_cache = 0, url = '#', target = '', menu_type = 'C', visible = '0', status = '0', perms = 'system:dict:list', icon = 'dict', create_dept = '103', create_by = 1, create_time = '2026-03-31 20:14:46', update_by = null, update_time = null, remark = '字典管理菜单', system_code = 'authService', type = null WHERE menu_id = 105;
UPDATE sys_menu SET menu_name = '角色管理', parent_id = 1, order_num = 2, path = 'role', component = 'system/role/index-dept-separate', query_param = '', is_frame = 1, is_cache = 0, url = '#', target = '', menu_type = 'C', visible = '0', status = '0', perms = 'system:role:list', icon = 'peoples', create_dept = '103', create_by = 1, create_time = '2026-03-31 20:14:46', update_by = null, update_time = null, remark = '角色管理菜单', system_code = 'authService', type = null WHERE menu_id = 101;
UPDATE sys_menu SET menu_name = '任务调度中心', parent_id = 2, order_num = 6, path = 'quartz', component = 'system/quartz/index', query_param = '', is_frame = 1, is_cache = 0, url = '#', target = '', menu_type = 'C', visible = '0', status = '0', perms = 'monitor:snailjob:list', icon = 'job', create_dept = '103', create_by = 1, create_time = '2026-03-31 20:14:46', update_by = null, update_time = null, remark = 'SnailJob控制台菜单', system_code = 'authService', type = null WHERE menu_id = 120;
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5235, '分析管理', 5247, 4, '', null, null, 1, 0, '/statistical/analysis', 'menuItem', 'C', '1', '0', '', '', null, 0, '2024-04-07 10:47:09', 0, '2025-02-12 11:30:47', '', 'supervisionCode', '0');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5236, '统计管理', 5247, 3, '', null, null, 1, 0, '/statistical/view', 'menuItem', 'C', '1', '0', '', '', null, 0, '2024-04-07 10:48:29', 0, '2025-02-12 11:30:40', '', 'supervisionCode', '0');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5247, '统计查询', 0, 5, '', null, null, 1, 0, '#', 'menuItem', 'M', '0', '0', '', 'fa fa-bar-chart', null, 0, '2024-07-03 10:58:44', 0, '2025-09-05 17:49:22', '', 'supervisionCode', '0');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5249, '涉企执法情况', 5262, 1, '', null, null, 1, 0, '/code/registration', 'menuItem', 'C', '0', '0', 'code:registration:view', '', null, 0, '2024-03-26 22:10:36', 0, '2025-08-25 19:27:55', '', 'supervisionCode', '3');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5250, '执法单位情况', 5262, 4, '', null, null, 1, 0, '/code/deptStatic', 'menuItem', 'C', '0', '0', 'code:deptStatic:view', '', null, 0, '2024-03-26 22:10:36', 0, '2025-06-12 14:34:05', '', 'supervisionCode', '3');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5251, '执法投诉情况', 5262, 5, '', null, null, 1, 0, '/code/complaintStatic', 'menuItem', 'C', '0', '0', 'code:complaintStatic:view', '', null, 0, '2024-03-26 22:10:36', 0, '2025-05-22 19:39:25', '', 'supervisionCode', '3');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5252, '执法预警统计', 5262, 0, '', null, null, 1, 0, '/code/statisticsWarning', 'menuItem', 'C', '1', '0', 'code:statisticsWarning:view', '', null, 0, '2024-03-26 22:10:36', 0, '2024-12-09 14:20:39', '', 'supervisionCode', '0');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5253, '企业信息情况', 5262, 3, '', null, null, 1, 0, '/code/statisticsEnterprise', 'menuItem', 'M', '0', '0', 'code:statisticsEnterprise:view', '', null, 0, '2024-03-26 22:10:36', 0, '2025-05-22 19:41:25', '', 'supervisionCode', '3');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5254, '检查计划情况', 5262, 6, '', null, null, 1, 0, '/code/enforcementInspectionProgram/staticProgramView', 'menuItem', 'C', '0', '0', 'code:registration:view', '', null, 0, '2024-03-26 22:10:36', 0, '2025-08-25 19:28:27', '', 'supervisionCode', '3');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5255, '执法分析', 5269, 0, '', null, null, 1, 0, '/code/registration/staticRegistrationView', 'menuItem', 'C', '0', '0', 'code:registration:view', '', null, 0, '2024-03-26 22:10:36', 0, '2025-02-14 10:23:26', '', 'supervisionCode', '0');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5258, '全市', 5261, 1, '', null, null, 1, 0, '/code/enforcementInspectionProgram/statisticalPanel', 'menuItem', 'C', '1', '0', '', '', null, 0, '2024-11-03 18:20:24', 0, '2025-06-05 14:42:07', '', 'supervisionCode', '0');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5261, '综合分析', 5247, 1, '', null, null, 1, 0, '#', 'menuItem', 'M', '1', '0', '', '', null, 0, '2024-12-05 15:46:01', 0, '2025-06-26 18:36:48', '', 'supervisionCode', '0');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5262, '行政执法', 5247, 0, '', null, null, 1, 0, '#', 'menuItem', 'M', '0', '0', '', '', null, 0, '2024-12-05 15:48:09', 0, '2025-09-05 17:51:58', '', 'supervisionCode', '3');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5264, '统计', 5250, 0, '', null, null, 1, 0, '#', 'menuItem', 'F', '0', '0', 'code:deptStatic:list', '#', null, 0, '2025-01-02 15:05:32', 0, null, '', 'supervisionCode', '0,0');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5265, '统计', 5251, 0, '', null, null, 1, 0, '#', 'menuItem', 'F', '0', '0', 'code:complaintStatic:list', '#', null, 0, '2025-01-02 16:22:42', 0, null, '', 'supervisionCode', '0,0');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5266, '统计', 5253, 0, '', null, null, 1, 0, '#', 'menuItem', 'F', '0', '0', 'code:statisticsEnterprise:list', '#', null, 0, '2025-01-02 16:23:31', 0, null, '', 'supervisionCode', '0,0');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5269, '工作报表', 0, 6, '', null, null, 1, 0, '#', 'menuItem', 'M', '0', '0', '', 'fa fa-television', null, 0, '2025-02-08 10:28:19', 0, '2025-02-14 10:27:35', '', 'supervisionCode', '0');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5270, '列表', 5249, 0, '', null, null, 1, 0, '#', 'menuItem', 'F', '0', '0', 'code:registration:list', '#', null, 0, '2025-03-28 11:48:11', 0, null, '', 'supervisionCode', '0,0');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5278, '企业受检次数', 5262, 2, '', null, null, 1, 0, '/code/LawEnforcementWarningList', 'menuItem', 'C', '0', '0', 'code:LawEnforcementWarningList:view', '', null, 0, '2025-06-03 20:24:48', 0, '2025-06-03 20:39:02', '', 'supervisionCode', '0');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5279, '列表', 5278, 0, '', null, null, 1, 0, '#', 'menuItem', 'F', '0', '0', null, '#', null, 0, '2025-06-03 20:25:36', 0, null, '', 'supervisionCode', '0,0');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5283, '非行政执法', 5284, 0, '', null, null, 1, 0, '/system/registration/getRegistrationView', 'menuItem', 'C', '0', '0', 'system:nonRegistration:view', '', null, 0, '2025-07-31 17:05:57', 0, '2025-09-05 17:54:04', '', 'supervisionCode', '3');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5284, '非行政执法', 5247, 2, '', null, null, 1, 0, '#', 'menuItem', 'C', '0', '0', null, '#', null, 0, '2025-09-05 17:53:18', 0, null, '', 'supervisionCode', '3,0');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (5285, '列表', 5283, 0, '', null, null, 1, 0, '#', 'menuItem', 'F', '0', '0', 'system:nonRegistration:getList', '#', null, 0, '2025-10-16 16:05:00', 0, null, '', 'supervisionCode', '0,0');

2010
script/sql/zfjd-refactoring-v1/表关系图/EnforcementCode.drawio

File diff suppressed because one or more lines are too long

8
zdxt-web-client/zdxt-admin-plus-ui/package.json

@ -8,9 +8,9 @@
"type": "module",
"scripts": {
"zdxt-admin-plus-ui-dev": "vite serve --mode development",
"zdxt-admin-plus-ui-build:prod": "vite build --mode production",
"zdxt-admin-plus-ui-build:dev": "vite build --mode development",
"zdxt-admin-plus-ui-preview": "vite preview",
"zdxt-admin-plus-ui-build:prod": "vite build --mode production --outDir dist/prod",
"zdxt-admin-plus-ui-build:dev": "vite build --mode development --outDir dist/dev",
"zdxt-admin-plus-ui-preview": "vite preview --outDir dist/prod",
"zdxt-admin-plus-ui-lint:eslint": "eslint",
"zdxt-admin-plus-ui-lint:eslint:fix": "eslint --fix",
"zdxt-admin-plus-ui-prettier": "prettier --write ."
@ -26,7 +26,7 @@
"@vueuse/core": "13.9.0",
"animate.css": "4.1.1",
"await-to-js": "3.0.0",
"axios": "1.13.1",
"axios": "1.13.5",
"crypto-js": "4.2.0",
"echarts": "5.6.0",
"element-plus": "2.11.7",

2
zdxt-web-client/zdxt-admin-plus-ui/src/api/menu.ts

@ -5,7 +5,7 @@ import { RouteRecordRaw } from 'vue-router';
// 获取路由
export function getRouters(): AxiosPromise<RouteRecordRaw[]> {
return request({
url: '/system/menu/getRouters',
url: '/system/menu/getRoutersBySystemCode',
method: 'get'
});
}

2
zdxt-web-server/zdxt-admin-web-server/src/main/resources/application-dev.yml

@ -61,7 +61,7 @@ spring:
driverClassName: com.mysql.cj.jdbc.Driver
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
url: jdbc:mysql://localhost:3309/zfjd-refactoring-v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
url: jdbc:mysql://localhost:3309/zfjd-refactoring-v3?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: root
password: root
# # 从库数据源

Loading…
Cancel
Save