gwbvipvip 9 месяцев назад
Родитель
Сommit
c92cc38ba4
4 измененных файлов: 59 добавлений и 1 удалений
  1. +4
    -0
      BPA.KitChen.GroupMealOrder.Application/BaseDto/PageUtil.cs
  2. +7
    -1
      BPA.KitChen.GroupMealOrder.Application/Service/WeighOrder/Service/WeighOrderService.cs
  3. +8
    -0
      BPA.KitChen.GroupMealOrder/Program.cs
  4. +40
    -0
      BPA.KitChen.WeChat/Job/OrderJob.cs

+ 4
- 0
BPA.KitChen.GroupMealOrder.Application/BaseDto/PageUtil.cs Просмотреть файл

@@ -19,5 +19,9 @@ namespace BPA.KitChen.GroupMealOrder.Application.BaseDto
/// </summary>

public int Total { get; set; }

public int Current { get; set; }


}
}

+ 7
- 1
BPA.KitChen.GroupMealOrder.Application/Service/WeighOrder/Service/WeighOrderService.cs Просмотреть файл

@@ -413,6 +413,11 @@ namespace BPA.KitChen.GroupMealOrder.Application.Service.WeighOrder.Service
var result = await db.Queryable<BPA_WeighOrder>()
.FirstAsync(x => x.Id == inputDto.OrderId);

if (result==null)
{
throw Oops.Oh("订单不存在");
}

result.PayStates = inputDto.PayStates;
result.States = inputDto.States;
await db.Insertable(new BPA_WeighOrderStatesRecord()
@@ -561,7 +566,8 @@ namespace BPA.KitChen.GroupMealOrder.Application.Service.WeighOrder.Service
return new PageUtil()
{
Total = total,
Data = res
Data = res,
Current= inputDto.Current

};
}


+ 8
- 0
BPA.KitChen.GroupMealOrder/Program.cs Просмотреть файл

@@ -1,9 +1,11 @@
using BPA.KitChen.GroupMealOrder.Application.Job;
using BPA.KitChen.GroupMealOrder.Core.CacheOption;
using BPA.KitChen.GroupMealOrder.Handlers;
using BPA.KitChen.GroupMealOrder.SqlSugar;
using Essensoft.Paylink.WeChatPay;
using Essensoft.Paylink.WeChatPay;
using Furion;
using Furion.Schedule;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
@@ -26,6 +28,12 @@ builder.Services.AddMvcFilter<RequestAuditFiltercs>();
// 添加Paylink依赖注入
builder.Services.AddWeChatPay();

builder.Services.AddSchedule(options =>
{
// 注册作业,并配置作业触发器
options.AddJob<OrderJob>(Triggers.Minutely());
});


IConfigurationRoot config = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")


+ 40
- 0
BPA.KitChen.WeChat/Job/OrderJob.cs Просмотреть файл

@@ -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;
}
}
}

Загрузка…
Отмена
Сохранить