feat(espptemplatesync): метод обновление статуса Manager адаптирован на работу с RobotConfigurationService
This commit is contained in:
@@ -5,7 +5,6 @@ using PARR.DAL.Contracts;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
using PARR.EsppTemplateSync.Domain;
|
||||
using PARR.EsppTemplateSync.MappingProfiles;
|
||||
using PARR.EsppTemplateSync.Settings;
|
||||
|
||||
namespace PARR.EsppTemplateSync.Services
|
||||
@@ -17,13 +16,15 @@ namespace PARR.EsppTemplateSync.Services
|
||||
private readonly IParserService parserService;
|
||||
private readonly GlobalSettings globalSettings;
|
||||
private readonly IMapper mapper;
|
||||
private readonly IRobotConfigurationService robotConfigurationService;
|
||||
|
||||
public Manager(
|
||||
ILogger<Manager> logger,
|
||||
IServiceProvider serviceProvider,
|
||||
IParserService parserService,
|
||||
GlobalSettings globalSettings,
|
||||
IMapper mapper
|
||||
IMapper mapper,
|
||||
IRobotConfigurationService robotConfigurationService
|
||||
)
|
||||
{
|
||||
this.logger = logger;
|
||||
@@ -31,6 +32,7 @@ namespace PARR.EsppTemplateSync.Services
|
||||
this.parserService = parserService;
|
||||
this.globalSettings = globalSettings;
|
||||
this.mapper = mapper;
|
||||
this.robotConfigurationService = robotConfigurationService;
|
||||
}
|
||||
|
||||
public Task<bool> ManageFileAsync(string path)
|
||||
@@ -110,7 +112,7 @@ namespace PARR.EsppTemplateSync.Services
|
||||
|
||||
if (isChanged)
|
||||
{
|
||||
SetUpdateStatus(templateService, template);
|
||||
SetUpdateStatus(template);
|
||||
|
||||
if (!await templateService.CommitAsync())
|
||||
{
|
||||
@@ -125,12 +127,10 @@ namespace PARR.EsppTemplateSync.Services
|
||||
return;
|
||||
}
|
||||
|
||||
private void SetUpdateStatus(ITemplateService templateService, Template template)
|
||||
private void SetUpdateStatus(Template template)
|
||||
{
|
||||
//TODO: ChangeRobotStatus
|
||||
//template.StatusCode = (int)TaskStatusEnum.Updating;
|
||||
//templateService.ChangeRobotStatus(RobotStatusEnum.Wait, ref template);
|
||||
throw new NotImplementedException("ChangeRobotStatus");
|
||||
var robotConfig = robotConfigurationService.GetFromTemplateByRobotCode(RobotsEnum.TemplateOrder, ref template);
|
||||
robotConfigurationService.ChangeTaskStatus(TaskStatusEnum.Updating, ref robotConfig);
|
||||
}
|
||||
|
||||
private bool IsChanged(EsppTemplate template, EsppTemplate esppTemplate)
|
||||
|
||||
Reference in New Issue
Block a user