From 9edc5041fa2c7e5c758e6f419bc918c84b4fdc55 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Fri, 10 Jan 2025 17:22:16 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=85=BC=E5=AE=B9=E8=80=81=E6=A1=A3?= =?UTF-8?q?=E6=A1=88=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Implements/DeviceUploadLogService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs index 08fe22b4..844e29d4 100644 --- a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs +++ b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs @@ -37,7 +37,9 @@ public class DeviceUploadLogService : IDeviceUploadLogService var userCodes = requests.Where(x => x.UserUniqueNo.IsPresent()).Select(x => x.UserUniqueNo).Distinct().ToList(); var gainfo1 = await _dbContext.Queryable().Where(x => userCodes.Contains(x.Code)).Select(x => new { x.Code, x.Type }).ToListAsync(); var gainfo2 = await _dbContext.Queryable().AS("GainfoLeave").Where(x => userCodes.Contains(x.Code)).Select(x => new { x.Code, x.Type }).ToListAsync(); - var gainfos = gainfo1.Concat(gainfo2).DistinctBy(x => x.Code).ToList(); + var gainfoCardNos = requests.Where(x => x.CardNo.IsPresent() && x.UserUniqueNo != x.CardNo).Select(x => x.CardNo).Distinct().ToList(); + var gainfo3 = await _dbContext.Queryable().Where(x => gainfoCardNos.Contains(x.Code)).Select(x => new { x.Code, x.Type }).ToListAsync(); + var gainfos = gainfo1.Concat(gainfo2).Concat(gainfo3).DistinctBy(x => x.Code).ToList(); var inserts = new List(); foreach (var request in requests.Where(x => existsDeviceUniqueNos.Contains(x.DeviceUniqueNo)))