From d14eeb9ff863cdddf741cdc25ed3c4b9f10723d1 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Sun, 19 Feb 2023 11:23:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BF=AB=E9=80=92=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E5=8C=B9=E9=85=8D=E4=BC=98=E5=85=88=E7=BA=A7=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlatformSDK/LogisticsCompanyConverter.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/BBWY.Server.Business/PlatformSDK/LogisticsCompanyConverter.cs b/BBWY.Server.Business/PlatformSDK/LogisticsCompanyConverter.cs index 3f4d659a..abcdfb5c 100644 --- a/BBWY.Server.Business/PlatformSDK/LogisticsCompanyConverter.cs +++ b/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; } }