fix 离职人员显示问题

This commit is contained in:
2025-05-20 12:29:01 +08:00
parent 9174f5ed37
commit 7188077442

View File

@@ -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<GainfoLeaveEntity>().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<DeviceUploadLogResponse>
{
PageIndex = request.PageIndex,