母胶计划、终胶计划
This commit is contained in:
92
jeecg-boot/db/mes-xsl-final-batch-plan-menu.sql
Normal file
92
jeecg-boot/db/mes-xsl-final-batch-plan-menu.sql
Normal file
@@ -0,0 +1,92 @@
|
||||
-- 终胶计划菜单与权限(挂到「MES密炼工程」目录)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
SET @mixer_parent_id = (
|
||||
SELECT id
|
||||
FROM sys_permission
|
||||
WHERE name = 'MES密炼工程' AND menu_type = 0 AND del_flag = 0
|
||||
ORDER BY create_time ASC
|
||||
LIMIT 1
|
||||
);
|
||||
SET @mixer_parent_id = IFNULL(@mixer_parent_id, (
|
||||
SELECT id
|
||||
FROM sys_permission
|
||||
WHERE url = '/mes' AND menu_type = 0 AND del_flag = 0
|
||||
ORDER BY create_time ASC
|
||||
LIMIT 1
|
||||
));
|
||||
SET @mixer_parent_id = IFNULL(@mixer_parent_id, '1860000000000000001');
|
||||
|
||||
INSERT INTO sys_permission(
|
||||
id, parent_id, name, url, component, component_name, menu_type, perms, perms_type, sort_no,
|
||||
is_route, is_leaf, hidden, status, del_flag, keep_alive, internal_or_external, create_by, create_time
|
||||
)
|
||||
VALUES (
|
||||
'1860000000000099711', @mixer_parent_id, '终胶计划',
|
||||
'/mes/finalbatchplaninfo',
|
||||
'mes/finalbatchplaninfo/index',
|
||||
'MesXslFinalBatchPlanList', 1, NULL, '1', 35,
|
||||
1, 1, 0, '1', 0, 1, 0, 'admin', NOW()
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
parent_id = VALUES(parent_id),
|
||||
name = VALUES(name),
|
||||
url = VALUES(url),
|
||||
component = VALUES(component),
|
||||
component_name = VALUES(component_name),
|
||||
menu_type = VALUES(menu_type),
|
||||
perms = VALUES(perms),
|
||||
perms_type = VALUES(perms_type),
|
||||
sort_no = VALUES(sort_no),
|
||||
is_route = VALUES(is_route),
|
||||
is_leaf = VALUES(is_leaf),
|
||||
hidden = VALUES(hidden),
|
||||
status = VALUES(status),
|
||||
del_flag = VALUES(del_flag),
|
||||
keep_alive = VALUES(keep_alive),
|
||||
internal_or_external = VALUES(internal_or_external);
|
||||
|
||||
INSERT INTO sys_permission(id, parent_id, name, menu_type, perms, perms_type, status, del_flag, create_by, create_time) VALUES
|
||||
('1860000000000099712', '1860000000000099711', '新增', 2, 'xslmes:mes_xsl_final_batch_plan:add', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099713', '1860000000000099711', '编辑', 2, 'xslmes:mes_xsl_final_batch_plan:edit', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099714', '1860000000000099711', '删除', 2, 'xslmes:mes_xsl_final_batch_plan:delete', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099715', '1860000000000099711', '批量删除', 2, 'xslmes:mes_xsl_final_batch_plan:deleteBatch', '1', '1', 0, 'admin', NOW()),
|
||||
('1860000000000099716', '1860000000000099711', '导出', 2, 'xslmes:mes_xsl_final_batch_plan:exportXls', '1', '1', 0, 'admin', NOW())
|
||||
ON DUPLICATE KEY UPDATE
|
||||
parent_id = VALUES(parent_id),
|
||||
name = VALUES(name),
|
||||
menu_type = VALUES(menu_type),
|
||||
perms = VALUES(perms),
|
||||
perms_type = VALUES(perms_type),
|
||||
status = VALUES(status),
|
||||
del_flag = VALUES(del_flag);
|
||||
|
||||
-- admin 角色授权
|
||||
INSERT INTO sys_role_permission(id, role_id, permission_id, operate_date, operate_ip)
|
||||
SELECT REPLACE(UUID(), '-', ''), 'f6817f48af4fb3af11b9e8bf182f618b', p.id, NOW(), '127.0.0.1'
|
||||
FROM sys_permission p
|
||||
WHERE p.id IN (
|
||||
'1860000000000099711',
|
||||
'1860000000000099712', '1860000000000099713', '1860000000000099714', '1860000000000099715', '1860000000000099716'
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM sys_role_permission rp
|
||||
WHERE rp.role_id = 'f6817f48af4fb3af11b9e8bf182f618b'
|
||||
AND rp.permission_id = p.id
|
||||
);
|
||||
|
||||
-- 强制修复:确保菜单路由与组件路径正确
|
||||
UPDATE sys_permission
|
||||
SET
|
||||
parent_id = @mixer_parent_id,
|
||||
url = '/mes/finalbatchplaninfo',
|
||||
component = 'mes/finalbatchplaninfo/index',
|
||||
component_name = 'MesXslFinalBatchPlanList',
|
||||
menu_type = 1,
|
||||
is_route = 1,
|
||||
is_leaf = 1,
|
||||
hidden = 0,
|
||||
status = '1',
|
||||
del_flag = 0
|
||||
WHERE id = '1860000000000099711';
|
||||
Reference in New Issue
Block a user