优化
This commit is contained in:
@@ -15,7 +15,6 @@ BEGIN
|
||||
OR (id = 5102201 AND permission_code <> 'platform:firstleg:terminal-drayage:document:edit')
|
||||
OR (id = 5102202 AND permission_code <> 'platform:firstleg:terminal-drayage:fleet:edit')
|
||||
OR (id = 5102203 AND permission_code <> 'platform:firstleg:terminal-drayage:pickup-appointment:edit')
|
||||
OR (id = 5102204 AND permission_code <> 'platform:firstleg:terminal-drayage:pickup:confirm')
|
||||
OR (id = 5102205 AND permission_code <> 'platform:firstleg:terminal-drayage:empty-return:confirm')
|
||||
) OR EXISTS (
|
||||
SELECT 1 FROM iam_permission
|
||||
@@ -26,7 +25,6 @@ BEGIN
|
||||
OR (permission_code = 'platform:firstleg:terminal-drayage:document:edit' AND id <> 5102201)
|
||||
OR (permission_code = 'platform:firstleg:terminal-drayage:fleet:edit' AND id <> 5102202)
|
||||
OR (permission_code = 'platform:firstleg:terminal-drayage:pickup-appointment:edit' AND id <> 5102203)
|
||||
OR (permission_code = 'platform:firstleg:terminal-drayage:pickup:confirm' AND id <> 5102204)
|
||||
OR (permission_code = 'platform:firstleg:terminal-drayage:empty-return:confirm' AND id <> 5102205)
|
||||
) THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='货柜双工作台权限初始化失败:权限ID或编码冲突';
|
||||
@@ -50,8 +48,6 @@ BEGIN
|
||||
'维护目的港码头车队',NULL,'POST',20,'ACTIVE',1,0),
|
||||
(5102203,0,'PLATFORM','BUTTON',5102200,'platform:firstleg:terminal-drayage:pickup-appointment:edit',
|
||||
'预约目的港提柜',NULL,'POST',30,'ACTIVE',1,0),
|
||||
(5102204,0,'PLATFORM','BUTTON',5102200,'platform:firstleg:terminal-drayage:pickup:confirm',
|
||||
'确认目的港实际提柜',NULL,'POST',40,'ACTIVE',1,0),
|
||||
(5102205,0,'PLATFORM','BUTTON',5102200,'platform:firstleg:terminal-drayage:empty-return:confirm',
|
||||
'确认目的港实际还柜',NULL,'POST',50,'ACTIVE',1,0)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
@@ -84,7 +80,6 @@ BEGIN
|
||||
'platform:firstleg:terminal-drayage:document:edit',
|
||||
'platform:firstleg:terminal-drayage:fleet:edit',
|
||||
'platform:firstleg:terminal-drayage:pickup-appointment:edit',
|
||||
'platform:firstleg:terminal-drayage:pickup:confirm',
|
||||
'platform:firstleg:terminal-drayage:empty-return:confirm')
|
||||
WHERE role.tenant_id=0 AND role.app_code='PLATFORM'
|
||||
AND role.role_code IN ('PLATFORM_ADMIN','ORDER_OPERATOR')
|
||||
@@ -101,8 +96,7 @@ BEGIN
|
||||
'platform:firstleg:terminal-drayage:document:edit',
|
||||
'platform:firstleg:terminal-drayage:fleet:edit',
|
||||
'platform:firstleg:terminal-drayage:pickup-appointment:edit',
|
||||
'platform:firstleg:terminal-drayage:pickup:confirm',
|
||||
'platform:firstleg:terminal-drayage:empty-return:confirm')) <> 9 THEN
|
||||
'platform:firstleg:terminal-drayage:empty-return:confirm')) <> 8 THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='货柜双工作台权限初始化失败:权限目录不完整';
|
||||
END IF;
|
||||
|
||||
@@ -122,8 +116,7 @@ BEGIN
|
||||
'platform:firstleg:terminal-drayage:document:edit',
|
||||
'platform:firstleg:terminal-drayage:fleet:edit',
|
||||
'platform:firstleg:terminal-drayage:pickup-appointment:edit',
|
||||
'platform:firstleg:terminal-drayage:pickup:confirm',
|
||||
'platform:firstleg:terminal-drayage:empty-return:confirm')) <> 18 THEN
|
||||
'platform:firstleg:terminal-drayage:empty-return:confirm')) <> 16 THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='货柜双工作台权限初始化失败:平台默认角色授权不完整';
|
||||
END IF;
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ paths:
|
||||
get:
|
||||
tags: [IAM Resources / IAM 资源]
|
||||
summary: 查询当前用户有效权限
|
||||
description: 返回当前有效平台成员权限编码;只要求有效 PLATFORM JWT,不依赖 `platform:role:list`。入库单扣货与解除扣货返回独立写权限 `platform:firstleg:inbound:hold`,不会由 `platform:firstleg:inbound:list` 查看权限自动获得。资金账户充值审核与手工调账分别返回 `platform:finance:recharge:review`、`platform:finance:customer-account:adjust`,并与 `platform:finance:customer-account:list` 只读权限分离。海外仓返回 `platform:overseas-warehouse:dispatch:list`、`platform:overseas-warehouse:dispatch:edit`、`platform:overseas-warehouse:dispatch:cancel`、`platform:overseas-warehouse:dispatch:transfer-delivery`、`platform:overseas-warehouse:outbound:list`、`platform:overseas-warehouse:outbound:create`、`platform:overseas-warehouse:outbound:cancel`、`platform:overseas-warehouse:delivery:list`、`platform:overseas-warehouse:delivery:return`、`platform:overseas-warehouse:delivery:status`、`platform:overseas-warehouse:delivery:documents`、`platform:overseas-warehouse:exception-order:list`、`platform:overseas-warehouse:exception-order:create`、`platform:overseas-warehouse:exception-order:process`、`platform:overseas-warehouse:customer-visit:list`、`platform:overseas-warehouse:customer-visit:edit`;海外 PDA 盘点、移库、换标和现场查询统一返回 `lastleg:pda:operate`,且仅限 `OVERSEAS_WAREHOUSE_PDA_OPERATOR`。货柜双工作台以 `platform:firstleg:container:list/create/edit` 维护国内送柜报关,国外清关提柜独立返回 `platform:firstleg:terminal-drayage:list`、`platform:firstleg:terminal-drayage:document:edit`、`platform:firstleg:terminal-drayage:fleet:edit`、`platform:firstleg:terminal-drayage:pickup-appointment:edit`、`platform:firstleg:terminal-drayage:pickup:confirm`、`platform:firstleg:terminal-drayage:empty-return:confirm`,不以 `container:list/edit` 兼容放行国外操作。派送三类资料管理使用独立写权限 `platform:overseas-warehouse:delivery:documents`;读取和下载仍使用 `platform:overseas-warehouse:delivery:list`。列表权限包含详情和只读辅助接口,写操作独立授权。
|
||||
description: 返回当前有效平台成员权限编码;只要求有效 PLATFORM JWT,不依赖 `platform:role:list`。入库单扣货与解除扣货返回独立写权限 `platform:firstleg:inbound:hold`,不会由 `platform:firstleg:inbound:list` 查看权限自动获得。资金账户充值审核与手工调账分别返回 `platform:finance:recharge:review`、`platform:finance:customer-account:adjust`,并与 `platform:finance:customer-account:list` 只读权限分离。海外仓返回 `platform:overseas-warehouse:dispatch:list`、`platform:overseas-warehouse:dispatch:edit`、`platform:overseas-warehouse:dispatch:cancel`、`platform:overseas-warehouse:dispatch:transfer-delivery`、`platform:overseas-warehouse:outbound:list`、`platform:overseas-warehouse:outbound:create`、`platform:overseas-warehouse:outbound:cancel`、`platform:overseas-warehouse:delivery:list`、`platform:overseas-warehouse:delivery:return`、`platform:overseas-warehouse:delivery:status`、`platform:overseas-warehouse:delivery:documents`、`platform:overseas-warehouse:exception-order:list`、`platform:overseas-warehouse:exception-order:create`、`platform:overseas-warehouse:exception-order:process`、`platform:overseas-warehouse:customer-visit:list`、`platform:overseas-warehouse:customer-visit:edit`;海外 PDA 盘点、移库、换标和现场查询统一返回 `lastleg:pda:operate`,且仅限 `OVERSEAS_WAREHOUSE_PDA_OPERATOR`。货柜双工作台以 `platform:firstleg:container:list/create/edit` 维护国内送柜报关,国外清关提柜独立返回 `platform:firstleg:terminal-drayage:list`、`platform:firstleg:terminal-drayage:document:edit`、`platform:firstleg:terminal-drayage:fleet:edit`、`platform:firstleg:terminal-drayage:pickup-appointment:edit`、`platform:firstleg:terminal-drayage:empty-return:confirm`,不以 `container:list/edit` 兼容放行国外操作。派送三类资料管理使用独立写权限 `platform:overseas-warehouse:delivery:documents`;读取和下载仍使用 `platform:overseas-warehouse:delivery:list`。列表权限包含详情和只读辅助接口,写操作独立授权。
|
||||
responses:
|
||||
'200':
|
||||
description: 当前平台成员权限查询成功
|
||||
|
||||
@@ -42,7 +42,6 @@ class IamOpenApiContractTest {
|
||||
.contains("platform:firstleg:terminal-drayage:document:edit")
|
||||
.contains("platform:firstleg:terminal-drayage:fleet:edit")
|
||||
.contains("platform:firstleg:terminal-drayage:pickup-appointment:edit")
|
||||
.contains("platform:firstleg:terminal-drayage:pickup:confirm")
|
||||
.contains("platform:firstleg:terminal-drayage:empty-return:confirm")
|
||||
.contains("不以 `container:list/edit` 兼容放行国外操作")
|
||||
.contains("merchant:warehouse:delivery:list")
|
||||
|
||||
+2
-4
@@ -22,7 +22,6 @@ class ContainerWorkspacePermissionSqlContractTest {
|
||||
"platform:firstleg:terminal-drayage:document:edit",
|
||||
"platform:firstleg:terminal-drayage:fleet:edit",
|
||||
"platform:firstleg:terminal-drayage:pickup-appointment:edit",
|
||||
"platform:firstleg:terminal-drayage:pickup:confirm",
|
||||
"platform:firstleg:terminal-drayage:empty-return:confirm");
|
||||
|
||||
@Test
|
||||
@@ -50,7 +49,6 @@ class ContainerWorkspacePermissionSqlContractTest {
|
||||
"'platform:firstleg:terminal-drayage:document:edit',\n '维护目的港清关与DO/PU',NULL,'POST'",
|
||||
"'platform:firstleg:terminal-drayage:fleet:edit',\n '维护目的港码头车队',NULL,'POST'",
|
||||
"'platform:firstleg:terminal-drayage:pickup-appointment:edit',\n '预约目的港提柜',NULL,'POST'",
|
||||
"'platform:firstleg:terminal-drayage:pickup:confirm',\n '确认目的港实际提柜',NULL,'POST'",
|
||||
"'platform:firstleg:terminal-drayage:empty-return:confirm',\n '确认目的港实际还柜',NULL,'POST'");
|
||||
}
|
||||
|
||||
@@ -75,8 +73,8 @@ class ContainerWorkspacePermissionSqlContractTest {
|
||||
"MERCHANT_OWNER");
|
||||
assertThat(sql).contains(
|
||||
"permission_code IN (",
|
||||
")) <> 9 THEN",
|
||||
")) <> 18 THEN");
|
||||
")) <> 8 THEN",
|
||||
")) <> 16 THEN");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user