feat(api, dal, activator, distributor): RobotConfigurationService - добавлена логика, статус Updating шаблону можно поставить если у него есть ScheduleEsppId.
This commit is contained in:
@@ -45,16 +45,22 @@ internal class TemplateActivator : ITemplateActivator
|
||||
case TemplateActivatorEsppObjectTypesEnum.Template:
|
||||
foreach (var template in templates)
|
||||
{
|
||||
template.IsActiveTemplate = query.NewState;
|
||||
UpdateRobotConfiguration(RobotsEnum.TemplateOrder, template);
|
||||
if (template.IsActiveTemplate != query.NewState)
|
||||
{
|
||||
template.IsActiveTemplate = query.NewState;
|
||||
UpdateRobotConfiguration(RobotsEnum.TemplateOrder, template);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TemplateActivatorEsppObjectTypesEnum.Schedule:
|
||||
foreach (var template in templates)
|
||||
{
|
||||
template.IsActiveSchedule = query.NewState;
|
||||
UpdateRobotConfiguration(RobotsEnum.ScheduleOrder, template);
|
||||
if (template.IsActiveSchedule != query.NewState)
|
||||
{
|
||||
template.IsActiveSchedule = query.NewState;
|
||||
UpdateRobotConfiguration(RobotsEnum.ScheduleOrder, template);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -118,7 +124,8 @@ internal class TemplateActivator : ITemplateActivator
|
||||
private void UpdateRobotConfiguration(RobotsEnum robotsEnum, Template t)
|
||||
{
|
||||
var config = robotConfigurationService.GetFromTemplateByRobotCode(robotsEnum, t);
|
||||
robotConfigurationService.ChangeTaskStatus(TaskStatusEnum.Updating, config);
|
||||
// robotConfigurationService.ChangeTaskStatus(TaskStatusEnum.Updating, config);
|
||||
robotConfigurationService.SetUpdateTaskStatusIfAllow(config);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user