You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
1.7 KiB
86 lines
1.7 KiB
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using TaskManager.Entity;
|
|
using TaskManager.EntityFramework;
|
|
using Wood.Entity;
|
|
|
|
namespace Wood.Service.Controllers
|
|
{
|
|
public class CheryDataMaintenanceService:IScoped,IDoExecute
|
|
{
|
|
private readonly IServiceProvider _serviceProvider;
|
|
private readonly IConfiguration _configuration;
|
|
public CheryDataMaintenanceService(IServiceProvider serviceProvider, IConfiguration configuration)
|
|
{
|
|
_serviceProvider = serviceProvider;
|
|
_configuration = configuration;
|
|
|
|
}
|
|
|
|
public async Task ExecuteAsync(string url, string path, string takName, string client, int pageSize)
|
|
{
|
|
|
|
using var scope = _serviceProvider.CreateScope();
|
|
var db = scope.ServiceProvider.GetRequiredService<JobDbContext>();
|
|
var tasklist=db.TaskConifgure.Where(p=>p.Client=="Chery").Select(x => x.TaskName);
|
|
|
|
|
|
//DateTime.Now.AddDays(-1).ToString("yyyyMMdd")
|
|
|
|
foreach (var task in tasklist)
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
public async Task SyncDataAsync(string version,string taskName)
|
|
{
|
|
|
|
using var scope = _serviceProvider.CreateScope();
|
|
var db = scope.ServiceProvider.GetRequiredService<JobDbContext>();
|
|
|
|
var list = db.TaskLogs.Where(x => x.TaskName == taskName && x.Version == version
|
|
|
|
&& !string.IsNullOrEmpty(x.Path) && x.Type == "应答");
|
|
|
|
if (list.Any())
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|