From 718807744263569675abaa68128aa54a17f6e01e Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 20 May 2025 12:29:01 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=A6=BB=E8=81=8C=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implements/DeviceUploadLogService.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs index d32d3b4e..d9409540 100644 --- a/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs +++ b/Src/Dlhis.ScheduledTask/DeviceUploadLog/Services/Implements/DeviceUploadLogService.cs @@ -214,8 +214,8 @@ public class DeviceUploadLogService : IDeviceUploadLogService } } } - - needUpload = workGridInfo.WorkGrid == null || workGridInfo.PeriodType.HasValue; + + needUpload = workGridInfo.WorkGrid == null || workGridInfo.PeriodType.HasValue; workGridInfo.IsError = !needUpload; if (!needUpload) { @@ -500,7 +500,7 @@ public class DeviceUploadLogService : IDeviceUploadLogService CreateTime = x.CreateTime, SerialNo = x.SerialNo, UserNo = ga.No, - UserCode = ga.Code, + UserCode = x.UserUniqueNo, UserName = ga.Name, DeployPlace = device.DeployPlace, NeedUpload = x.NeedUpload, @@ -509,6 +509,16 @@ public class DeviceUploadLogService : IDeviceUploadLogService WorkGridInfo = x.WorkGridInfo }).ToPageListAsync(request.PageIndex, request.PageSize); + var userCodes = r.Where(x => x.UserName.IsEmpty()).Select(x => x.UserCode).Distinct().ToList(); + var gainfoLeaves = await _dbContext.Queryable().Where(x => userCodes.Contains(x.Code)).Select(x => new { x.Code, x.Name }).ToListAsync(); + r.ForEach(item => + { + if (item.UserName.IsEmpty()) + { + item.UserName = gainfoLeaves.FirstOrDefault(x => x.Code == item.UserCode)?.Name; + } + }); + return new Pagination { PageIndex = request.PageIndex,