feat: Из dal перенесены все модели в Domain. Из dal переименованы service в repository, вынесены в Core.
This commit is contained in:
@@ -3,11 +3,11 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.BLL.Helpers;
|
||||
using PARR.Core.Common.Interfaces.RabbitServices;
|
||||
using PARR.Core.Repositories.Interfaces;
|
||||
using PARR.Core.Repositories.Interfaces.Schedule;
|
||||
using PARR.DAL.Contracts;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.NextRunServices;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
using PARR.DAL.Services.Interfaces.Schedule;
|
||||
using PARR.Domain.Entities;
|
||||
using PARR.Domain.Entities.Base.History;
|
||||
using PARR.Domain.Enums;
|
||||
using PARR.EsppScheduleSync.Domain;
|
||||
@@ -89,7 +89,7 @@ namespace PARR.EsppScheduleSync
|
||||
private async Task GetNoneExcludeCalendarEsppValueAsync()
|
||||
{
|
||||
using var scope = serviceProvider.CreateScope();
|
||||
var service = scope.ServiceProvider.GetRequiredService<IScheduleExcludeTypeService>();
|
||||
var service = scope.ServiceProvider.GetRequiredService<IScheduleExcludeTypeRepository>();
|
||||
|
||||
var noneExcludeType = await service.Get().AsNoTracking().FirstOrDefaultAsync(t => t.Code == nameof(ScheduleExcludeTypeEnum.None));
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace PARR.EsppScheduleSync
|
||||
var esppTemplateName = esppObject.TemplateName;
|
||||
|
||||
using var scope = serviceProvider.CreateScope();
|
||||
var templateService = scope.ServiceProvider.GetRequiredService<ITemplateService>();
|
||||
var templateService = scope.ServiceProvider.GetRequiredService<ITemplateRepository>();
|
||||
|
||||
// это не очень, так как esppScheduleId может быть null или empty, а в БД таких значений может быть много
|
||||
//var candidates = await templateService.Get()
|
||||
@@ -159,7 +159,7 @@ namespace PARR.EsppScheduleSync
|
||||
esppScheduleId, esppTemplateName, templateByScheduleId.Name, templateByScheduleId.Id);
|
||||
|
||||
// Принудительно выставляем статус обновления шаблона, так как имя в ЕСПП изменилось
|
||||
var robotConfigurationService = scope.ServiceProvider.GetRequiredService<IRobotConfigurationService>();
|
||||
var robotConfigurationService = scope.ServiceProvider.GetRequiredService<IRobotConfigurationRepository>();
|
||||
var config = robotConfigurationService.GetFromTemplateByRobotCode(RobotsEnum.TemplateOrder, templateByScheduleId);
|
||||
|
||||
logger.LogDebug("Текущий статус задания {taskStatusCode} шаблона {templateId}", config.TaskStatusCode, templateByScheduleId.Id);
|
||||
@@ -438,9 +438,9 @@ namespace PARR.EsppScheduleSync
|
||||
{
|
||||
using (var scope = serviceProvider.CreateScope())
|
||||
{
|
||||
var esppSchTypeConfigService = scope.ServiceProvider.GetService<IEsppSchTypeConfigService>();
|
||||
var esppSchTypeConfigService = scope.ServiceProvider.GetService<IEsppSchTypeConfigRepository>();
|
||||
if (esppSchTypeConfigService == null)
|
||||
throw new Exception($"Не найден сервис: {nameof(IEsppSchTypeConfigService)}");
|
||||
throw new Exception($"Не найден сервис: {nameof(IEsppSchTypeConfigRepository)}");
|
||||
|
||||
var esppSchedule = esppSchTypeConfigService.GetEsppScheduleDto(template.Job!.GroupId);
|
||||
if (esppSchedule == null)
|
||||
|
||||
Reference in New Issue
Block a user