Browse Source

提交

master
gwbvipvip 9 months ago
parent
commit
c92cc38ba4
4 changed files with 59 additions and 1 deletions
  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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

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

Loading…
Cancel
Save