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,