From 6ec528f2817853df5b8eeb219aa980d89addee86 Mon Sep 17 00:00:00 2001 From: "qianhao.xu" Date: Wed, 17 Jul 2024 14:28:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MES/product/ProWorkorderController.cs | 19 +++++++++++++++++++ .../product/IService/IProWorkorderService.cs | 4 ++++ .../MES/product/ProWorkorderService.cs | 12 ++++++++++-- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/DOAN.Admin.WebApi/Controllers/MES/product/ProWorkorderController.cs b/DOAN.Admin.WebApi/Controllers/MES/product/ProWorkorderController.cs index 88c86b1..17f8f93 100644 --- a/DOAN.Admin.WebApi/Controllers/MES/product/ProWorkorderController.cs +++ b/DOAN.Admin.WebApi/Controllers/MES/product/ProWorkorderController.cs @@ -9,6 +9,8 @@ using DOAN.Admin.WebApi.Filters; using Org.BouncyCastle.Crypto; using DOAN.Model.System; using MiniExcelLibs; +using DOAN.Model.System.Dto; +using DOAN.Model; //创建时间:2024-07-16 namespace DOAN.Admin.WebApi.Controllers @@ -195,5 +197,22 @@ namespace DOAN.Admin.WebApi.Controllers } + + /// + /// 工单导出 + /// + /// + /// + [HttpGet("export")] + [Log(Title = "工单导出", BusinessType = BusinessType.EXPORT)] + + public IActionResult WorkOrderExport([FromQuery] DateTime extportDate) + { + var list = _ProWorkorderService.WorkOrderExport(extportDate, new PagerInfo(1, 10000)); + + var result = ExportExcelMini(list.Result, "workorder", $"工单列表{extportDate}"); + return ExportExcel(result.Item2, result.Item1); + } + } } \ No newline at end of file diff --git a/DOAN.Service/MES/product/IService/IProWorkorderService.cs b/DOAN.Service/MES/product/IService/IProWorkorderService.cs index de56b8d..6f8f0ba 100644 --- a/DOAN.Service/MES/product/IService/IProWorkorderService.cs +++ b/DOAN.Service/MES/product/IService/IProWorkorderService.cs @@ -3,6 +3,8 @@ using DOAN.Model; using DOAN.Model.MES.product; using DOAN.Model.MES.product.Dto; +using DOAN.Model.System.Dto; +using DOAN.Model.System; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -30,5 +32,7 @@ namespace DOAN.Service.MES.product.IService int ImportData(IFormFile formFile,string username); + public PagedInfo WorkOrderExport(DateTime exportTime, PagerInfo pager); + } } diff --git a/DOAN.Service/MES/product/ProWorkorderService.cs b/DOAN.Service/MES/product/ProWorkorderService.cs index 04ed738..2cb178f 100644 --- a/DOAN.Service/MES/product/ProWorkorderService.cs +++ b/DOAN.Service/MES/product/ProWorkorderService.cs @@ -494,8 +494,16 @@ namespace DOAN.Service.MES.product }); return result; } - - + /// + /// 工单导出 + /// + /// + /// + /// + public PagedInfo WorkOrderExport(DateTime exportTime, PagerInfo pager) + { + return Context.Queryable().Where(it => it.WorkorderDate == exportTime).ToPage(pager); + } }