From c682cd59ded8e71957a802dd4f8dcf58e0113c0f Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期四, 11 九月 2025 15:33:30 +0800
Subject: [PATCH] feat:开发

---
 FlexJobApi.UserServer.Application/EnterpriseWallets/Commands/EnterpriseWalletExpandindirectCommandHandler.cs |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/FlexJobApi.UserServer.Application/EnterpriseWallets/Commands/EnterpriseWalletExpandindirectCommandHandler.cs b/FlexJobApi.UserServer.Application/EnterpriseWallets/Commands/EnterpriseWalletExpandindirectCommandHandler.cs
index 288d783..c48392a 100644
--- a/FlexJobApi.UserServer.Application/EnterpriseWallets/Commands/EnterpriseWalletExpandindirectCommandHandler.cs
+++ b/FlexJobApi.UserServer.Application/EnterpriseWallets/Commands/EnterpriseWalletExpandindirectCommandHandler.cs
@@ -23,7 +23,8 @@
     public class EnterpriseWalletExpandindirectCommandHandler(
             AlipayUtils alipayUtils,
             IHttpRemoteService httpRemoteService,
-            IRepository<EnterpriseWalletExpandindirectOrder> rep
+            IRepository<EnterpriseWalletExpandindirectOrder> rep,
+            IRepository<EnterpriseWallet> repEnterpriseWallet
         ) :
         IRequestHandler<EnterpriseWalletExpandindirectCreateCommand, Guid>,
         IRequestHandler<EnterpriseWalletExpandindirectOrderCancelCommand, Guid>,
@@ -32,6 +33,7 @@
         private readonly AlipayUtils alipayUtils = alipayUtils;
         private readonly IHttpRemoteService httpRemoteService = httpRemoteService;
         private readonly IRepository<EnterpriseWalletExpandindirectOrder> rep = rep;
+        private readonly IRepository<EnterpriseWallet> repEnterpriseWallet = repEnterpriseWallet;
 
         /// <summary>
         /// 鏀粯瀹濊祫閲戜簩绾у晢鎴稫YB浠h繘浠�
@@ -48,11 +50,19 @@
                 request.EnterpriseId = logier.EnterpriseId;
             }
             if (request.EnterpriseId == null) throw Oops.Oh(EnumErrorCodeType.s400, "璇峰~鍐欎紒涓欼d");
+            var wallet = await repEnterpriseWallet.AsQueryable().AsNoTracking()
+                .Where(it => it.EnterpriseId == request.EnterpriseId)
+                .FirstOrDefaultAsync();
+            if (wallet == null)
+            {
+                throw Oops.Oh(EnumErrorCodeType.s404, "浼佷笟閽卞寘");
+            }
             var source = await rep.AsQueryable()
                 .OrderByDescending(it => it.CreatedTime)
-                .Where(it => it.Wallet.EnterpriseId == request.EnterpriseId && it.OrderId != null && it.OrderId != "")
+                .Where(it => it.WalletId == wallet.Id && it.OrderId != null && it.OrderId != "")
                 .FirstOrDefaultAsync();
             var entity = new EnterpriseWalletExpandindirectOrder();
+            entity.WalletId = wallet.Id;
             if (source != null)
             {
                 if (source.OrderStatus == EnumEnterpriseWalletExpandindirectOrderStatus.PROCESSING)

--
Gitblit v1.9.1