From 19863208cfdaf01735e75fbdafa33e426e735c04 Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期五, 12 九月 2025 15:09:41 +0800
Subject: [PATCH] feat:开发

---
 FlexJobApi.Core/Jobs/CompleteTaskSettlementT1Job.cs |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/FlexJobApi.Core/Jobs/CompleteTaskSettlementT1Job.cs b/FlexJobApi.Core/Jobs/CompleteTaskSettlementT1Job.cs
index debb6b7..01e4698 100644
--- a/FlexJobApi.Core/Jobs/CompleteTaskSettlementT1Job.cs
+++ b/FlexJobApi.Core/Jobs/CompleteTaskSettlementT1Job.cs
@@ -89,6 +89,8 @@
         /// <returns></returns>
         private async Task UpdateUserWalletTransactionWithdraw(UserWallet wallet, UserWalletTransaction withdraw, EnterpriseWalletTransaction transfer)
         {
+            withdraw.ErrorCode = transfer.ErrorCode;
+            withdraw.FailReason = transfer.FailReason;
             withdraw.EnterpriseWalletTransactionId = transfer.Id;
             withdraw.TransactionStatus = transfer.TransactionStatus;
             withdraw.TransDate = transfer.TransDate;
@@ -129,9 +131,6 @@
         /// <returns></returns>
         private async Task<UserWalletTransaction> AddUserWalletTransactionWithdraw(UserWallet wallet, TaskInfo task, TaskInfoUser user)
         {
-            wallet.Balance -= user.ActualSettlementAmount ?? 0;
-            await repUserWallet.UpdateNowAsync(wallet);
-
             var order = new UserWalletTransaction();
             order.WalletId = wallet.Id;
             order.Type = EnumUserWalletTransactionType.Withdraw;
@@ -147,6 +146,10 @@
             order.TransactionStatus = EnumWalletTransactionStatus.Dealing;
             await SetCode(order);
             await repUserWalletTransaction.InsertNowAsync(order);
+
+            wallet.Balance -= user.ActualSettlementAmount ?? 0;
+            await repUserWallet.UpdateNowAsync(wallet);
+
             return order;
         }
 
@@ -304,6 +307,10 @@
                     AccountBookId = wallet.AccountBookId,
                     SceneCode = "SATF_FUND_BOOK",
                     MerchantUserId = wallet.Code,
+                    ExtInfo = new
+                    {
+                        agreement_no = wallet.AgreementNo
+                    }.ToJson()
                 });
                 if (response.IsError) throw Oops.Oh(EnumErrorCodeType.s510, response.SubMsg ?? response.Msg);
                 wallet.Balance = response.AvailableAmount.ToDecimal() ?? 0;

--
Gitblit v1.9.1