fix firstleg deployment contract failures

This commit is contained in:
2026-08-13 12:54:34 +08:00
parent 756a6b13eb
commit e5fda0899e
7 changed files with 68 additions and 74 deletions
@@ -212,7 +212,7 @@ BEGIN
WHERE (id BETWEEN 5102140 AND 5102149
AND permission_code <> CASE id
WHEN 5102140 THEN 'platform:firstleg:ocean-booking:list'
WHEN 5102141 THEN 'platform:firstleg:ocean-booking:view'
WHEN 5102141 THEN 'platform:firstleg:ocean-booking:list'
WHEN 5102142 THEN 'platform:firstleg:ocean-booking:create'
WHEN 5102143 THEN 'platform:firstleg:ocean-booking:edit'
WHEN 5102144 THEN 'platform:firstleg:ocean-booking:submit'
@@ -238,7 +238,6 @@ INSERT INTO iam_permission
route_path,http_method,sort_no,status,built_in,deleted)
VALUES
(5102140,0,'PLATFORM','MENU',5102000,'platform:firstleg:ocean-booking:list','订舱管理','/first-leg/ocean-bookings','GET',80,'ACTIVE',1,0),
(5102141,0,'PLATFORM','BUTTON',5102140,'platform:firstleg:ocean-booking:view','查看订舱',NULL,'GET',10,'ACTIVE',1,0),
(5102142,0,'PLATFORM','BUTTON',5102140,'platform:firstleg:ocean-booking:create','创建订舱',NULL,'POST',20,'ACTIVE',1,0),
(5102143,0,'PLATFORM','BUTTON',5102140,'platform:firstleg:ocean-booking:edit','编辑订舱',NULL,'PUT',30,'ACTIVE',1,0),
(5102144,0,'PLATFORM','BUTTON',5102140,'platform:firstleg:ocean-booking:submit','提交订舱',NULL,'POST',40,'ACTIVE',1,0),
@@ -257,7 +256,7 @@ SELECT role.id,permission.id,0 FROM iam_role role JOIN iam_permission permission
WHERE role.tenant_id=0 AND role.role_code IN ('PLATFORM_ADMIN','ORDER_OPERATOR');
DELETE rp FROM iam_role_permission rp JOIN iam_permission p ON p.tenant_id=rp.tenant_id AND p.id=rp.permission_id
WHERE p.permission_code='platform:firstleg:ocean-booking:view';
UPDATE iam_permission SET status='INACTIVE',deleted=1 WHERE permission_code='platform:firstleg:ocean-booking:view';
WHERE p.id=5102141;
UPDATE iam_permission SET status='INACTIVE',deleted=1 WHERE id=5102141;
USE baiyue_firstleg;
@@ -103,7 +103,7 @@ BEGIN
WHERE (id BETWEEN 5102150 AND 5102154
AND permission_code <> CASE id
WHEN 5102150 THEN 'platform:firstleg:truck-appointment:list'
WHEN 5102151 THEN 'platform:firstleg:truck-appointment:view'
WHEN 5102151 THEN 'platform:firstleg:truck-appointment:list'
WHEN 5102152 THEN 'platform:firstleg:truck-appointment:create'
WHEN 5102153 THEN 'platform:firstleg:truck-appointment:edit'
WHEN 5102154 THEN 'platform:firstleg:truck-appointment:operate'
@@ -124,7 +124,6 @@ INSERT INTO iam_permission
route_path,http_method,sort_no,status,built_in,deleted)
VALUES
(5102150,0,'PLATFORM','MENU',5102000,'platform:firstleg:truck-appointment:list','拖车预约','/first-leg/truck-appointments','GET',90,'ACTIVE',1,0),
(5102151,0,'PLATFORM','BUTTON',5102150,'platform:firstleg:truck-appointment:view','查看拖车预约',NULL,'GET',10,'ACTIVE',1,0),
(5102152,0,'PLATFORM','BUTTON',5102150,'platform:firstleg:truck-appointment:create','创建拖车预约',NULL,'POST',20,'ACTIVE',1,0),
(5102153,0,'PLATFORM','BUTTON',5102150,'platform:firstleg:truck-appointment:edit','编辑拖车预约',NULL,'PUT',30,'ACTIVE',1,0),
(5102154,0,'PLATFORM','BUTTON',5102150,'platform:firstleg:truck-appointment:operate','操作拖车预约',NULL,'POST',40,'ACTIVE',1,0)
@@ -139,7 +138,7 @@ SELECT role.id,permission.id,0 FROM iam_role role JOIN iam_permission permission
WHERE role.tenant_id=0 AND role.role_code IN ('PLATFORM_ADMIN','ORDER_OPERATOR');
DELETE rp FROM iam_role_permission rp JOIN iam_permission p ON p.tenant_id=rp.tenant_id AND p.id=rp.permission_id
WHERE p.permission_code='platform:firstleg:truck-appointment:view';
UPDATE iam_permission SET status='INACTIVE',deleted=1 WHERE permission_code='platform:firstleg:truck-appointment:view';
WHERE p.id=5102151;
UPDATE iam_permission SET status='INACTIVE',deleted=1 WHERE id=5102151;
USE baiyue_firstleg;
@@ -40,7 +40,6 @@ class OceanBookingSqlContractTest {
void declaresDedicatedPlatformPermissions() throws Exception {
assertThat(sql())
.contains("platform:firstleg:ocean-booking:list")
.contains("platform:firstleg:ocean-booking:view")
.contains("platform:firstleg:ocean-booking:create")
.contains("platform:firstleg:ocean-booking:edit")
.contains("platform:firstleg:ocean-booking:submit")
@@ -48,7 +47,8 @@ class OceanBookingSqlContractTest {
.contains("platform:firstleg:ocean-booking:release")
.contains("platform:firstleg:ocean-booking:cancel")
.contains("platform:firstleg:ocean-booking:change")
.contains("platform:firstleg:ocean-booking:allocate");
.contains("platform:firstleg:ocean-booking:allocate")
.doesNotContain("platform:firstleg:ocean-booking:view");
}
private static String sql() throws Exception {
@@ -24,7 +24,6 @@ class Phase3BookingTruckPermissionSqlContractTest {
private static final Set<String> OCEAN_PERMISSIONS = Set.of(
"platform:firstleg:ocean-booking:list",
"platform:firstleg:ocean-booking:view",
"platform:firstleg:ocean-booking:create",
"platform:firstleg:ocean-booking:edit",
"platform:firstleg:ocean-booking:submit",
@@ -36,7 +35,6 @@ class Phase3BookingTruckPermissionSqlContractTest {
private static final Set<String> TRUCK_PERMISSIONS = Set.of(
"platform:firstleg:truck-appointment:list",
"platform:firstleg:truck-appointment:view",
"platform:firstleg:truck-appointment:create",
"platform:firstleg:truck-appointment:edit",
"platform:firstleg:truck-appointment:operate");