From a9eb4f6bed65399ce8689baca34fc00c0215401e Mon Sep 17 00:00:00 2001 From: liguoyang Date: Fri, 9 Jan 2026 10:51:44 +0800 Subject: [PATCH] =?UTF-8?q?fix=20DateTime=E6=97=B6=E9=97=B4=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.ScheduledTask/Jobs/CostUploadJob.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Src/Dlhis.ScheduledTask/Jobs/CostUploadJob.cs b/Src/Dlhis.ScheduledTask/Jobs/CostUploadJob.cs index 60f91015..96511477 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/CostUploadJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/CostUploadJob.cs @@ -28,19 +28,19 @@ public class CostUploadJob : BaseJob var month = now.Month == 1 ? 12 : now.Month - 1; var s = new DateTime(year, month, 1); - var e = new DateTime(year, month + 1, 1); + var e = s.AddMonths(1); var endDayOfMonth = e.AddDays(-1); //从余额找人 var userCodeAll = await DbContext.Queryable() - .Where(x => SqlFunc.Subqueryable() - .Where(p => p.Year == year && p.Month == month) - .Where(p => p.UserCode == x.UserCode).NotAny()) + .Where(x => + SqlFunc.Subqueryable().Where(p => p.Year == year && p.Month == month).Where(p => p.UserCode == x.UserCode).NotAny() + ) .Select(x => x.UserCode) .Distinct() .ToListAsync(); //var userCodeAll = await DbContext.Queryable().Where(x => x.Cost < 0).Select(x => x.UserCode).ToListAsync(); - Logger.LogInformation("CostUploadJob消费上传人员:{count},统计区间为{s}{e}", userCodeAll.Count, s.ToString("yyyy-MM-dd"), endDayOfMonth.ToString("yyyy-MM-dd")); + Logger.LogInformation("CostUploadJob消费上传人员:{count},统计区间为[{s}{e})", userCodeAll.Count, s.ToString("yyyy-MM-dd"), endDayOfMonth.ToString("yyyy-MM-dd")); foreach (var userCodes in userCodeAll.Chunk(100)) {