Browse Source

修复快递翻译匹配优先级问题

qianyi
shanji 2 years ago
parent
commit
d14eeb9ff8
  1. 18
      BBWY.Server.Business/PlatformSDK/LogisticsCompanyConverter.cs

18
BBWY.Server.Business/PlatformSDK/LogisticsCompanyConverter.cs

@ -67,10 +67,22 @@ namespace BBWY.Server.Business
if (targetShip == null)
throw new BusinessException($"sourcePlatform:{sourcePlatform},targetPlatform:{targetPlatform},未找到{sourcePlatform}的物流公司{sourceName}");
var logisiticsCompany = targetPlatformUserLogisticsCompanyList.FirstOrDefault(c => c.Name.Equals(targetShip.TargetName) || c.Name.Equals(targetShip.SecondTargetName));
var logisiticsCompany = targetPlatformUserLogisticsCompanyList.FirstOrDefault(c => c.Name.Equals(targetShip.TargetName));
if (logisiticsCompany == null)
throw new BusinessException($"sourcePlatform:{sourcePlatform},targetPlatform:{targetPlatform},targetShip:{targetShip.TargetName},在用户支持的物流公司中不存在");
{
if (!string.IsNullOrEmpty(targetShip.SecondTargetName))
{
logisiticsCompany = targetPlatformUserLogisticsCompanyList.FirstOrDefault(c => c.Name.Equals(targetShip.SecondTargetName));
if (logisiticsCompany == null)
{
throw new BusinessException($"sourcePlatform:{sourcePlatform},targetPlatform:{targetPlatform},targetShip:{targetShip.SecondTargetName},在用户支持的物流公司中不存在");
}
}
else
{
throw new BusinessException($"sourcePlatform:{sourcePlatform},targetPlatform:{targetPlatform},targetShip:{targetShip.TargetName},在用户支持的物流公司中不存在");
}
}
return logisiticsCompany.Id;
}
}

Loading…
Cancel
Save