feat(api,bll,dal,esppScheduleSync,TemplateGenerator): изменен рассчет nextRun для задания роботу и синхронизатору, подставляется в зависимости от настроек ЗО и таймзоны УЗ робота ЕСПП. Переименование полей в БД
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
using AutoMapper;
|
||||
using PARR.API.Contracts.V1.Responses;
|
||||
using PARR.DAL.Contracts;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
using PARR.DAL.TransformServices;
|
||||
|
||||
|
||||
namespace PARR.API.MappingProfiles.Resolvers
|
||||
{
|
||||
@@ -11,17 +10,14 @@ namespace PARR.API.MappingProfiles.Resolvers
|
||||
{
|
||||
private readonly IEsppSchTypeConfigService esppConfigService;
|
||||
private readonly ILogger<RobotTaskScheduleSchResolver> logger;
|
||||
private readonly INextRunModifierService nextRunModifierService;
|
||||
|
||||
public RobotTaskScheduleSchResolver(
|
||||
IEsppSchTypeConfigService esppConfigService,
|
||||
ILogger<RobotTaskScheduleSchResolver> logger,
|
||||
INextRunModifierService nextRunModifierService
|
||||
ILogger<RobotTaskScheduleSchResolver> logger
|
||||
)
|
||||
{
|
||||
this.esppConfigService = esppConfigService;
|
||||
this.logger = logger;
|
||||
this.nextRunModifierService = nextRunModifierService;
|
||||
}
|
||||
|
||||
public List<RobotTaskScheduleSchResponse>? Resolve(RobotConfiguration source, RobotTaskScheduleResponse destination, List<RobotTaskScheduleSchResponse>? destMember, ResolutionContext context)
|
||||
@@ -44,14 +40,15 @@ namespace PARR.API.MappingProfiles.Resolvers
|
||||
Value = t.Value.Value
|
||||
}).OrderBy(t => t.Order).ToList();
|
||||
|
||||
//Если задача относится к распределенной модели исполнения за период месяц устанавливаем день равный NextRun
|
||||
if (source.Template!.Job!.Group!.IsAutoDistributionEnabled && schedule.TypeSchedule.Id == (int)EsppSchTypeScheduleEnum.Monthly)
|
||||
{
|
||||
var nextRunForRobot = nextRunModifierService.GetNextRunByAccountRobotTimeZone(source.Template.NextRun);
|
||||
////Если задача относится к распределенной модели исполнения за период месяц устанавливаем день равный NextRun
|
||||
////УСТАРЕВШЕЕ
|
||||
//if (source.Template!.Job!.Group!.IsAutoDistributionEnabled && schedule.TypeSchedule.Id == (int)EsppSchTypeScheduleEnum.Monthly)
|
||||
//{
|
||||
// var nextRunForRobot = nextRunModifierService.GetNextRunByAccountRobotTimeZone(source.Template.NextRun);
|
||||
|
||||
//response.First().Value = source.Template.NextRun.Day.ToString();
|
||||
response.First().Value = nextRunForRobot.Day.ToString();
|
||||
}
|
||||
// //response.First().Value = source.Template.NextRun.Day.ToString();
|
||||
// response.First().Value = nextRunForRobot.Day.ToString();
|
||||
//}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user