From 5b15d95d062a81312309cc7e7bc841344c3cc635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=81=20=E4=BB=BB?= Date: Wed, 21 May 2025 16:03:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ServiceApp/DroneSsnydManage/DroneSsnyApp.cs | 12 ++++++++++-- .../ServiceControllers/DroneSsnyController.cs | 14 ++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/OpenAuth.App/ServiceApp/DroneSsnydManage/DroneSsnyApp.cs b/OpenAuth.App/ServiceApp/DroneSsnydManage/DroneSsnyApp.cs index 65da1e2..de13946 100644 --- a/OpenAuth.App/ServiceApp/DroneSsnydManage/DroneSsnyApp.cs +++ b/OpenAuth.App/ServiceApp/DroneSsnydManage/DroneSsnyApp.cs @@ -9,6 +9,8 @@ using System.Threading.Tasks; using OpenAuth.App.Interface; using SqlSugar; using Infrastructure; +using DocumentFormat.OpenXml.Spreadsheet; +using NPOI.SS.Formula.Functions; namespace OpenAuth.App.ServiceApp.DroneSsnydManage { @@ -25,12 +27,15 @@ namespace OpenAuth.App.ServiceApp.DroneSsnydManage /// /// /// - public PageInfo> TimeoutWarning(int pageIndex, int pageSize) + public PageInfo> TimeoutWarning(string xiangmumc, string countyid, string streetid, int pageIndex, int pageSize) { int totalCount = 0; var endTime = DateTime.Now.AddMonths(2); var list = base.Repository.AsQueryable() + .WhereIF(!string.IsNullOrEmpty(xiangmumc),a=>a.xiangmu_name.Contains(xiangmumc)) + .WhereIF(!string.IsNullOrEmpty(countyid),a=>a.countyid==countyid) + .WhereIF(!string.IsNullOrEmpty(streetid),a=>a.streetid==streetid) .Where(a => a.end_time <= endTime&&a.end_time>DateTime.Now) .OrderBy(a => a.end_time, OrderByType.Desc) .ToPageList(pageIndex, pageSize, ref totalCount); @@ -48,12 +53,15 @@ namespace OpenAuth.App.ServiceApp.DroneSsnydManage /// /// /// - public PageInfo> TimeOutAlarmList(int pageIndex, int pageSize) + public PageInfo> TimeOutAlarmList(string xiangmumc, string countyid, string streetid, int pageIndex, int pageSize) { int totalCount = 0; var endTime = DateTime.Now; var list = base.Repository.AsQueryable() + .WhereIF(!string.IsNullOrEmpty(xiangmumc), a => a.xiangmu_name.Contains(xiangmumc)) + .WhereIF(!string.IsNullOrEmpty(countyid), a => a.countyid == countyid) + .WhereIF(!string.IsNullOrEmpty(streetid), a => a.streetid == streetid) .Where(a => a.end_time a.end_time, OrderByType.Desc) .ToPageList(pageIndex, pageSize, ref totalCount); diff --git a/OpenAuth.WebApi/Controllers/ServiceControllers/DroneSsnyController.cs b/OpenAuth.WebApi/Controllers/ServiceControllers/DroneSsnyController.cs index 52d1aef..1fa4ab0 100644 --- a/OpenAuth.WebApi/Controllers/ServiceControllers/DroneSsnyController.cs +++ b/OpenAuth.WebApi/Controllers/ServiceControllers/DroneSsnyController.cs @@ -23,16 +23,19 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers /// /// 超期预警 /// + /// 项目名称 + /// 县 + /// 镇 /// /// /// [HttpGet] - public Response>> TimeoutWarning(int page, int limit) + public Response>> TimeoutWarning(string xiangmumc, string countyid, string streetid, int page, int limit) { var response = new Response>>(); try { - response.Result = droneSsnyApp.TimeoutWarning(page, limit); + response.Result = droneSsnyApp.TimeoutWarning(xiangmumc, countyid, streetid,page, limit); } catch (Exception ex) { @@ -45,16 +48,19 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers /// /// 超期报警 /// + /// 项目名称 + /// 县 + /// 镇 /// /// /// [HttpGet] - public Response>> TimeOutAlarmList(int page, int limit) + public Response>> TimeOutAlarmList(string xiangmumc, string countyid,string streetid,int page, int limit) { var response = new Response>>(); try { - response.Result = droneSsnyApp.TimeOutAlarmList(page, limit); + response.Result = droneSsnyApp.TimeOutAlarmList(xiangmumc, countyid, streetid, page, limit); } catch (Exception ex) {