feat(espptemplatesync): Изменение статуса шаблона для робота на Wait при необходимости его обновления в АСУ ЕСПП
This commit is contained in:
@@ -103,13 +103,13 @@ namespace PARR.EsppTemplateSync.Services
|
||||
else
|
||||
{
|
||||
var mappedTemplate = mapper.Map<EsppTemplate>(template);
|
||||
if (mappedTemplate == null)
|
||||
if (mappedTemplate == null)
|
||||
return;
|
||||
var isChanged = IsChanged(mappedTemplate, esppTemplate);
|
||||
|
||||
if (isChanged)
|
||||
{
|
||||
SetUpdateStatus(template);
|
||||
SetUpdateStatus(templateService, template);
|
||||
|
||||
if (!await templateService.CommitAsync())
|
||||
{
|
||||
@@ -117,16 +117,17 @@ namespace PARR.EsppTemplateSync.Services
|
||||
}
|
||||
else
|
||||
logger.LogInformation($"----- Установлен принудительный статус обновления Template {template.Name} -----");
|
||||
}
|
||||
} //надо ли проверять если не изменился, но был статус Updating не понятно. Доверяем роботу пока, что после окончания работ от точно сообщит
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
private void SetUpdateStatus(Template template)
|
||||
private void SetUpdateStatus(ITemplateService templateService, Template template)
|
||||
{
|
||||
template.StatusCode = (int)StatusTemplateEnum.Updating;
|
||||
templateService.ChangeRobotStatus(RobotStatusEnum.Wait, ref template);
|
||||
}
|
||||
|
||||
private bool IsChanged(EsppTemplate template, EsppTemplate esppTemplate)
|
||||
@@ -147,7 +148,7 @@ namespace PARR.EsppTemplateSync.Services
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user