This commit is contained in:
2026-08-19 09:42:07 +08:00
parent ff1d330c2d
commit b5864bfcda
56 changed files with 497 additions and 306 deletions
@@ -3,6 +3,14 @@
USE baiyue_iam;
SET NAMES utf8mb4;
DELETE rp FROM iam_role_permission rp
JOIN iam_permission p ON p.id=rp.permission_id AND p.tenant_id=rp.tenant_id
WHERE p.tenant_id=0 AND p.app_code='PLATFORM'
AND p.permission_code IN ('platform:finance:fee-source:settlement','platform:finance:bill:create','platform:finance:bill:issue');
DELETE FROM iam_permission
WHERE tenant_id=0 AND app_code='PLATFORM'
AND permission_code IN ('platform:finance:fee-source:settlement','platform:finance:bill:create','platform:finance:bill:issue');
DROP PROCEDURE IF EXISTS migrate_finance_g1_g2_permissions;
DELIMITER $$
CREATE PROCEDURE migrate_finance_g1_g2_permissions()
@@ -12,10 +20,10 @@ BEGIN
FROM iam_permission
WHERE (id = 5105000 AND permission_code <> 'platform:finance')
OR (id = 5105024 AND permission_code <> 'platform:finance:fee-source:review')
OR (id = 5105025 AND permission_code <> 'platform:finance:fee-source:settlement')
OR (id = 5105025 AND permission_code <> 'platform:finance:fee-source:edit')
OR (permission_code = 'platform:finance' AND id <> 5105000)
OR (permission_code = 'platform:finance:fee-source:review' AND id <> 5105024)
OR (permission_code = 'platform:finance:fee-source:settlement' AND id <> 5105025)
OR (permission_code = 'platform:finance:fee-source:edit' AND id <> 5105025)
OR (id IN (5105000, 5105024, 5105025)
AND (tenant_id <> 0 OR app_code <> 'PLATFORM'))
) THEN
@@ -31,8 +39,8 @@ BEGIN
'财务管理', '/finance', NULL, 60, 'ACTIVE', 1, 0),
(5105024, 0, 'PLATFORM', 'BUTTON', 5105000, 'platform:finance:fee-source:review',
'审核财务费用来源', NULL, 'POST', 150, 'ACTIVE', 1, 0),
(5105025, 0, 'PLATFORM', 'BUTTON', 5105000, 'platform:finance:fee-source:settlement',
'设置费用来源参与结算', NULL, 'PUT', 160, 'ACTIVE', 1, 0)
(5105025, 0, 'PLATFORM', 'BUTTON', 5105000, 'platform:finance:fee-source:edit',
'编辑财务费用来源', NULL, 'PUT', 160, 'ACTIVE', 1, 0)
ON DUPLICATE KEY UPDATE
permission_type = VALUES(permission_type), parent_id = VALUES(parent_id),
permission_name = VALUES(permission_name), route_path = VALUES(route_path),
@@ -55,7 +63,7 @@ BEGIN
AND deleted = 0
AND permission_code IN (
'platform:finance:fee-source:review',
'platform:finance:fee-source:settlement')) <> 2 THEN
'platform:finance:fee-source:edit')) <> 2 THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'finance G1/G2 permission catalog is incomplete';
END IF;