From 05cd64ffe04b8108d23b73f34b6c85559da88393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 12 Jun 2025 09:23:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97=E9=98=9F?= =?UTF-8?q?=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CheryDataMaintenanceService.cs | 86 +++++++++++++++++++ .../CheryRecurringJobInputPageController.cs | 2 +- .../{LogService.cs => LogConsumerService.cs} | 0 API/Wood.Service/Controllers/LogController.cs | 12 +-- .../Controllers/RecurringJobBaseController.cs | 4 +- 5 files changed, 93 insertions(+), 11 deletions(-) create mode 100644 API/Wood.Service/Controllers/CheryDataMaintenanceService.cs rename API/Wood.Service/Controllers/{LogService.cs => LogConsumerService.cs} (100%) diff --git a/API/Wood.Service/Controllers/CheryDataMaintenanceService.cs b/API/Wood.Service/Controllers/CheryDataMaintenanceService.cs new file mode 100644 index 0000000..88f15a0 --- /dev/null +++ b/API/Wood.Service/Controllers/CheryDataMaintenanceService.cs @@ -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(); + 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(); + + var list = db.TaskLogs.Where(x => x.TaskName == taskName && x.Version == version + + && !string.IsNullOrEmpty(x.Path) && x.Type == "应答"); + + if (list.Any()) + { + + + + + + + + + + + } + + + + + + } + + + + + } +} diff --git a/API/Wood.Service/Controllers/CheryRecurringJobInputPageController.cs b/API/Wood.Service/Controllers/CheryRecurringJobInputPageController.cs index bb5ad80..f8c0f6f 100644 --- a/API/Wood.Service/Controllers/CheryRecurringJobInputPageController.cs +++ b/API/Wood.Service/Controllers/CheryRecurringJobInputPageController.cs @@ -208,7 +208,7 @@ namespace TaskManager.Controllers itm.WriteState = true; } var result = await PostPageAsync(pagedRequest,sub.TaskId, DateTime.Now.ToString("yyyyMMdd")); - if (result.code == "200") + if(result.code == "200") { _jobDbContext.BulkUpdate(records); sub.SyncedPageCount = i; diff --git a/API/Wood.Service/Controllers/LogService.cs b/API/Wood.Service/Controllers/LogConsumerService.cs similarity index 100% rename from API/Wood.Service/Controllers/LogService.cs rename to API/Wood.Service/Controllers/LogConsumerService.cs diff --git a/API/Wood.Service/Controllers/LogController.cs b/API/Wood.Service/Controllers/LogController.cs index 41ae0a3..26e4cc3 100644 --- a/API/Wood.Service/Controllers/LogController.cs +++ b/API/Wood.Service/Controllers/LogController.cs @@ -17,18 +17,14 @@ using TaskManager.Entity; using TaskManager.EntityFramework; using TaskManager.EntityFramework.Repository; using Wood.Service.Controllers; +using System; +using System.Threading; +using System.Threading.Channels; +using System.Threading.Tasks; namespace TaskManager.Controllers { - using System; - using System.Threading; - using System.Threading.Channels; - using System.Threading.Tasks; - - - - public class LogController { diff --git a/API/Wood.Service/Controllers/RecurringJobBaseController.cs b/API/Wood.Service/Controllers/RecurringJobBaseController.cs index de469b9..03e859f 100644 --- a/API/Wood.Service/Controllers/RecurringJobBaseController.cs +++ b/API/Wood.Service/Controllers/RecurringJobBaseController.cs @@ -98,7 +98,7 @@ namespace TaskManager.Controllers - ////string jsonContent = System.IO.File.ReadAllText("采购订单.json"); + //string jsonContent = System.IO.File.ReadAllText("采购订单.json"); //// string jsonContent = System.IO.File.ReadAllText("过焊装未过总装.json"); //// string jsonContent = System.IO.File.ReadAllText("计划协议.json"); ////string jsonContent = System.IO.File.ReadAllText("奇瑞RDC共享库存.json"); @@ -106,7 +106,7 @@ namespace TaskManager.Controllers //string jsonContent = System.IO.File.ReadAllText("日物料需求计划.json"); ////string jsonContent = System.IO.File.ReadAllText("整车月度生产计划1.json"); - ///string jsonContent = System.IO.File.ReadAllText("M+6月物料需求计划1.json"); + //string jsonContent = System.IO.File.ReadAllText("M+6月物料需求计划1.json"); //string jsonContent = System.IO.File.ReadAllText("过涂装未过总装.json"); //return jsonContent;