Commit 4542f0ff by 泽锋 李

fix

parent 41d25bd4
...@@ -15,34 +15,43 @@ namespace AutoTurnOver.DB ...@@ -15,34 +15,43 @@ namespace AutoTurnOver.DB
/// </summary> /// </summary>
public static void SyncData() public static void SyncData()
{ {
int page = 1; try
int rows = 100;
// 清理数据重抓
_connection.Execute(" TRUNCATE table dc_base_pps_sell_product; ");
while (true)
{ {
var datas = ApiUtility.GetPPSSellProduct(page, rows); int page = 1;
page++; int rows = 100;
if (datas != null && datas.Count >= 1) // 清理数据重抓
_connection.Execute(" TRUNCATE table dc_base_pps_sell_product; ");
while (true)
{ {
foreach (var item in datas) var datas = ApiUtility.GetPPSSellProduct(page, rows);
page++;
if (datas != null && datas.Count >= 1)
{ {
dc_base_pps_sell_product dbData = new dc_base_pps_sell_product(); foreach (var item in datas)
dbData.pro_code = item.proCode ?? ""; {
dbData.sku_code = item.skuCode ?? ""; dc_base_pps_sell_product dbData = new dc_base_pps_sell_product();
dbData.platform_sku = item.platformSku ?? ""; dbData.pro_code = item.proCode ?? "";
dbData.item_id = item.itemId ?? ""; dbData.sku_code = item.skuCode ?? "";
dbData.productId = item.productId; dbData.platform_sku = item.platformSku ?? "";
dbData.platform = "walmart"; dbData.item_id = item.itemId ?? "";
dbData.warehouse_code = "GZBLWH"; dbData.productId = item.productId;
_connection.Insert(dbData); dbData.platform = "walmart";
dbData.warehouse_code = "GZBLWH";
_connection.Insert(dbData);
}
}
else
{
break;
} }
} }
else
{ }
break; catch (Exception)
} {
Console.WriteLine("拉取pps数据异常");
} }
} }
} }
} }
...@@ -28,9 +28,18 @@ namespace ResetOutofstock ...@@ -28,9 +28,18 @@ namespace ResetOutofstock
if (now.Hour == 20 && now.Minute == 02) if (now.Hour == 20 && now.Minute == 02)
{ {
System.Console.WriteLine($"开始 推送pps回货数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); try
new ReportServices().PPSReturnGoodsPush("walmart"); {
System.Console.WriteLine($"结束 推送pps回货数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); System.Console.WriteLine($"开始 推送pps回货数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
new ReportServices().PPSReturnGoodsPush("walmart");
System.Console.WriteLine($"结束 推送pps回货数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
}
catch (Exception ex)
{
Console.WriteLine("推送pps回货异常"+ex.Message);
Console.WriteLine("推送pps回货异常"+ex.StackTrace);
}
} }
......
...@@ -23,6 +23,7 @@ namespace ShortagePush ...@@ -23,6 +23,7 @@ namespace ShortagePush
//new ReportServices().ShortagePushEbay(true); //new ReportServices().ShortagePushEbay(true);
//new ReportServices().ReturnGoodsPush(); //new ReportServices().ReturnGoodsPush();
//new ReportServices().ShortagePushEbay(); //new ReportServices().ShortagePushEbay();
//new ReportServices().PPSReturnGoodsPush("walmart");
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -16,5 +16,9 @@ ...@@ -16,5 +16,9 @@
"BrowseLogSetting": { "BrowseLogSetting": {
"Url": "http://saas.admin.bailuntec.com/Api/Ssoadmin/operationloginfo/addoperationloginfo", "Url": "http://saas.admin.bailuntec.com/Api/Ssoadmin/operationloginfo/addoperationloginfo",
"CanLog": "yes" "CanLog": "yes"
},
"pps-sys": {
"review": "https://pps.bailuntec.com/Api/amazon/analyze/Download/GetReviewInfoBy",
"pps_sell_product": "http://pps.bailuntec.com/WalmartApi/Publish/GetWithSellProductAsync"
} }
} }
...@@ -16,5 +16,9 @@ ...@@ -16,5 +16,9 @@
"BrowseLogSetting": { "BrowseLogSetting": {
"Url": "http://saas.admin.bailuntec.com/Api/Ssoadmin/operationloginfo/addoperationloginfo", "Url": "http://saas.admin.bailuntec.com/Api/Ssoadmin/operationloginfo/addoperationloginfo",
"CanLog": "yes" "CanLog": "yes"
},
"pps-sys": {
"review": "https://pps.bailuntec.com/Api/amazon/analyze/Download/GetReviewInfoBy",
"pps_sell_product": "http://pps.bailuntec.com/WalmartApi/Publish/GetWithSellProductAsync"
} }
} }
...@@ -9,5 +9,9 @@ ...@@ -9,5 +9,9 @@
"BrowseLogSetting": { "BrowseLogSetting": {
"Url": "http://saas.admin.bailuntec.com/Api/Ssoadmin/operationloginfo/addoperationloginfo", "Url": "http://saas.admin.bailuntec.com/Api/Ssoadmin/operationloginfo/addoperationloginfo",
"CanLog": "yes" "CanLog": "yes"
},
"pps-sys": {
"review": "https://pps.bailuntec.com/Api/amazon/analyze/Download/GetReviewInfoBy",
"pps_sell_product": "http://pps.bailuntec.com/WalmartApi/Publish/GetWithSellProductAsync"
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment