feat 配送点管理

This commit is contained in:
cheche
2024-03-19 15:26:40 +08:00
parent ed25ab626a
commit 217d9f7770
12 changed files with 227 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
using Dlhis.Entity.Common;
using Kurisu.SqlSugar.Services;
using SqlSugar;
namespace Dlhis.ScheduledTask.CommonJobs;
public class DelApiLogTaskJob
{
private readonly IDbContext _dbContext;
public DelApiLogTaskJob(IDbContext dbContext)
{
_dbContext = dbContext;
}
public async Task RunAsync()
{
DateTime now = DateTime.Now;
DateTime todayStart = now.Date;
DateTime threeDaysAgoStart = todayStart.AddDays(-3);
var logs = await _dbContext.ChangeDb("log")
.Queryable<ApiLogEntity>()
.Where(x => x._ts<= threeDaysAgoStart)
.OrderBy(x =>x._ts,OrderByType.Asc)
.ToListAsync();
await _dbContext.ChangeDb("log").DeleteReallyAsync(logs);
}
}