5 changed files with 93 additions and 11 deletions
@ -0,0 +1,86 @@ |
|||
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()) |
|||
{ |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
} |
Loading…
Reference in new issue