fix: 下游预报凭证快照整套同源,避免与订单字段混拼
All checks were successful
Build and Deploy / deploy (push) Successful in 1m45s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zzh 2026-09-14 18:13:37 +08:00
parent 8d1e3ab17f
commit 14f3df3fa5

View File

@ -17,7 +17,9 @@ public sealed class OrderDownstreamCredentials
} }
/// <summary> /// <summary>
/// 解析订单下游 itfx 凭证(优先订单绑定字段,回退渠道分组)。 /// 解析订单下游 itfx 凭证。
/// 优先级:服务渠道规则快照(整套同源)→ 订单绑定字段 → 渠道分组实时查询。
/// 快照命中时 SupplierCode/AppKey/AppSecret 必须同出快照,禁止与订单字段混拼。
/// </summary> /// </summary>
public class OrderDownstreamCredentialResolver( public class OrderDownstreamCredentialResolver(
IServiceChannelRepository serviceChannelRepository, IServiceChannelRepository serviceChannelRepository,
@ -213,23 +215,20 @@ public class OrderDownstreamCredentialResolver(
return null; return null;
} }
// 整套同源:禁止用订单 SupplierCode/AppKey 拼快照 AppSecret,避免两边发布不同步时混用。
var appSecret = downstream.AppSecret?.Trim(); var appSecret = downstream.AppSecret?.Trim();
if (string.IsNullOrWhiteSpace(appSecret)) if (string.IsNullOrWhiteSpace(appSecret))
{ {
return null; return null;
} }
var appKey = !string.IsNullOrWhiteSpace(order.DownstreamAppKey) var appKey = downstream.AppKey?.Trim();
? order.DownstreamAppKey.Trim()
: downstream.AppKey?.Trim();
if (string.IsNullOrWhiteSpace(appKey)) if (string.IsNullOrWhiteSpace(appKey))
{ {
return null; return null;
} }
var supplierCode = !string.IsNullOrWhiteSpace(order.DownstreamSupplierCode) var supplierCode = downstream.SupplierCode?.Trim();
? order.DownstreamSupplierCode.Trim()
: downstream.SupplierCode?.Trim();
if (string.IsNullOrWhiteSpace(supplierCode)) if (string.IsNullOrWhiteSpace(supplierCode))
{ {
return null; return null;