This commit is contained in:
2026-08-08 12:16:01 +08:00
parent 08f71cf17e
commit d30e975eed
3 changed files with 191 additions and 2 deletions
@@ -868,6 +868,23 @@ DELIMITER $$
CREATE PROCEDURE relocate_legacy_inbound_loading_permissions()
BEGIN
DECLARE legacy_count INT DEFAULT 0;
IF EXISTS (
SELECT 1 FROM iam_permission
WHERE id IN (5102091, 5102092, 5102093, 5102094, 5102096, 5102097, 5102098, 5102099)
AND permission_code NOT IN (
'platform:firstleg:container:view', 'platform:firstleg:container:create',
'platform:firstleg:container:edit', 'platform:firstleg:smart-loading:list',
'platform:firstleg:smart-loading:create', 'platform:firstleg:smart-loading:assign',
'platform:firstleg:smart-loading:delete', 'platform:firstleg:smart-loading:push',
'firstleg:inbound:split', 'firstleg:inbound:preload', 'firstleg:inbound:preload-view',
'platform:firstleg:inbound:loading:edit', 'platform:firstleg:inbound:loading:view',
'platform:firstleg:inbound:loading:complete', 'platform:firstleg:inbound:delivery:complete',
'platform:firstleg:inbound:picking:edit', 'platform:firstleg:inbound:picking:view'
)
) THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = '三期权限迁移失败:5102091-5102099 存在未知权限占用';
END IF;
SELECT COUNT(*) INTO legacy_count
FROM iam_permission
WHERE tenant_id = 0 AND app_code = 'PLATFORM'