chore(sql): add pl:plan-archive:price menu and backfill roles
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
27c1cbba15
commit
7fbfcffd43
2 files changed
+75
No files matched your search
@@ -0,0 +1,74 @@
|
||||
-- 运输计划归档:查看单价金额按钮权限
|
||||
-- 设计: docs/superpowers/specs/2026-09-03-pl-plan-archive-price-permission-design.md
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT INTO `sys_menu` (
|
||||
`id`, `menu_name`, `parent_id`, `menu_type`, `path`, `component`, `perms`,
|
||||
`is_frame`, `visible`, `status`, `tenant_no`, `order_num`, `remark`,
|
||||
`create_by`, `create_dept_id`, `create_time`, `update_by`, `update_time`, `del_flag`
|
||||
)
|
||||
SELECT
|
||||
'PL_PLAN_ARCHIVE_PRICE', '查看单价金额', 'PL_PLAN_ARCHIVE', 'F', '', '',
|
||||
'pl:plan-archive:price', 1, '1', '1', 'shanxia2.0', 4, NULL,
|
||||
'system', '', NOW(), NULL, NOW(), 0
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM `sys_menu` WHERE `id` = 'PL_PLAN_ARCHIVE_PRICE' AND `del_flag` = 0
|
||||
);
|
||||
|
||||
-- 已拥有归档页(父菜单)的角色:补 price
|
||||
INSERT INTO `sys_role_menu` (
|
||||
`id`, `role_id`, `menu_id`, `tenant_no`, `order_num`, `remark`,
|
||||
`create_by`, `create_dept_id`, `create_time`, `update_by`, `update_time`, `del_flag`
|
||||
)
|
||||
SELECT
|
||||
REPLACE(UUID(), '-', ''),
|
||||
rm.role_id,
|
||||
'PL_PLAN_ARCHIVE_PRICE',
|
||||
rm.tenant_no,
|
||||
0,
|
||||
NULL,
|
||||
'system',
|
||||
'',
|
||||
NOW(),
|
||||
NULL,
|
||||
NOW(),
|
||||
0
|
||||
FROM `sys_role_menu` rm
|
||||
WHERE rm.menu_id = 'PL_PLAN_ARCHIVE'
|
||||
AND rm.del_flag = 0
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_menu` x
|
||||
WHERE x.role_id = rm.role_id
|
||||
AND x.menu_id = 'PL_PLAN_ARCHIVE_PRICE'
|
||||
AND x.del_flag = 0
|
||||
);
|
||||
|
||||
-- 已拥有「归档」按钮的角色:补 price(防止仅有按钮无父菜单行时漏补)
|
||||
INSERT INTO `sys_role_menu` (
|
||||
`id`, `role_id`, `menu_id`, `tenant_no`, `order_num`, `remark`,
|
||||
`create_by`, `create_dept_id`, `create_time`, `update_by`, `update_time`, `del_flag`
|
||||
)
|
||||
SELECT
|
||||
REPLACE(UUID(), '-', ''),
|
||||
rm.role_id,
|
||||
'PL_PLAN_ARCHIVE_PRICE',
|
||||
rm.tenant_no,
|
||||
0,
|
||||
NULL,
|
||||
'system',
|
||||
'',
|
||||
NOW(),
|
||||
NULL,
|
||||
NOW(),
|
||||
0
|
||||
FROM `sys_role_menu` rm
|
||||
WHERE rm.menu_id = 'PL_PLAN_ARCHIVE_A'
|
||||
AND rm.del_flag = 0
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM `sys_role_menu` x
|
||||
WHERE x.role_id = rm.role_id
|
||||
AND x.menu_id = 'PL_PLAN_ARCHIVE_PRICE'
|
||||
AND x.del_flag = 0
|
||||
);
|
||||
@@ -33746,6 +33746,7 @@ INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `menu_type`, `path`, `co
|
||||
INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `menu_type`, `path`, `component`, `perms`, `is_frame`, `visible`, `status`, `tenant_no`, `order_num`, `remark`, `create_by`, `create_dept_id`, `create_time`, `update_by`, `update_time`, `del_flag`) VALUES ('PL_PLAN_ARCHIVE_A', '归档', 'PL_PLAN_ARCHIVE', 'F', '', '', 'pl:plan-archive:archive', 1, '1', '1', 'shanxia2.0', 3, NULL, 'system', '', '2026-06-25 06:14:17', NULL, '2026-06-25 06:14:17', 0);
|
||||
INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `menu_type`, `path`, `component`, `perms`, `is_frame`, `visible`, `status`, `tenant_no`, `order_num`, `remark`, `create_by`, `create_dept_id`, `create_time`, `update_by`, `update_time`, `del_flag`) VALUES ('PL_PLAN_ARCHIVE_E', '编辑', 'PL_PLAN_ARCHIVE', 'F', '', '', 'pl:plan-archive:edit', 1, '1', '1', 'shanxia2.0', 2, NULL, 'system', '', '2026-06-25 06:14:17', NULL, '2026-06-25 06:14:17', 0);
|
||||
INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `menu_type`, `path`, `component`, `perms`, `is_frame`, `visible`, `status`, `tenant_no`, `order_num`, `remark`, `create_by`, `create_dept_id`, `create_time`, `update_by`, `update_time`, `del_flag`) VALUES ('PL_PLAN_ARCHIVE_Q', '查询', 'PL_PLAN_ARCHIVE', 'F', '', '', 'pl:plan-archive:query', 1, '1', '1', 'shanxia2.0', 1, NULL, 'system', '', '2026-06-25 06:14:17', NULL, '2026-06-25 06:14:17', 0);
|
||||
INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `menu_type`, `path`, `component`, `perms`, `is_frame`, `visible`, `status`, `tenant_no`, `order_num`, `remark`, `create_by`, `create_dept_id`, `create_time`, `update_by`, `update_time`, `del_flag`) VALUES ('PL_PLAN_ARCHIVE_PRICE', '查看单价金额', 'PL_PLAN_ARCHIVE', 'F', '', '', 'pl:plan-archive:price', 1, '1', '1', 'shanxia2.0', 4, NULL, 'system', '', '2026-06-25 06:14:17', NULL, '2026-06-25 06:14:17', 0);
|
||||
INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `menu_type`, `path`, `component`, `perms`, `is_frame`, `visible`, `status`, `tenant_no`, `order_num`, `remark`, `create_by`, `create_dept_id`, `create_time`, `update_by`, `update_time`, `del_flag`) VALUES ('PL_PLAN_CERT', '危化品证上传', 'PL_GROUP_CERT', 'C', 'plan-cert', 'pl/plan-cert/index', 'pl:plan-cert:list', 1, '1', '1', 'shanxia2.0', 1, '危化品购买证/合法使用证明上传', 'system', '', '2026-06-20 18:18:10', 'system', '2026-07-31 03:46:16', 0);
|
||||
INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `menu_type`, `path`, `component`, `perms`, `is_frame`, `visible`, `status`, `tenant_no`, `order_num`, `remark`, `create_by`, `create_dept_id`, `create_time`, `update_by`, `update_time`, `del_flag`) VALUES ('PL_PLAN_CONTRACT', '运输计划合同完善', 'PL_GROUP_PLAN', 'C', 'plan-contract', 'pl/plan-contract/index', 'pl:plan-contract:list', 1, '1', '1', 'shanxia2.0', 3, '缺合同运输计划补齐', 'system', '', '2026-08-20 22:19:26', NULL, '2026-08-20 22:19:26', 0);
|
||||
INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `menu_type`, `path`, `component`, `perms`, `is_frame`, `visible`, `status`, `tenant_no`, `order_num`, `remark`, `create_by`, `create_dept_id`, `create_time`, `update_by`, `update_time`, `del_flag`) VALUES ('PL_PLAN_CONTRACT_UPD', '保存合同关联', 'PL_PLAN_CONTRACT', 'F', '', NULL, 'pl:plan-contract:update', 1, '1', '1', 'shanxia2.0', 1, NULL, 'system', '', '2026-08-20 22:19:26', NULL, '2026-08-20 22:19:26', 0);
|
||||
|
||||
Reference in new issue
Block a user