diff --git a/Admin.NET/Admin.NET.Core/Entity/SysWechatPay.cs b/Admin.NET/Admin.NET.Core/Entity/SysWechatPay.cs
index 5e07a4af..46286bf1 100644
--- a/Admin.NET/Admin.NET.Core/Entity/SysWechatPay.cs
+++ b/Admin.NET/Admin.NET.Core/Entity/SysWechatPay.cs
@@ -94,13 +94,13 @@ public partial class SysWechatPay : EntityBase
/// 支付完成时间
///
[SugarColumn(ColumnDescription = "支付完成时间")]
- public DateTimeOffset? SuccessTime { get; set; }
+ public DateTime? SuccessTime { get; set; }
///
/// 交易结束时间
///
[SugarColumn(ColumnDescription = "交易结束时间")]
- public DateTimeOffset? ExpireTime { get; set; }
+ public DateTime? ExpireTime { get; set; }
///
/// 商品描述
diff --git a/Admin.NET/Admin.NET.Core/Service/Wechat/Dto/WechatPayOutput.cs b/Admin.NET/Admin.NET.Core/Service/Wechat/Dto/WechatPayOutput.cs
index 108d75d2..5e2bc2e2 100644
--- a/Admin.NET/Admin.NET.Core/Service/Wechat/Dto/WechatPayOutput.cs
+++ b/Admin.NET/Admin.NET.Core/Service/Wechat/Dto/WechatPayOutput.cs
@@ -46,12 +46,12 @@ public class WechatPayOutput
///
/// 支付发起时间
///
- public DateTimeOffset CreateTime { get; set; }
+ public DateTime CreateTime { get; set; }
///
/// 支付完成时间
///
- public DateTimeOffset SuccessTime { get; set; }
+ public DateTime SuccessTime { get; set; }
///
/// 交易状态(支付成功后,微信返回)
diff --git a/Admin.NET/Admin.NET.Core/Service/Wechat/SysWechatPayService.cs b/Admin.NET/Admin.NET.Core/Service/Wechat/SysWechatPayService.cs
index 095abdf7..1555a132 100644
--- a/Admin.NET/Admin.NET.Core/Service/Wechat/SysWechatPayService.cs
+++ b/Admin.NET/Admin.NET.Core/Service/Wechat/SysWechatPayService.cs
@@ -5,6 +5,7 @@
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
using Furion.Logging.Extensions;
+using NewLife;
using Newtonsoft.Json;
namespace Admin.NET.Core.Service;
@@ -304,7 +305,7 @@ public class SysWechatPayService : IDynamicApiController, ITransient
if (wechatPayOld == null || wechatPayOld.TradeState != wechatPayNew.TradeState)
{
// 没必要等所有回调事件处理完再返回给微信,开一个Task执行
- Task.Run(async () =>
+ _ = Task.Run(async () =>
{
foreach (var eh in wechatPayEventHandlers)
{
@@ -318,7 +319,7 @@ public class SysWechatPayService : IDynamicApiController, ITransient
$"GetPayInfoFromWechat 中执行微信支付回调{eh.GetType().Name}出错".LogError(ex);
}
}
- }).Start();
+ });
}
// 下面这里创建一个新的对象,是因为不想把全部字段都返回
wechatPayNew = new SysWechatPay()
@@ -372,13 +373,13 @@ public class SysWechatPayService : IDynamicApiController, ITransient
wechatPayNew.BankType = callbackResource.BankType; // 付款银行类型
wechatPayNew.Total = callbackResource.Amount.Total; // 订单总金额
wechatPayNew.PayerTotal = callbackResource.Amount.PayerTotal; // 用户支付金额
- wechatPayNew.SuccessTime = callbackResource.SuccessTime; // 支付完成时间
+ wechatPayNew.SuccessTime = callbackResource.SuccessTime.DateTime; // 支付完成时间
await _sysWechatPayRep.AsUpdateable(wechatPayNew).IgnoreColumns(true).ExecuteCommandAsync();
// 因为这个是回调给微信的,所以这里没必要等所有回调事件处理完再返回给微信,开一个Task执行
if (wechatPayOld.TradeState != wechatPayNew.TradeState)
{
- Task.Run(async () =>
+ _ = Task.Run(async () =>
{
foreach (var eh in wechatPayEventHandlers)
{
@@ -392,7 +393,7 @@ public class SysWechatPayService : IDynamicApiController, ITransient
$"PayCallBack 中执行微信支付回调{eh.GetType().Name}出错".LogError(ex);
}
}
- }).Start();
+ });
}
return new WechatPayOutput()
{
@@ -484,13 +485,13 @@ public class SysWechatPayService : IDynamicApiController, ITransient
wechatPayNew.BankType = callbackResource.BankType; // 付款银行类型
wechatPayNew.Total = callbackResource.Amount.Total; // 订单总金额
wechatPayNew.PayerTotal = callbackResource.Amount.PayerTotal; // 用户支付金额
- wechatPayNew.SuccessTime = callbackResource.SuccessTime; // 支付完成时间
+ wechatPayNew.SuccessTime = callbackResource.SuccessTime.DateTime; // 支付完成时间
await _sysWechatPayRep.AsUpdateable(wechatPayNew).IgnoreColumns(true).ExecuteCommandAsync();
// 因为这个是回调给微信的,所以这里没必要等所有回调事件处理完再返回给微信,开一个Task执行
if (wechatPayOld.TradeState != wechatPayNew.TradeState)
{
- Task.Run(async () =>
+ _ = Task.Run(async () =>
{
foreach (var eh in wechatPayEventHandlers)
{
@@ -504,7 +505,7 @@ public class SysWechatPayService : IDynamicApiController, ITransient
$"PayPartnerCallBack 中执行微信支付回调{eh.GetType().Name}出错".LogError(ex);
}
}
- }).Start();
+ });
}
}
}
@@ -628,7 +629,7 @@ public class SysWechatPayService : IDynamicApiController, ITransient
wechatPay.OpenId = response.Payer?.OpenId;// 付款用户OpenId
wechatPay.BankType = response.BankType; // 付款银行类型
wechatPay.PayerTotal = response.Amount?.PayerTotal; // 用户支付金额
- wechatPay.SuccessTime = response.SuccessTime; // 支付完成时间
+ wechatPay.SuccessTime = response.SuccessTime?.DateTime; // 支付完成时间
await _sysWechatPayRep.AsUpdateable(wechatPay).IgnoreColumns(true).ExecuteCommandAsync();
return wechatPay.Adapt();
}
@@ -671,7 +672,7 @@ public class SysWechatPayService : IDynamicApiController, ITransient
wechatPay.OpenId = response.Payer?.OpenId;// 付款用户OpenId
wechatPay.BankType = response.BankType; // 付款银行类型
wechatPay.PayerTotal = response.Amount?.PayerTotal; // 用户支付金额
- wechatPay.SuccessTime = response.SuccessTime; // 支付完成时间
+ wechatPay.SuccessTime = response.SuccessTime?.DateTime; // 支付完成时间
await _sysWechatPayRep.AsUpdateable(wechatPay).IgnoreColumns(true).ExecuteCommandAsync();
return wechatPay.Adapt();
}