Browse Source

fix(lingxing): 能力判断直接用 account.platform(),不再从 platformCode 反推

supports(account, capability) 之前用 LingxingConstants.toPlatform(platformCode)
反推平台,但 account 的 key 里本来就有调用方传入的 Platform。

两者不一致时(如 platformCode=10024 但 platform=WALMART_SC)会出现
「路由走 A、能力判断走 B」的错乱。现在统一以调用方传入的 Platform 为准,
platformCode 只用于拼请求参数。

Co-Authored-By: Claude <noreply@anthropic.com>
feature/supplier-lingxing
chenchuchuan 2 weeks ago
parent
commit
a37d1fe91a
  1. 5
      lingxing/src/main/java/common/ecommerce/lingxing/adapter/LingxingAdapter.java

5
lingxing/src/main/java/common/ecommerce/lingxing/adapter/LingxingAdapter.java

@ -146,8 +146,9 @@ public final class LingxingAdapter implements SalesOrderCapable, ProductCapable, @@ -146,8 +146,9 @@ public final class LingxingAdapter implements SalesOrderCapable, ProductCapable,
if (!capabilities().contains(capability)) {
return false;
}
Platform p = LingxingConstants.toPlatform(account.platformCode());
if (p == null || !subPlatforms.isRegistered(p)) {
// 路由只看调用方传入的 Platform;平台码只用于拼请求参数,不参与判断
Platform p = account.platform();
if (!subPlatforms.isRegistered(p)) {
return false;
}
LingxingSubPlatform impl = subPlatforms.of(p);

Loading…
Cancel
Save