cameraDirectLogin from admin - fix bug at GetWorkshopAbsentHistory

This commit is contained in:
SamSys
2024-12-12 14:55:55 +03:30
parent 67d16e0295
commit 331f20619e
18 changed files with 259 additions and 128 deletions

View File

@@ -377,8 +377,9 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
//roll calls for current workshop where shift start is in dateIndex date (filters today's shifts)
var rollCallsQuery = _context.RollCalls
.Where(x => x.WorkshopId == workshopId && x.StartDate.HasValue &&
x.StartDate.Value.Date >= startSearch.Date && x.StartDate.Value.Date <= endSearch.Date && x.RollCallModifyType != RollCallModifyType.Undefined &&
x.RollCallModifyType != RollCallModifyType.CutByBgService);
x.StartDate.Value.Date >= startSearch.Date && x.StartDate.Value.Date <= endSearch.Date &&
x.RollCallModifyType != RollCallModifyType.Undefined);
//get active employees of workshop in dateIndex date
@@ -409,7 +410,6 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
EmployeeFullName = x.EmployeeFullName,
Id = x.id,
WorkshopId = x.WorkshopId
}),
IsHoliday = _holidayItemApplication.IsHoliday(day),
IsFriday = day.DayOfWeek == DayOfWeek.Friday
@@ -419,6 +419,19 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
return result;
}
public List<RollCallViewModel> GetEmployeeRollCallsHistoryAllByDate(long workshopId, long employeeId, DateTime start, DateTime end)
{
return _context.RollCalls.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId &&
x.EndDate.Value.Date >= start.Date && x.StartDate.Value.Date <= end.Date)
.Select(x => new RollCallViewModel
{
EmployeeId = employeeId,
WorkshopId = workshopId,
StartDate = x.StartDate,
EndDate = x.EndDate
}).ToList();
}
//سوابق حضور غیاب کارگاه
public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel)
{