fix(api): StatWorkWorkLoadController исправлен запрос получения статистики, убраны лишние данные.
This commit is contained in:
@@ -124,8 +124,8 @@ namespace PARR.API.Controllers.V1.Statistics
|
|||||||
if (jobsRequests != null && jobsRequests.Count() > 0)
|
if (jobsRequests != null && jobsRequests.Count() > 0)
|
||||||
{
|
{
|
||||||
//appInWorksQuery = appInWorksQuery.Where(t => jobsRequests.Any(x => x.JobId == t.ApplicationInWorkId));
|
//appInWorksQuery = appInWorksQuery.Where(t => jobsRequests.Any(x => x.JobId == t.ApplicationInWorkId));
|
||||||
appInWorksQuery = appInWorksQuery.Where(t => jobsRequests.Select(j=>j.JobId).Any(x => x == t.ApplicationInWorkId));
|
appInWorksQuery = appInWorksQuery.Where(t => jobsRequests.Select(j => j.JobId).Any(x => x == t.ApplicationInWorkId));
|
||||||
workGroupsQuery = workGroupsQuery.Where(t => jobsRequests.Select(w=>w.WorkGroupId).Any(x => x == t.Id));
|
workGroupsQuery = workGroupsQuery.Where(t => jobsRequests.Select(w => w.WorkGroupId).Any(x => x == t.Id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -157,6 +157,10 @@ namespace PARR.API.Controllers.V1.Statistics
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// убираем не нужные значения так как запрос в SQL (query) был с несколькими Any
|
||||||
|
if (jobsRequests != null && jobsRequests.Count() > 0)
|
||||||
|
response = response.Where(t => jobsRequests.Any(x => x.WorkGroupId == t.WorkGroup.Id && x.JobId == t.Job.Id)).ToList();
|
||||||
|
|
||||||
response = response.OrderBy(t => t.Job.ShortDescription).ThenBy(t => t.Job.Application?.Name).ThenBy(t => t.WorkGroup.Name).ToList();
|
response = response.OrderBy(t => t.Job.ShortDescription).ThenBy(t => t.Job.Application?.Name).ThenBy(t => t.WorkGroup.Name).ToList();
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
|
|||||||
Reference in New Issue
Block a user