mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 16:03:25 +08:00
【新增】增加【服务订单】超市未支付自定取消订单,后台【商城设置】【平台设置】【订单管理】的tab第一条可以设置超时时间。
This commit is contained in:
29
CoreCms.Net.Task/AutoCancelServiceOrderJob.cs
Normal file
29
CoreCms.Net.Task/AutoCancelServiceOrderJob.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
using System;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
|
||||
namespace CoreCms.Net.Task
|
||||
{
|
||||
/// <summary>
|
||||
/// 未付款服务订单超时后取消订单操作任务
|
||||
/// </summary>
|
||||
public class AutoCancelServiceOrderJob
|
||||
{
|
||||
private readonly ICoreCmsUserServicesOrderServices _userServicesOrderServices;
|
||||
|
||||
public AutoCancelServiceOrderJob(ICoreCmsUserServicesOrderServices userServicesOrderServices)
|
||||
{
|
||||
_userServicesOrderServices = userServicesOrderServices;
|
||||
}
|
||||
|
||||
public async System.Threading.Tasks.Task Execute()
|
||||
{
|
||||
await _userServicesOrderServices.AutoCancelOrder();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,6 @@ namespace CoreCms.Net.Task
|
||||
//这里呢就是需要触发的方法 "0/10 * * * * ? " 可以自行搜索cron表达式 代表循环的规律很简单
|
||||
//CancelOrderJob代表你要触发的类 Execute代表你要触发的方法
|
||||
|
||||
|
||||
//自动取消订单任务
|
||||
RecurringJob.AddOrUpdate<AutoCancelOrderJob>(s => s.Execute(), "0 0/5 * * * ? ", TimeZoneInfo.Local); // 每5分钟取消一次订单
|
||||
|
||||
@@ -68,6 +67,10 @@ namespace CoreCms.Net.Task
|
||||
//定时清理用户连续签到信息
|
||||
RecurringJob.AddOrUpdate<ClearUserContinuousCheckInJob>(s => s.Execute(), "0 0 0 */1 * ? ", TimeZoneInfo.Local); // 每天0点执行。
|
||||
|
||||
//自动取消服务器订单任务
|
||||
RecurringJob.AddOrUpdate<AutoCancelServiceOrderJob>(s => s.Execute(), "0 0/5 * * * ? ", TimeZoneInfo.Local); // 每5分钟取消一次订单
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user