public override void CheckedData(SynCheckedDataInfoEntity entity, SynDataInfoEntity item)
        {
            BaiduV2ReportService serviceReport
                = new BaiduV2ReportService(item.AccountName, CryptHelper.DESDecode(item.AccountPwd), CryptHelper.DESDecode(item.Token));

            while (string.IsNullOrEmpty(entity.FilePath))
            {
                Thread.Sleep(1000);
                if (serviceReport.HasReportOnServer(item.DealWithId))
                {
                    FilePathInfo fpi = null;
                    while (fpi == null)
                    {
                        fpi = serviceReport.GetReportFileUrl(item.DealWithId);
                    }

                    if (fpi != null)
                    {
                        entity.FilePath = fpi.FilePath;
                        entity.FileName = fpi.FileName;
                        // 记录获取下载链接的时间,精确到小时
                        entity.DealWithDate = DateTime.Now;
                        // 直接下载
                        base.DownloadFileAndSynData(entity);
                        DataHelper.AppendSynCheckedDataInfo(entity);

                        DataHelper.RemoveSynDataInfo(item);
                    }
                }
            }

            serviceReport = null;
        }
示例#2
0
        public void GetReportId(DateTime dt, SynDataInfoEntity entity)
        {
            BaiduV2ReportService baiduReportService
                = new BaiduV2ReportService(entity.AccountName, CryptHelper.DESDecode(entity.AccountPwd), CryptHelper.DESDecode(entity.Token));

            string dealId = string.Empty;

            while (string.IsNullOrEmpty(dealId))
            {
                dealId = RequestId(baiduReportService, dt);
                Thread.Sleep(500);
            }

            if (string.IsNullOrEmpty(dealId) == false)
            {
                entity.DealWithDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd"));
                entity.DealWithType = 3;
                entity.DataType     = 2;
                entity.DealWithId   = dealId;
                entity.DataTag      = GetDataTag();
                DataHelper.AppendSynDataInfo(entity);
            }
        }
 public override string RequestId(BaiduV2ReportService baiduReportService, DateTime dt)
 {
     return(baiduReportService.GetReportForCampaign(dt));
 }
示例#4
0
 public abstract string RequestId(BaiduV2ReportService baiduReportService, DateTime dt);