private void GetIssuesFromDb(DirectumIssuesFilter _filter, DateTime _dateCreation, LogHelper _logHelper)
        {
            _logHelper.Info($"Начало обработки {DateTime.Now}");

            IssuesByCreateBase = GetIssues(_filter, _dateCreation, _logHelper);

            _logHelper.Info($"Получено задач реестра изменений на {_filter.EndDate}: {IssuesByCreateBase.Count()}");
        }
Exemplo n.º 2
0
 protected override ItemByCreate[] GetIssues(DirectumIssuesFilter _filter, DateTime _dateCreation, LogHelper _logHelper)
 {
     return(_directumJiraExchangeProvider
            .GetRegistryItems(_filter)
            .Where(item => item.Deadline.Date != _dateCreation.Date)
            .Select(directumRegistryItem => _directumToJiraMapper.MapItem(directumRegistryItem, _logHelper))
            .ToArray());
 }
 protected override IssueByCreate[] GetIssues(DirectumIssuesFilter _filter, DateTime _dateCreation, LogHelper _logHelper)
 {
     return(_directumJiraExchangeProvider
            .GetIssues(_filter)
            .Where(issue => !(issue.InternalState == InternalState.Complete && issue.ModificationTime.Date == _dateCreation.Date))
            .Select(directumIssue => _directumToJiraMapper.Map(directumIssue, _dateCreation))
            .ToArray());
 }
Exemplo n.º 4
0
        public void Import(DateTime dateCreation, DirectumIssuesFilter filter)
        {
            var logHelper = new LogHelper(_logger);

            var dayCreation = _atbCalendar.GetDay(dateCreation);

            if (!dayCreation.IsWorkingDay)
            {
                logHelper.Info($"{dayCreation.Date} не рабочий день");
                return;
            }
            try
            {
                _strategies
                .ToList()
                .ForEach(_ => _.Import(logHelper, dateCreation, filter));
            }
            catch (Exception ex)
            {
                logHelper.Error(ex);
            }
        }
 public Task Import(LogHelper logHelper, DateTime dateCreation, DirectumIssuesFilter filter)
 {
     GetIssuesFromDb(filter, dateCreation, logHelper);
     return(CreateIssueResults(logHelper, dateCreation));
 }
 protected abstract T[] GetIssues(DirectumIssuesFilter filter, DateTime dateCreation, LogHelper logHelper);