AsSpliterQuery adde on AdminWorkflow metods - update new changes admin workflow
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user