From 8eb5f9115334a665a297218dd23a83cfe5d165bd Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期一, 31 三月 2025 09:47:51 +0800
Subject: [PATCH] fix:退款时间

---
 LifePayment/LifePayment.Application/LifePay/LifePayService.cs |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
index e847711..11bdb9b 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -28,6 +28,7 @@
 using NPOI.SS.Formula.Functions;
 using StackExchange.Redis;
 using static Volo.Abp.Identity.Settings.IdentitySettingNames;
+using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
 
 namespace LifePayment.Application;
 
@@ -829,6 +830,7 @@
     public async Task<AlipayTradeQueryResponse> QueryAlipayTrade(OrderInQuiryInput input)
     {
         var result = await _aliPayApi.OrderInQuiry(input);
+
         return result;
     }
 
@@ -840,6 +842,13 @@
     public async Task<AlipayTradeFastpayRefundQueryResponse> QueryAlipayTradeRefund(OrderInQuiryInput input)
     {
         var result = await _aliPayApi.QueryAlipayTradeRefund(input);
+        var order = await _lifePayOrderRepository.Where(x => x.OrderNo == input.OutTradeNo).FirstOrDefaultAsync();
+        if (result.Code == AlipayResultCode.Success && result.RefundStatus == AlipayRefundStatus.Success)
+        {
+            order.LifePayOrderStatus = LifePayOrderStatusEnum.宸查��娆�;
+            order.LifePayRefundStatus = LifePayRefundStatusEnum.宸查��娆�;
+        }
+
         return result;
     }
 
@@ -858,9 +867,9 @@
     /// </summary>
     /// <param name="outTradeNo"></param>
     /// <returns></returns>
-    public async Task WxPayTradeQuery(string outTradeNo)
+    public async Task<WxPayTradeQueryReponse> WxPayTradeQuery(string outTradeNo)
     {
-        await _wxPayApi.WxPayTradeQuery(outTradeNo);
+        return await _wxPayApi.WxPayTradeQuery(outTradeNo);
     }
 
     #endregion
@@ -1052,8 +1061,8 @@
         //var payUrl = await GetPayQRCode(order.LifePayType.Value, order.OrderNo, desc, 0.01m, ip, input.H5Type);
         var payUrl = await GetPayQRCode(res.LifePayType, res.OrderNo, res.Desc, res.PayAmount, ip, input.H5Type);
 #else
-      //var payUrl = await GetPayQRCode(order.LifePayType.Value, order.OrderNo, desc, 0.01m, ip, input.H5Type);
-        var payUrl = await GetPayQRCode(order.LifePayType.Value, order.OrderNo, desc, order.PayAmount??0, ip, input.H5Type);
+      //var payUrl = await GetPayQRCode(res.LifePayType, res.OrderNo, res.Desc, 0.01m, ip, input.H5Type);
+        var payUrl = await GetPayQRCode(res.LifePayType, res.OrderNo, res.Desc, res.PayAmount, ip, input.H5Type);
 #endif
 
         return payUrl;

--
Gitblit v1.9.1