From 5eb15c4a4e104656a5b88c93986fb5a96df3fc3b Mon Sep 17 00:00:00 2001 From: git_rabbit Date: Wed, 28 Jan 2026 18:44:44 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=B7=A5=E5=8D=95=E6=97=A5=E5=BF=97):?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E5=B7=A5=E5=8D=95=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E7=B1=BB=E5=9E=8B=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将WorkOrderLog方法的返回类型从int改为List,并实现查询工单变更日志功能 --- .../MES/Product/ProWorkorderController.cs | 4 ++-- .../Product/IService/IProWorkorderService.cs | 2 +- .../IService/IProWorkorderUtilityService.cs | 4 ++-- .../MES/Product/ProWorkorderService.cs | 4 ++-- .../MES/Product/ProWorkorderUtilityService.cs | 18 ++++++++++++------ 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/DOAN.Admin.WebApi/Controllers/MES/Product/ProWorkorderController.cs b/DOAN.Admin.WebApi/Controllers/MES/Product/ProWorkorderController.cs index 531025a..5284dcb 100644 --- a/DOAN.Admin.WebApi/Controllers/MES/Product/ProWorkorderController.cs +++ b/DOAN.Admin.WebApi/Controllers/MES/Product/ProWorkorderController.cs @@ -348,13 +348,13 @@ namespace DOAN.Admin.WebApi.Controllers //TODO 工单变更日志 [HttpGet("workorder_log")] - public IActionResult WorkOrderLog(string workorder, string log) + public IActionResult WorkOrderLog(string workorder) { if (string.IsNullOrEmpty(workorder)) { return SUCCESS(null); } - var response = _ProWorkorderService.WorkOrderLog(workorder, log, HttpContext.GetName()); + var response = _ProWorkorderService.WorkOrderLog(workorder); return SUCCESS(response); } diff --git a/DOAN.Service/MES/Product/IService/IProWorkorderService.cs b/DOAN.Service/MES/Product/IService/IProWorkorderService.cs index f37d255..eba0d83 100644 --- a/DOAN.Service/MES/Product/IService/IProWorkorderService.cs +++ b/DOAN.Service/MES/Product/IService/IProWorkorderService.cs @@ -62,7 +62,7 @@ namespace DOAN.Service.MES.product.IService List SearchBOMNum(string workorder_num); - int WorkOrderLog(string workorder, string log, string Operator); + List WorkOrderLog(string workorder); Task<(string, Stream)> ExportPDFByQuestPDFDemo(string[] workorderArray); Task PrintTicketsByTemplate(ProWorkorderExportDto param); diff --git a/DOAN.Service/MES/Product/IService/IProWorkorderUtilityService.cs b/DOAN.Service/MES/Product/IService/IProWorkorderUtilityService.cs index a400951..4da9e56 100644 --- a/DOAN.Service/MES/Product/IService/IProWorkorderUtilityService.cs +++ b/DOAN.Service/MES/Product/IService/IProWorkorderUtilityService.cs @@ -34,13 +34,13 @@ namespace DOAN.Service.MES.product.IService List SearchBOMNum(string workorder_num); /// - /// 工单日志 + /// 工单变更日志 /// /// /// /// /// - int WorkOrderLog(string workorder, string log, string Operator); + List WorkOrderLog(string workorder); /// /// 导出PDF diff --git a/DOAN.Service/MES/Product/ProWorkorderService.cs b/DOAN.Service/MES/Product/ProWorkorderService.cs index ce256c8..1277a6e 100644 --- a/DOAN.Service/MES/Product/ProWorkorderService.cs +++ b/DOAN.Service/MES/Product/ProWorkorderService.cs @@ -222,9 +222,9 @@ namespace DOAN.Service.MES.product /// /// /// - public int WorkOrderLog(string workorder, string log, string Operator) + public List WorkOrderLog(string workorder) { - return _utilityService.WorkOrderLog(workorder, log, Operator); + return _utilityService.WorkOrderLog(workorder); } /// diff --git a/DOAN.Service/MES/Product/ProWorkorderUtilityService.cs b/DOAN.Service/MES/Product/ProWorkorderUtilityService.cs index 281b2e4..5d5726d 100644 --- a/DOAN.Service/MES/Product/ProWorkorderUtilityService.cs +++ b/DOAN.Service/MES/Product/ProWorkorderUtilityService.cs @@ -9,7 +9,10 @@ namespace DOAN.Service.MES.product /// /// 工单工具服务 /// - [AppService(ServiceType = typeof(IProWorkorderUtilityService), ServiceLifetime = LifeTime.Transient)] + [AppService( + ServiceType = typeof(IProWorkorderUtilityService), + ServiceLifetime = LifeTime.Transient + )] public class ProWorkorderUtilityService : BaseService, IProWorkorderUtilityService { /// @@ -109,17 +112,20 @@ namespace DOAN.Service.MES.product } /// - /// 工单日志 + /// 工单变更日志 /// /// /// /// /// - public int WorkOrderLog(string workorder, string log, string Operator) + public List WorkOrderLog(string workorder) { - // 这里需要实现工单日志记录逻辑 - // 暂时返回成功 - return 1; + var result = Context + .Queryable() + .Where(it => it.Workorder == workorder) + .OrderByDescending(it => it.ChangeTime) + .ToList(); + return result; } ///