From 7ca52f3c978504ad5f9c3d245c599103a85480c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=82=A5=E7=BE=8A?= <1048382248@qq.com> Date: Fri, 16 May 2025 10:11:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20ppt=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=88=86=E6=9E=90=E5=AE=8C=E6=88=90=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VideoAnalysisCore/Controllers/LJZK_Controller.cs | 7 ++++--- VideoAnalysisCore/Job/NodePackageJob.cs | 10 ++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/VideoAnalysisCore/Controllers/LJZK_Controller.cs b/VideoAnalysisCore/Controllers/LJZK_Controller.cs index db7aece..5922083 100644 --- a/VideoAnalysisCore/Controllers/LJZK_Controller.cs +++ b/VideoAnalysisCore/Controllers/LJZK_Controller.cs @@ -102,6 +102,9 @@ namespace VideoAnalysisCore.Controllers continue; if (videoIdArr.Contains(s.VideoCode)) continue; + var pptInfo = req.AnalyzeItems //ȡppt videoCode + .FirstOrDefault(x => x.AttachmentsInfoType == AttachmentsInfoType.PPT && s.StructurePageContentId == x.StructurePageContentId); + var pptCode = pptInfo?.VideoCode ?? (pptInfo?.VideoUrl??string.Empty); videos.Add(new VideoTask() { Id = YitIdHelper.NextId(), @@ -112,9 +115,7 @@ namespace VideoAnalysisCore.Controllers TagId = s.VideoCode, MediaUrl =s.VideoUrl, MediaName = s.VideoName, - PPTVideoCode = req.AnalyzeItems //ȡppt videoCode - .FirstOrDefault(x => x.AttachmentsInfoType == AttachmentsInfoType.PPT && s.StructurePageContentId == x.StructurePageContentId) - ?.VideoCode, + PPTVideoCode = pptCode, }); } await nodePackageInfoDB.InsertRangeAsync(nodePackages); diff --git a/VideoAnalysisCore/Job/NodePackageJob.cs b/VideoAnalysisCore/Job/NodePackageJob.cs index b895455..70938b9 100644 --- a/VideoAnalysisCore/Job/NodePackageJob.cs +++ b/VideoAnalysisCore/Job/NodePackageJob.cs @@ -48,16 +48,21 @@ namespace VideoAnalysisCore.Job .Where(s => s.EndTime != null) .Select(s => s.TagId) .ToArrayAsync(); + + var videoPPTArr = await videoTaskDB.AsQueryable() + .Where(s => s.EndTime != null) + .Select(s => s.PPTVideoCode) + .ToArrayAsync(); var postData = new List(); foreach (var item in taskArr) { - if (videoIdArr.Contains(item.VideoCode)) + if (videoIdArr.Contains(item.VideoCode)|| videoPPTArr.Contains(item.VideoCode)) { postData.Add(item); item.SuccessTime = DateTime.Now; } } - Console.WriteLine($"{DateTime.Now} 执行=>文件包任务 已完成任务回调 数量{postData.Count}"); + Console.WriteLine($"{DateTime.Now} 执行=>文件包任务 任务回调 数量{postData.Count} ..."); if (postData.Count() == 0) return; //var responseMessage = await new HttpClient() @@ -96,6 +101,7 @@ namespace VideoAnalysisCore.Job await Task.Delay(1000); } + Console.WriteLine($"{DateTime.Now} 执行=>文件包任务 已完成任务回调 数量{postData.Count}"); } } }