From fb41e05c42b73d9fcd9c65f6024bba56d4383f70 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 2 Apr 2024 14:11:11 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E9=A4=90=E8=A1=A5=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rdController.cs => MealSupplementsRecordController.cs} | 4 ++-- .../Request/MealSupplementRecordRequest.cs | 8 ++++++-- .../Services/Implements/MealSupplementRecordService.cs | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) rename Src/Dlhis.Canteen/MealSupplementRecord/Controller/{MealSupplementRecordController.cs => MealSupplementsRecordController.cs} (86%) diff --git a/Src/Dlhis.Canteen/MealSupplementRecord/Controller/MealSupplementRecordController.cs b/Src/Dlhis.Canteen/MealSupplementRecord/Controller/MealSupplementsRecordController.cs similarity index 86% rename from Src/Dlhis.Canteen/MealSupplementRecord/Controller/MealSupplementRecordController.cs rename to Src/Dlhis.Canteen/MealSupplementRecord/Controller/MealSupplementsRecordController.cs index 5e0a8418..a56b1519 100644 --- a/Src/Dlhis.Canteen/MealSupplementRecord/Controller/MealSupplementRecordController.cs +++ b/Src/Dlhis.Canteen/MealSupplementRecord/Controller/MealSupplementsRecordController.cs @@ -13,11 +13,11 @@ namespace Dlhis.Canteen.MealSupplementRecord.Controller; [Authorize] [Route("api/[controller]")] [ApiController] -public class MealSupplementRecordController +public class MealSupplementsRecordController { private readonly IMealSupplementRecordService _mealSupplementRecordService; - public MealSupplementRecordController(IMealSupplementRecordService mealSupplementRecordService) + public MealSupplementsRecordController(IMealSupplementRecordService mealSupplementRecordService) { _mealSupplementRecordService = mealSupplementRecordService; } diff --git a/Src/Dlhis.Canteen/MealSupplementRecord/Request/MealSupplementRecordRequest.cs b/Src/Dlhis.Canteen/MealSupplementRecord/Request/MealSupplementRecordRequest.cs index 93d14930..a23341ab 100644 --- a/Src/Dlhis.Canteen/MealSupplementRecord/Request/MealSupplementRecordRequest.cs +++ b/Src/Dlhis.Canteen/MealSupplementRecord/Request/MealSupplementRecordRequest.cs @@ -1,8 +1,12 @@ -using Kurisu.Core.DataAccess.Dto; +using Kurisu.Core.CustomClass; +using Kurisu.Core.DataAccess.Dto; namespace Dlhis.Canteen.MealSupplementRecord.Request; public class MealSupplementRecordRequest : PageDto { - + /// + /// 餐补日期范围 + /// + public DateTimePeriod DateTimePeriod { get; set; } } diff --git a/Src/Dlhis.Canteen/MealSupplementRecord/Services/Implements/MealSupplementRecordService.cs b/Src/Dlhis.Canteen/MealSupplementRecord/Services/Implements/MealSupplementRecordService.cs index 2d1630ee..69d28cd3 100644 --- a/Src/Dlhis.Canteen/MealSupplementRecord/Services/Implements/MealSupplementRecordService.cs +++ b/Src/Dlhis.Canteen/MealSupplementRecord/Services/Implements/MealSupplementRecordService.cs @@ -1,6 +1,5 @@ using Dlhis.Canteen.MealSupplementRecord.Request; using Dlhis.Canteen.MealSupplementRecord.Response; -using Dlhis.Canteen.MealSupplementRecord.Services; using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Canteen.Entities; using Kurisu.AspNetCore.Utils.Extensions; @@ -25,6 +24,8 @@ public class MealSupplementRecordService : IMealSupplementRecordService var page = await _dbContext.Queryable() .LeftJoin((x, ga) => x.Code == ga.Code) .WhereIF(request.Search.IsPresent(), (x, ga) => x.Code == request.Search || ga.Name.Contains(request.Search)) + .WhereIF(request.DateTimePeriod?.Start.HasValue == true && request.DateTimePeriod?.End.HasValue == true, + x => x.Date >= request.DateTimePeriod.Start && x.Date <= request.DateTimePeriod.End) .Select((x, ga) => new MealSupplementRecordResponse { Amount = x.Amount,