From f61554fc08cd0a340412475878f5706203798aa6 Mon Sep 17 00:00:00 2001 From: MSuMshk <2039814060@qq.com> Date: Fri, 6 Feb 2026 14:01:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E5=95=86=E6=88=B7?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E7=A7=9F=E6=88=B7=E4=BF=A1=E6=81=AF=E5=85=9C?= =?UTF-8?q?=E5=BA=95=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Handlers/GetCurrentMerchantCenterQueryHandler.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetCurrentMerchantCenterQueryHandler.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetCurrentMerchantCenterQueryHandler.cs index c285672..07a492d 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetCurrentMerchantCenterQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetCurrentMerchantCenterQueryHandler.cs @@ -62,7 +62,8 @@ public sealed class GetCurrentMerchantCenterQueryHandler( // 5. 读取商户主体与租户信息 var merchant = await merchantRepository.FindByIdAsync(merchantId, currentTenantId, cancellationToken) ?? throw new BusinessException(ErrorCodes.NotFound, "商户不存在"); - var tenant = await tenantRepository.FindByIdAsync(currentTenantId, cancellationToken); + var tenant = await tenantRepository.FindByIdAsync(currentTenantId, cancellationToken) + ?? throw new BusinessException(ErrorCodes.NotFound, "租户不存在"); // 6. 读取商户关联数据 var stores = await storeRepository.GetByMerchantIdAsync(merchantId, currentTenantId, cancellationToken); @@ -77,7 +78,7 @@ public sealed class GetCurrentMerchantCenterQueryHandler( var staffDtos = staffs.Select(StoreMapping.ToDto).ToList(); return new CurrentMerchantCenterDto { - Merchant = MerchantMapping.ToDetailDto(merchant, tenant?.Name, storeDtos), + Merchant = MerchantMapping.ToDetailDto(merchant, tenant.Name, storeDtos), Staffs = staffDtos, Documents = MerchantMapping.ToDocumentDtos(documents), Contracts = MerchantMapping.ToContractDtos(contracts),