Пример #1
0
        public AbstractLeadProcessor(int leadNumber, AmoAccount acc, ProcessQueue processQueue, Log log, CancellationToken token)
        {
            _leadRepo            = acc.GetRepo <Lead>();
            _processQueue        = processQueue;
            _token               = token;
            _acc                 = acc;
            _leadNumber          = leadNumber;
            _log                 = log;
            custom_fields_values = new();
            tags                 = new();

            try
            {
                Thread.Sleep((int)TimeSpan.FromSeconds(3).TotalMilliseconds);
                lead = _leadRepo.GetById(leadNumber);
                if (lead is not null && lead._embedded is not null && lead._embedded.tags is not null)
                {
                    tags = lead._embedded.tags;
                }
            }
            catch (Exception e)
            {
                _processQueue.Stop(leadNumber.ToString());
                _processQueue.Remove(leadNumber.ToString());
                _log.Add($"Error: Unable to create leadProcessor {leadNumber}: {e.Message}");
            }
        }
Пример #2
0
 public SmilarcompaniesCheckProcessor(int companyNumber, AmoAccount acc, ProcessQueue processQueue, Log log, CancellationToken token, RecentlyUpdatedEntityFilter filter)
 {
     _companyNumber = companyNumber;
     _compRepo      = acc.GetRepo <Company>();
     _token         = token;
     _log           = log;
     _filter        = filter;
     _processQueue  = processQueue;
 }
Пример #3
0
 public AbstractLeadProcessor(AmoAccount acc, ProcessQueue processQueue, Log log, CancellationToken token)
 {
     _leadRepo            = acc.GetRepo <Lead>();
     _processQueue        = processQueue;
     _token               = token;
     _acc                 = acc;
     _log                 = log;
     custom_fields_values = new();
     tags                 = new();
 }
Пример #4
0
        public PPIELeadsProcessor(int leadNumber, AmoAccount acc, ProcessQueue processQueue, Log log, CancellationToken token)
        {
            _leadRepo     = acc.GetRepo <Lead>();
            _processQueue = processQueue;
            _token        = token;
            _leadNumber   = leadNumber;
            _log          = log;

            try
            {
                Thread.Sleep((int)TimeSpan.FromSeconds(3).TotalMilliseconds);
                lead = _leadRepo.GetById(leadNumber);
            }
            catch (Exception e)
            {
                _processQueue.Stop(leadNumber.ToString());
                _processQueue.Remove(leadNumber.ToString());
                _log.Add($"Error: Unable to create leadProcessor {leadNumber}: {e.Message}");
            }
        }
Пример #5
0
 /// <summary>
 /// Формирует отчёт для корпоративного отдела. Выгружает список компаний с которыми отсутствовали недавние контакты.
 /// </summary>
 internal AbandonedCompaniesProcessor(AmoAccount acc, ProcessQueue processQueue, GSheets gSheets, string spreadsheetId, long dateFrom, long dateTo, string taskName, CancellationToken token)
     : base(acc, processQueue, gSheets, spreadsheetId, dateFrom, dateTo, taskName, token)
 {
 }
Пример #6
0
 /// <summary>
 /// Формирует отчёт по продажам для корпоративного отдела.
 /// </summary>
 internal CorpReportProcessor(AmoAccount acc, ProcessQueue processQueue, GSheets gSheets, string spreadsheetId, long dateFrom, long dateTo, string taskName, CancellationToken token)
     : base(acc, processQueue, gSheets, spreadsheetId, dateFrom, dateTo, taskName, token)
 {
     _locker = new();
 }
Пример #7
0
 public UnsortedProcessor(string uid, AmoAccount acc, ProcessQueue processQueue, Log log, CancellationToken token)       //Процессор принимает сделку из Неразобранного
     : base(acc, processQueue, log, token)
 {
     _uid = uid;
 }
Пример #8
0
 public InitialLeadProcessor(int leadNumber, AmoAccount acc, Amo amo, GSheets gSheets, ProcessQueue processQueue, Log log, CancellationToken token)
     : base(leadNumber, acc, processQueue, log, token)
 {
     _gSheets = gSheets;
     _amo     = amo;
 }