From 2e92ba82af5acbaf8242702143e29c9bca532162 Mon Sep 17 00:00:00 2001 From: guob yuano Date: Wed, 30 Sep 2026 11:04:38 +0800 Subject: [PATCH] =?UTF-8?q?LW=E5=B7=A5=E5=8F=B7=E5=8A=B3=E5=8A=A1=E4=B8=8D?= =?UTF-8?q?=E5=8F=91=E6=94=BE=E7=94=9F=E6=97=A5=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Voucher/Services/Implements/BirthdayVoucherService.cs | 6 ++++++ Src/Dlhis.ScheduledTask/Jobs/BirthdayCostUploadJob.cs | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Src/Dlhis.Canteen/Voucher/Services/Implements/BirthdayVoucherService.cs b/Src/Dlhis.Canteen/Voucher/Services/Implements/BirthdayVoucherService.cs index fd818319..cd819005 100644 --- a/Src/Dlhis.Canteen/Voucher/Services/Implements/BirthdayVoucherService.cs +++ b/Src/Dlhis.Canteen/Voucher/Services/Implements/BirthdayVoucherService.cs @@ -245,6 +245,7 @@ public class BirthdayVoucherService : BaseVoucherService, IVoucherService .Where(x => x.Birthday.HasValue) //.Where(x => !string.IsNullOrEmpty(x.CostId)) // 正常情况:匹配当天生日 + // 注意:LW 劳务派遣工号统一在下方返回前过滤,不能在此处 SQL 过滤,否则留痕事件无法写入 .WhereIF(isToday && !includeLeapDayBirthday, x => SqlFunc.DateValue(x.Birthday.Value, DateType.Month) == begin.Month && SqlFunc.DateValue(x.Birthday.Value, DateType.Day) == begin.Day) // 特殊情况:非闰年的2月28日,同时匹配当天生日和2月29日生日 .WhereIF(isToday && includeLeapDayBirthday, x => @@ -272,12 +273,17 @@ public class BirthdayVoucherService : BaseVoucherService, IVoucherService { events.Add(new UserBusinessEventEntity { UserCode = gainfo.Code, EventType = "GenerateBirthdayVoucher", Content = "成本中心为空" }); } + else if (gainfo.Code.StartsWith("LW", StringComparison.OrdinalIgnoreCase)) + { + events.Add(new UserBusinessEventEntity { UserCode = gainfo.Code, EventType = "GenerateBirthdayVoucher", Content = "LW工号劳务不发放生日券" }); + } } return (gainfos .Where(x => x.DepartmentNo.IsPresent()) .Where(x => !excludePositionNos.Contains(x.PositionNo)) .Where(x => x.CostId.IsPresent()) + .Where(x => !x.Code.StartsWith("LW", StringComparison.OrdinalIgnoreCase))//排除劳务派遣工号(LW 开头) .ToList(), events); } diff --git a/Src/Dlhis.ScheduledTask/Jobs/BirthdayCostUploadJob.cs b/Src/Dlhis.ScheduledTask/Jobs/BirthdayCostUploadJob.cs index 72379328..d3c8b036 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/BirthdayCostUploadJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/BirthdayCostUploadJob.cs @@ -33,7 +33,6 @@ public class BirthdayCostUploadJob : BaseJob var endDayOfMonth = e.AddDays(-1); var userCodeAll = await DbContext.Queryable() - .Where(x => !x.UserCode.StartsWith("LW")) .Select(x => x.UserCode) .Distinct() .ToListAsync();