@@ -19,5 +19,9 @@ namespace BPA.KitChen.GroupMealOrder.Application.BaseDto | |||||
/// </summary> | /// </summary> | ||||
public int Total { get; set; } | public int Total { get; set; } | ||||
public int Current { get; set; } | |||||
} | } | ||||
} | } |
@@ -413,6 +413,11 @@ namespace BPA.KitChen.GroupMealOrder.Application.Service.WeighOrder.Service | |||||
var result = await db.Queryable<BPA_WeighOrder>() | var result = await db.Queryable<BPA_WeighOrder>() | ||||
.FirstAsync(x => x.Id == inputDto.OrderId); | .FirstAsync(x => x.Id == inputDto.OrderId); | ||||
if (result==null) | |||||
{ | |||||
throw Oops.Oh("订单不存在"); | |||||
} | |||||
result.PayStates = inputDto.PayStates; | result.PayStates = inputDto.PayStates; | ||||
result.States = inputDto.States; | result.States = inputDto.States; | ||||
await db.Insertable(new BPA_WeighOrderStatesRecord() | await db.Insertable(new BPA_WeighOrderStatesRecord() | ||||
@@ -561,7 +566,8 @@ namespace BPA.KitChen.GroupMealOrder.Application.Service.WeighOrder.Service | |||||
return new PageUtil() | return new PageUtil() | ||||
{ | { | ||||
Total = total, | Total = total, | ||||
Data = res | |||||
Data = res, | |||||
Current= inputDto.Current | |||||
}; | }; | ||||
} | } | ||||
@@ -1,9 +1,11 @@ | |||||
using BPA.KitChen.GroupMealOrder.Application.Job; | |||||
using BPA.KitChen.GroupMealOrder.Core.CacheOption; | using BPA.KitChen.GroupMealOrder.Core.CacheOption; | ||||
using BPA.KitChen.GroupMealOrder.Handlers; | using BPA.KitChen.GroupMealOrder.Handlers; | ||||
using BPA.KitChen.GroupMealOrder.SqlSugar; | using BPA.KitChen.GroupMealOrder.SqlSugar; | ||||
using Essensoft.Paylink.WeChatPay; | using Essensoft.Paylink.WeChatPay; | ||||
using Essensoft.Paylink.WeChatPay; | using Essensoft.Paylink.WeChatPay; | ||||
using Furion; | using Furion; | ||||
using Furion.Schedule; | |||||
using Microsoft.AspNetCore.Builder; | using Microsoft.AspNetCore.Builder; | ||||
using Microsoft.AspNetCore.Hosting; | using Microsoft.AspNetCore.Hosting; | ||||
using Microsoft.Extensions.Configuration; | using Microsoft.Extensions.Configuration; | ||||
@@ -26,6 +28,12 @@ builder.Services.AddMvcFilter<RequestAuditFiltercs>(); | |||||
// 添加Paylink依赖注入 | // 添加Paylink依赖注入 | ||||
builder.Services.AddWeChatPay(); | builder.Services.AddWeChatPay(); | ||||
builder.Services.AddSchedule(options => | |||||
{ | |||||
// 注册作业,并配置作业触发器 | |||||
options.AddJob<OrderJob>(Triggers.Minutely()); | |||||
}); | |||||
IConfigurationRoot config = new ConfigurationBuilder() | IConfigurationRoot config = new ConfigurationBuilder() | ||||
.AddJsonFile("appsettings.json") | .AddJsonFile("appsettings.json") | ||||
@@ -0,0 +1,40 @@ | |||||
using BPA.KitChen.GroupMealOrder.Core.Entity; | |||||
using BPA.KitChen.GroupMealOrder.SqlSugar; | |||||
using BPA.KitChen.WeChat.WechatServer.Service; | |||||
using Furion.Schedule; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPA.KitChen.GroupMealOrder.Application.Job | |||||
{ | |||||
public class OrderJob : IJob | |||||
{ | |||||
private readonly IWechatPayService _wechatPayService; | |||||
public OrderJob(IWechatPayService wechatPayService) | |||||
{ | |||||
_wechatPayService= wechatPayService; | |||||
} | |||||
public Task ExecuteAsync(JobExecutingContext context, CancellationToken stoppingToken) | |||||
{ | |||||
//查询所有订单 | |||||
var order = SqlSugarDb.Db.Queryable<BPA_WeighOrder>() | |||||
.ClearFilter() | |||||
.Where(x=>x.States==0&&x.PayStates==0) | |||||
.ToList(); | |||||
foreach (var item in order) | |||||
{ | |||||
// var res= _wechatPayService. | |||||
} | |||||
//查询订单 | |||||
return Task.CompletedTask; | |||||
} | |||||
} | |||||
} |