AsSpliterQuery adde on AdminWorkflow metods - update new changes admin workflow

This commit is contained in:
SamSys
2025-01-07 18:51:13 +03:30
parent 9b1f141dec
commit db79e8ecf1
8 changed files with 139 additions and 49 deletions

View File

@@ -803,28 +803,28 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
if (endSearch.Date == DateTime.Now.Date)
endSearch = endSearch.AddDays(-1);
//get leaves for workshop that have been activated in dateIndex date
var leavesQuery = _context.LeaveList.Where(x => x.WorkshopId == workshopId &&
x.IsAccepted && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) &&
x.EndLeave.Date >= startSearch.Date && x.StartLeave.Date <= endSearch.Date);
var leavesQuery = _context.LeaveList.AsSplitQuery().Where(x => x.WorkshopId == workshopId &&
x.IsAccepted && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) &&
x.EndLeave.Date >= startSearch.Date && x.StartLeave.Date <= endSearch.Date);
//roll calls for current workshop where shift start is in dateIndex date (filters today's shifts)
var rollCallsQuery = _context.RollCalls
var rollCallsQuery = _context.RollCalls.AsSplitQuery()
.Where(x => x.WorkshopId == workshopId && x.StartDate.HasValue &&
x.StartDate.Value.Date >= startSearch.Date && x.StartDate.Value.Date <= endSearch.Date &&
x.RollCallModifyType != RollCallModifyType.Undefined);
var withPersonnelCode = _context.PersonnelCodeSet.Where(x => x.WorkshopId == workshopId);
var withPersonnelCode = _context.PersonnelCodeSet.AsSplitQuery().Where(x => x.WorkshopId == workshopId);
//get active employees of workshop in dateIndex date
var activeEmployeesQuery =
_context.RollCallEmployees.Include(x => x.EmployeesStatus)
_context.RollCallEmployees.AsSplitQuery().Include(x => x.EmployeesStatus)
.Where(x => x.WorkshopId == workshopId &&
x.EmployeesStatus.Any(y => y.EndDate.Date >= startSearch && y.StartDate.Date <= endSearch) &&
withPersonnelCode.Any(y => y.EmployeeId == x.EmployeeId));
var employeeSettingsList =
_context.CustomizeWorkshopEmployeeSettings.Where(x => x.WorkshopId == workshopId).ToList();
_context.CustomizeWorkshopEmployeeSettings.AsSplitQuery().Where(x => x.WorkshopId == workshopId).ToList();
var rollCallsList = rollCallsQuery.ToList();
var activatedEmployeesList = activeEmployeesQuery.ToList();
var leavesList = leavesQuery.ToList();