コード例 #1
0
 private void UpdateData()
 {
     while (_isRunning)
     {
         if ((DateTime.Now - LastUpdateDataTime) > TimeSpan.FromMinutes(600))
         {
             try
             {
                 var regionTree         = RegionBAL.GetRegionTree(_productConnectionString);
                 var categoryTree       = ProductCategoryBAL.GetProductCategoryTree(_productConnectionString);
                 var categoryTags       = IndexProductTools.GetAllCategoryTags(_productConnectionString);
                 var listPrefixCategory = IndexProductTools.GetAllPrefixCategory(_productConnectionString);
                 solrIndexer.RegionTree         = regionTree;
                 solrIndexer.CategoryTree       = categoryTree;
                 solrIndexer.CategoryTags       = categoryTags;
                 solrIndexer.ListPrefixCategory = listPrefixCategory;
                 LastUpdateDataTime             = DateTime.Now;
                 Logger.Info("Update Data Success!");
             }
             catch (Exception exception)
             {
                 Logger.Error("Update Data Error.", exception);
                 Thread.Sleep(30000);
             }
         }
         else
         {
             Thread.Sleep(10000);
         }
     }
 }
コード例 #2
0
 private void UpdateListMerchant()
 {
     while (_isRunning)
     {
         if ((DateTime.Now - LastUpdateListMerchantTime) > TimeSpan.FromMinutes(3))
         {
             try
             {
                 var listMerchantUseDatafeedID = IndexProductTools.GetListMerchantUseDatafeedID(_productConnectionString);;
                 var listSpecialMerchantID     = IndexProductTools.GetListSpecialMerchantID(_productConnectionString);
                 var listPriorMerchants        = IndexProductTools.GetAllPriorMerchants(_productConnectionString);
                 var listBadMerchant           = IndexProductTools.GetAllBadMerchantId(_productConnectionString, 45);
                 solrIndexer.ListMerchantUseDatafeedID = listMerchantUseDatafeedID;
                 solrIndexer.ListSpecialMerchantID     = listSpecialMerchantID;
                 solrIndexer.ListPriorMerchants        = listPriorMerchants;
                 solrIndexer.ListBadMerchantID         = listBadMerchant;
                 LastUpdateListMerchantTime            = DateTime.Now;
                 Logger.Info("Update ListMerchant Success!");
             }
             catch (Exception exception)
             {
                 Logger.Error("Update ListMerchant Error.", exception);
                 Thread.Sleep(10000);
             }
         }
         else
         {
             Thread.Sleep(10000);
         }
     }
 }
コード例 #3
0
        private void InitData()
        {
            this.Invoke((MethodInvoker) delegate
            {
                panelMainControl.Enabled = false;
            });
            var listMerchantUseDatafeedID = IndexProductTools.GetListMerchantUseDatafeedID(_productConnectionString);;
            var listSpecialMerchantID     = IndexProductTools.GetListSpecialMerchantID(_productConnectionString);
            var listPriorMerchants        = IndexProductTools.GetAllPriorMerchants(_productConnectionString);
            var listBadMerchant           = IndexProductTools.GetAllBadMerchantId(_productConnectionString, 35);

            solrIndexer.ListMerchantUseDatafeedID = listMerchantUseDatafeedID;
            solrIndexer.ListSpecialMerchantID     = listSpecialMerchantID;
            solrIndexer.ListPriorMerchants        = listPriorMerchants;
            solrIndexer.ListBadMerchantID         = listBadMerchant;
            var regionTree         = RegionBAL.GetRegionTree(_productConnectionString);
            var categoryTree       = ProductCategoryBAL.GetProductCategoryTree(_productConnectionString);
            var categoryTags       = IndexProductTools.GetAllCategoryTags(_productConnectionString);
            var listPrefixCategory = IndexProductTools.GetAllPrefixCategory(_productConnectionString);

            solrIndexer.RegionTree         = regionTree;
            solrIndexer.CategoryTree       = categoryTree;
            solrIndexer.CategoryTags       = categoryTags;
            solrIndexer.ListPrefixCategory = listPrefixCategory;
            var propertyValueDictionary = WebProductPropertyBAL.GetAllPropertyValues(_productConnectionString);
            var propertyUnitDictionary  = WebProductPropertyBAL.GetPropertyUnitDictionary(_productConnectionString);

            solrIndexer.PropertyUnitDictionary  = propertyUnitDictionary;
            solrIndexer.PropertyValueDictionary = propertyValueDictionary;
            this.Invoke((MethodInvoker) delegate
            {
                panelMainControl.Enabled = true;
            });
        }
コード例 #4
0
        public void GetListSpecialMerchantIDTest()
        {
            var priorMerchant = IndexProductTools.GetListSpecialMerchantID(productConnectionString);

            return;
        }
コード例 #5
0
        public void GetListMerchantUseDatafeedIDTest()
        {
            var priorMerchant = IndexProductTools.GetListMerchantUseDatafeedID(productConnectionString);

            return;
        }
コード例 #6
0
        public void GetAllBadMerchantIdTest()
        {
            var priorMerchant = IndexProductTools.GetAllBadMerchantId(productConnectionString, 45);

            return;
        }
コード例 #7
0
        public void GetAllPriorMerchantsTest()
        {
            var priorMerchant = IndexProductTools.GetAllPriorMerchants(productConnectionString);

            return;
        }