fix .
This commit is contained in:
@@ -90,7 +90,7 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
/// <inheritdoc />
|
||||
public async Task<List<WorkGridScheduleResponse>> GetListAsync(Guid workGridCode, DateOnly date, WorkGridTimePeriodEnumType? periodType)
|
||||
{
|
||||
return await _dbContext.Queryable<WorkGridScheduleEntity>()
|
||||
var data = await _dbContext.Queryable<WorkGridScheduleEntity>()
|
||||
.LeftJoin<GainfoEntity>((x, ga) => x.UserCode == ga.Code)
|
||||
.Where(x => x.WorkGridCode == workGridCode && x.Date == date)
|
||||
.WhereIF(periodType.HasValue, x => x.PeriodType == periodType)
|
||||
@@ -102,6 +102,16 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
UserName = ga.Name
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
var userCodes = data.Select(x => x.UserCode).ToList();
|
||||
var maximumConsecutiveUserCodes = await MaximumConsecutiveUserCodesAsync(userCodes, 1, date);
|
||||
|
||||
foreach (var item in data)
|
||||
{
|
||||
item.MaximumConsecutiveSchedules = maximumConsecutiveUserCodes.FirstOrDefault(x => x.UserCode == item.UserCode);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user