From 37a6f76d0ca3142c6fe395ff877866e0da4661a5 Mon Sep 17 00:00:00 2001 From: "qianhao.xu" Date: Tue, 3 Dec 2024 19:51:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=B7=A5=E5=8D=95=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E6=8A=A5=E5=B7=A5=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mobile/ReportFlowController.cs | 41 ++++++++++++++++++- .../Mobile/IService/IReportFlowService.cs | 2 + DOAN.Service/Mobile/ReportFlowService.cs | 7 +++- 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/DOAN.Admin.WebApi/Controllers/Mobile/ReportFlowController.cs b/DOAN.Admin.WebApi/Controllers/Mobile/ReportFlowController.cs index 228a9e2..80b265a 100644 --- a/DOAN.Admin.WebApi/Controllers/Mobile/ReportFlowController.cs +++ b/DOAN.Admin.WebApi/Controllers/Mobile/ReportFlowController.cs @@ -19,14 +19,32 @@ public class ReportFlowController : BaseController } //TODO 查询工单详情 + /// + /// 查询工单详情 + /// + /// 工单号 + /// + /// [HttpGet("get_workorder_detail")] public IActionResult GetWorkOrderDetail(string workOrder) { if (string.IsNullOrEmpty(workOrder)) throw new CustomException("workOrderId 是空"); - return SUCCESS(_reportFlowService.GetWorkOrderDetail(workOrder)); + var response = _reportFlowService.GetWorkOrderDetail(workOrder); + if (response == null) + { + return ToResponse(ResultCode.NO_DATA, "工单不存在"); + } + return SUCCESS(response); } //TODO 查询工序报工详情 + /// + /// 查询某个工序报工详情 + /// + /// + /// + /// + /// [HttpGet("get_process_reportwork_detail")] public IActionResult GetProcessReportWorkDetail(string workorder, string process) { @@ -38,6 +56,15 @@ public class ReportFlowController : BaseController } //TODO 工序报工 + /// + /// 工序报工 + /// + /// + /// + /// + /// + /// + /// [HttpGet("process_reportwork")] public IActionResult ProcessReportWork(string workorder, string process, int finish_num,int bad_num) { @@ -49,6 +76,18 @@ public class ReportFlowController : BaseController return SUCCESS(_reportFlowService.ProcessReportWork(workorder, process, finish_num,bad_num,HttpContext.GetNickName())); } + //TODO 获取工单下的报工列表 + [HttpGet("get_workorder_reportwork_list")] + public IActionResult GetWorkOrderReportWorkList(string workorder) + { + if (string.IsNullOrEmpty(workorder)) + { + throw new CustomException("workorder is null"); + } + + return SUCCESS(_reportFlowService.GetWorkOrderReportWorkList(workorder)); + } + } \ No newline at end of file diff --git a/DOAN.Service/Mobile/IService/IReportFlowService.cs b/DOAN.Service/Mobile/IService/IReportFlowService.cs index a3445ed..7ab8cb6 100644 --- a/DOAN.Service/Mobile/IService/IReportFlowService.cs +++ b/DOAN.Service/Mobile/IService/IReportFlowService.cs @@ -11,4 +11,6 @@ public interface IReportFlowService: IBaseService bool ProcessReportWork(string workorder, string process, int finish_num,int bad_num,string Worker); + List GetWorkOrderReportWorkList(string workorder); + } \ No newline at end of file diff --git a/DOAN.Service/Mobile/ReportFlowService.cs b/DOAN.Service/Mobile/ReportFlowService.cs index 833df49..daac218 100644 --- a/DOAN.Service/Mobile/ReportFlowService.cs +++ b/DOAN.Service/Mobile/ReportFlowService.cs @@ -56,6 +56,11 @@ public class ReportFlowService : BaseService, IReportFlowServic } return result>0; } - + + + public List GetWorkOrderReportWorkList(string workorder) + { + return Context.Queryable().Where(x => x.Workorder == workorder).ToList(); + } }