feat(unitFilter): Оптимизация фильрации юнитов. Проверка значений аттрибутов теперь выполняется в 2 запроса:
- проверяем доступные в базе значения - проверяем наличие значений в юнитах по id значений
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.Core.Common.Interfaces;
|
||||
using PARR.Core.Repositories.Interfaces.JobGroupRepositories;
|
||||
using PARR.Core.Repositories.Interfaces.JobRepositories;
|
||||
using PARR.Domain.Entities.Base.History;
|
||||
using PARR.Domain.Entities.JobEntities;
|
||||
using PARR.Domain.Enums;
|
||||
using PARR.EsppApi;
|
||||
using PARR.EsppApi.Constants;
|
||||
@@ -181,7 +182,7 @@ namespace PARR.Test
|
||||
{
|
||||
//Guid.Parse("cfb0d2dd-192a-4ed5-a29c-25f0abf61895"),//11010
|
||||
//Guid.Parse("79976eaf-be7b-42a0-a4e3-a89d7f68a18e"),//17
|
||||
Guid.Parse("6ff1de05-80c3-4b38-846b-0c793fd7fc8c")//318
|
||||
Guid.Parse("055ac0cc-10f7-4f96-baf6-9c8145b1332a")//318
|
||||
};
|
||||
|
||||
if (!jobIds.Any())
|
||||
@@ -235,22 +236,33 @@ namespace PARR.Test
|
||||
var templateMatcher = scope.ServiceProvider.GetRequiredService<ITemplateMatcher>();
|
||||
var groupRepository = scope.ServiceProvider.GetRequiredService<IJobGroupRepository>();
|
||||
|
||||
var groups = await groupRepository.Get().AsNoTracking()
|
||||
.Where(t => t.GroupType != null && t.GroupType.Code == JobGroupTypesEnum.Group)
|
||||
.Select(t => t.Id).ToHashSetAsync();
|
||||
await templateMatcher.SyncTemplatesForJob(Guid.Parse("055ac0cc-10f7-4f96-baf6-9c8145b1332a"),
|
||||
new HistoryInitiator
|
||||
{
|
||||
InitiatorIp = "10.99.246.156",
|
||||
InitiatorParrComponentId = ParrComponentsEnum.Master,
|
||||
InitiatorComment = "Тестовый проект. Синхронизация Группированых работ"
|
||||
|
||||
foreach (var groupId in groups)
|
||||
{
|
||||
await templateMatcher.SyncTemplatesForJobGroup(groupId,
|
||||
new HistoryInitiator
|
||||
{
|
||||
InitiatorIp = "10.99.246.156",
|
||||
InitiatorParrComponentId = ParrComponentsEnum.Master,
|
||||
InitiatorComment = "Тестовый проект. Синхронизация Группированых работ"
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
//var groups = await groupRepository.Get().AsNoTracking()
|
||||
// .Where(t => t.GroupType != null && t.GroupType.Code == JobGroupTypesEnum.Group)
|
||||
// .Select(t => t.Id).ToHashSetAsync();
|
||||
|
||||
|
||||
//foreach (var groupId in groups)
|
||||
//{
|
||||
// await templateMatcher.SyncTemplatesForJobGroup(groupId,
|
||||
// new HistoryInitiator
|
||||
// {
|
||||
// InitiatorIp = "10.99.246.156",
|
||||
// InitiatorParrComponentId = ParrComponentsEnum.Master,
|
||||
// InitiatorComment = "Тестовый проект. Синхронизация Группированых работ"
|
||||
|
||||
// }
|
||||
// );
|
||||
//}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Default": "Debug",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user