From 7402d75ed20e7941b3e9da40d2086f61da73c228 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Sat, 11 Oct 2025 13:46:00 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=94=AF=E6=8C=81=E6=9C=88=E4=BB=BD?= =?UTF-8?q?=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AssignmentsController.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/AssignmentsController.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/AssignmentsController.cs index ea5a70c9..938545b7 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/AssignmentsController.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Controllers/AssignmentsController.cs @@ -5,6 +5,7 @@ using Dlhis.Entity.Canteen.Enums; using Dlhis.ScheduledTask.TaskAssignment.Request; using Dlhis.ScheduledTask.TaskAssignment.Response; using Dlhis.ScheduledTask.TaskAssignment.Services; +using Kurisu.AspNetCore.CustomClass; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; using Kurisu.AspNetCore.DataAccess.SqlSugar.Services; using Kurisu.AspNetCore.UnifyResultAndValidation.Aop; @@ -69,12 +70,17 @@ public class AssignmentsController : ControllerBase } [AllowAnonymous] - [HttpPost("balance/calc")] + [HttpPost("balance/calc/{month:int}")] [IgnoreTenant] - public async Task Calc() + public async Task Calc([FromQuery] int month) { - var s = new DateTime(2025, 8, 1); - var e = new DateTime(2025, 9, 1); + if (month is < 1 or > 12) + { + throw new UserFriendlyException("月份错误"); + } + + var s = new DateTime(2025, month, 1); + var e = new DateTime(2025, month + 1, 1); var userCodes = await _dbContext.Queryable() .Where(x => SqlFunc.Subqueryable().Where(p => p.UserCode == x.UserCode).NotAny())