Commit 2f040936 by lizefeng

升级亚马逊长期仓储费的抓取

parent cec04702
...@@ -978,7 +978,7 @@ namespace AutoTurnOver.Services ...@@ -978,7 +978,7 @@ namespace AutoTurnOver.Services
/// <param name="data_id"></param> /// <param name="data_id"></param>
public void AnaFbaLongTermStorageFeeReport(int status = 0, string report_id = "") public void AnaFbaLongTermStorageFeeReport(int status = 0, string report_id = "")
{ {
var reportTypeEnum = ReportTypes.GET_FBA_INVENTORY_PLANNING_DATA; var reportTypeEnum = ReportTypes.GET_FBA_FULFILLMENT_LONGTERM_STORAGE_FEE_CHARGES_DATA;
var ana_task = MyMySqlConnection._connection.QueryFirstOrDefault<dc_base_amazon_fee_report_log>(" select * from dc_base_amazon_fee_report_log where report_type=@report_type and ana_status=@status order by id asc limit 1 ", new var ana_task = MyMySqlConnection._connection.QueryFirstOrDefault<dc_base_amazon_fee_report_log>(" select * from dc_base_amazon_fee_report_log where report_type=@report_type and ana_status=@status order by id asc limit 1 ", new
{ {
report_type = reportTypeEnum.ToString(), report_type = reportTypeEnum.ToString(),
...@@ -1027,8 +1027,6 @@ namespace AutoTurnOver.Services ...@@ -1027,8 +1027,6 @@ namespace AutoTurnOver.Services
ana_task.content = jsonText; ana_task.content = jsonText;
var table = CsvFileHelper.ReadFromCSV(reportData.ReportDocumentId, true, '\t'); var table = CsvFileHelper.ReadFromCSV(reportData.ReportDocumentId, true, '\t');
if (table.Columns.Contains("estimated-ltsf-next-charge") || table.Columns.Contains("estimated-storage-cost-next-month"))
{
foreach (DataRow row in table.Rows) foreach (DataRow row in table.Rows)
{ {
try try
...@@ -1036,9 +1034,9 @@ namespace AutoTurnOver.Services ...@@ -1036,9 +1034,9 @@ namespace AutoTurnOver.Services
dc_profit_business_amazon_storage_fee storageFee = new dc_profit_business_amazon_storage_fee dc_profit_business_amazon_storage_fee storageFee = new dc_profit_business_amazon_storage_fee
{ {
currency = row.DataRowToString("currency"), currency = row.DataRowToString("country"),
fulfillment_center = row.DataRowToString("marketplace"), fulfillment_center = row.DataRowToString("country"),
site = row.DataRowToString("marketplace"), site = row.DataRowToString("country"),
fee_type = "超长仓储费", fee_type = "超长仓储费",
report_id = ana_task.report_id, report_id = ana_task.report_id,
account = pamsAccount.Account, account = pamsAccount.Account,
...@@ -1046,7 +1044,7 @@ namespace AutoTurnOver.Services ...@@ -1046,7 +1044,7 @@ namespace AutoTurnOver.Services
sku = row.DataRowToString("fnsku"), sku = row.DataRowToString("fnsku"),
report_end_date = reportData.DataEndTime ?? new DateTime(1991, 1, 1) report_end_date = reportData.DataEndTime ?? new DateTime(1991, 1, 1)
}; };
storageFee.fee = row.DataRowToNumber("estimated-ltsf-next-charge") ?? (row.DataRowToNumber("estimated-storage-cost-next-month") ??0); storageFee.fee = row.DataRowToNumber("long-time-range-long-term-storage-fee") ?? 0;
storageFee._date = reportData.DataStartTime.Value.ToDayHome(); storageFee._date = reportData.DataStartTime.Value.ToDayHome();
//storageFee.site = row.DataRowToString("country_code"); //storageFee.site = row.DataRowToString("country_code");
if ("GB".Equals(storageFee.site, StringComparison.CurrentCultureIgnoreCase)) if ("GB".Equals(storageFee.site, StringComparison.CurrentCultureIgnoreCase))
...@@ -1077,7 +1075,6 @@ namespace AutoTurnOver.Services ...@@ -1077,7 +1075,6 @@ namespace AutoTurnOver.Services
} }
} }
}
......
...@@ -57,13 +57,13 @@ namespace ResetOutofstock ...@@ -57,13 +57,13 @@ namespace ResetOutofstock
//new AmazonDataSynchroService().SetMarketplaceNameByDate(); //new AmazonDataSynchroService().SetMarketplaceNameByDate();
//new AmazonDataSynchroService().SynchroReportIds(); //new AmazonDataSynchroService().SynchroReportIds();
//new AmazonDataSynchroService().SynchroReportIds(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_FBA_INVENTORY_PLANNING_DATA, 16, "Eumengman", "FR"); //new AmazonDataSynchroService().SynchroReportIdByCreate(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_FBA_FULFILLMENT_LONGTERM_STORAGE_FEE_CHARGES_DATA, 17, "Eumengman", "ES",DateTime.Parse("2023-03-01"),DateTime.Parse("2023-03-31 23:59:59"));
//new AmazonDataSynchroService().SynchroReportIdByCreate(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_FBA_INVENTORY_PLANNING_DATA, version: 22, account: "Elite99 Nail Art", site: "US", //new AmazonDataSynchroService().SynchroReportIdByCreate(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_FBA_INVENTORY_PLANNING_DATA, version: 22, account: "Elite99 Nail Art", site: "US",
// btime: DateTime.Parse("2023-04-01"), DateTime.Parse("2023-04-24 23:59:59")); // btime: DateTime.Parse("2023-04-01"), DateTime.Parse("2023-04-24 23:59:59"));
//new AmazonDataSynchroService().SynchroReportIds(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_AMAZON_FULFILLED_SHIPMENTS_DATA_GENERAL, 13); //new AmazonDataSynchroService().SynchroReportIds(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_AMAZON_FULFILLED_SHIPMENTS_DATA_GENERAL, 13);
//new AmazonDataSynchroService().AnaFbaShipmentReport(); //new AmazonDataSynchroService().AnaFbaShipmentReport();
//new AmazonDataSynchroService().AnaFbaStorageFeeReport(status:-1); //new AmazonDataSynchroService().AnaFbaStorageFeeReport(status:-1);
//new AmazonDataSynchroService().AnaFbaLongTermStorageFeeReport(); //new AmazonDataSynchroService().AnaFbaLongTermStorageFeeReport(0, "994146019488");
//new AmazonDataSynchroService().AnaFbaOverageStorageFeeReport(report_id: "937084019471"); //new AmazonDataSynchroService().AnaFbaOverageStorageFeeReport(report_id: "937084019471");
//new AmazonDataSynchroService().AnaFbaStorageFeeReport(data_id: "323250019473"); //new AmazonDataSynchroService().AnaFbaStorageFeeReport(data_id: "323250019473");
......
...@@ -691,7 +691,17 @@ namespace ResetOutofstock ...@@ -691,7 +691,17 @@ namespace ResetOutofstock
{ {
Console.WriteLine($"开始 拉取亚马逊 长期仓储费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"开始 拉取亚马逊 长期仓储费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
// 下载上个月的 // 下载上个月的
new AmazonDataSynchroService().SynchroReportIds(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_FBA_STORAGE_FEE_CHARGES_DATA, 25); new AmazonDataSynchroService().SynchroReportIdByCreate(
FikaAmazonAPI.Utils.Constants.ReportTypes.GET_FBA_FULFILLMENT_LONGTERM_STORAGE_FEE_CHARGES_DATA,
version: 25,
btime: DateTime.Now.AddMonths(-1).GetMonthFirstDay().ToDayHome().AddHours(-8),
etime: DateTime.Now.AddMonths(-1).LastDayOfMonth().ToDayEnd().AddHours(-8));
// 下载这个月的
new AmazonDataSynchroService().SynchroReportIdByCreate(
FikaAmazonAPI.Utils.Constants.ReportTypes.GET_FBA_FULFILLMENT_LONGTERM_STORAGE_FEE_CHARGES_DATA,
version: 25,
btime: DateTime.Now.GetMonthFirstDay().ToDayHome(),
etime: DateTime.Now.AddDays(-1).ToDayEnd());
Console.WriteLine($"结束 拉取亚马逊 长期仓储费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"结束 拉取亚马逊 长期仓储费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
Thread.Sleep(1000 * 60 * 3); Thread.Sleep(1000 * 60 * 3);
} }
......
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