Commit 36ef030e by lizefeng

新增亚马逊仓储费抓取

parent b9029aa3
using System;
using System.Collections.Generic;
using System.Text;
namespace AutoTurnOver.Models
{
public class dc_profit_business_amazon_storage_fee
{
public int id { get; set; }
public string _unique_id { get; set; }
public DateTime _create_date { get; set; }
public DateTime _update_date { get; set; }
public string _project { get; set; }
public int _is_delete { get; set; }
public DateTime _date { get; set; }
public DateTime report_end_date { get; set; }
public string account { get; set; }
public string asin { get; set; }
public string site { get; set; }
public decimal fee { get; set; }
public string fee_type { get; set; }
public string currency { get; set; }
public string fulfillment_center { get; set; }
}
}
......@@ -42,6 +42,18 @@ namespace AutoTurnOver.Utility
}
public static string DataRowToString(this DataRow row,string colName)
{
if (row[colName] == null)
{
return null;
}
else
{
return row[colName].ToString();
}
}
public static string DataRowToString(this DataRow row,int index)
{
if (row[index] == null)
......@@ -66,6 +78,29 @@ namespace AutoTurnOver.Utility
return DateTime.Parse(row[index].ToString());
}
}
public static decimal? DataRowToNumber(this DataRow row,string colName)
{
if (row[colName] == null)
{
return null;
}
else
{
var strData = row[colName].ToString();
if (strData.Contains("E"))
{
return Convert.ToDecimal(Decimal.Parse(strData.ToString(), System.Globalization.NumberStyles.Float));
}
else
{
return decimal.Parse(strData);
}
}
}
public static decimal? DataRowToNumber(this DataRow row,int index)
{
if (row[index] == null)
......
......@@ -60,6 +60,20 @@ namespace FikaAmazonAPI.Utils
list.Add(Singapore); list.Add(Australia); list.Add(Japan);
return list.FirstOrDefault(a => a.Country.Code == countryCode);
}
public static MarketPlace GetMarketplaceById(string id)
{
var list = new List<MarketPlace>();
//NorthAmerica
list.Add(US); list.Add(Canada); list.Add(Mexico); list.Add(Brazil);
//Europe
list.Add(Spain); list.Add(UnitedKingdom); list.Add(France); list.Add(Belgium);
list.Add(Netherlands); list.Add(Germany); list.Add(Italy); list.Add(Sweden);
list.Add(Egypt); list.Add(Poland); list.Add(Turkey); list.Add(UnitedArabEmirates);
list.Add(India); list.Add(SaudiArabia);
//FarEast
list.Add(Singapore); list.Add(Australia); list.Add(Japan);
return list.FirstOrDefault(a => a.ID == id);
}
//https://developer-docs.amazon.com/sp-api/docs/marketplace-ids
......
......@@ -51,15 +51,17 @@ namespace ResetOutofstock
//report_invest_return_dao.SynchBtmOrderRefund();
//report_invest_return_dao.CalculationStockScore("962073701");
//dc_ana_deviation_dao.PushAnaTask();
new AmazonDataSynchroService().SynchroFinancialEventGroups();
//new AmazonDataSynchroService().SynchroFinancialEventGroups();
//new AmazonDataSynchroService().SetMarketplaceName(DateTime.Now);
//new AmazonDataSynchroService().SetSettlementByDate();
//new AmazonDataSynchroService().SetMarketplaceNameByDate();
//new AmazonDataSynchroService().SynchroReportIds();
//new AmazonDataSynchroService().SynchroReportIds(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_V2_SETTLEMENT_REPORT_DATA_XML, 13, "Siqidzi","BE");
//new AmazonDataSynchroService().SynchroReportIds(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_FBA_INVENTORY_PLANNING_DATA, 15, "Elite99 Nail Art", "US");
//new AmazonDataSynchroService().SynchroReportIdByCreate(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_FBA_OVERAGE_FEE_CHARGES_DATA, 14, "Siqidzi","BE");
//new AmazonDataSynchroService().SynchroReportIds(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_AMAZON_FULFILLED_SHIPMENTS_DATA_GENERAL, 13);
//new AmazonDataSynchroService().AnaFbaShipmentReport();
//new AmazonDataSynchroService().AnaFbaStorageFeeReport();
//while (true)
//{
// new AmazonDataSynchroService().AnaReport(status:-3);
......
......@@ -659,6 +659,71 @@ namespace ResetOutofstock
}
});
Task.Factory.StartNew(() =>
{
while (true)
{
try
{
Console.WriteLine($"开始 拉取亚马逊 仓储超量费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
new AmazonDataSynchroService().SynchroReportIds(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_FBA_OVERAGE_FEE_CHARGES_DATA, 15);
Console.WriteLine($"结束 拉取亚马逊 仓储超量费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
Thread.Sleep(1000 * 60 * 3 );
}
catch (Exception ex)
{
Console.WriteLine(" 拉取亚马逊 仓储超量费:" + ex.Message);
Console.WriteLine(" 拉取亚马逊 仓储超量费 :" + ex.StackTrace);
}
}
});
Task.Factory.StartNew(() =>
{
while (true)
{
try
{
Console.WriteLine($"开始 拉取亚马逊 长期仓储费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
new AmazonDataSynchroService().SynchroReportIds(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_FBA_INVENTORY_PLANNING_DATA, 15);
Console.WriteLine($"结束 拉取亚马逊 长期仓储费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
Thread.Sleep(1000 * 60 * 3 );
}
catch (Exception ex)
{
Console.WriteLine(" 拉取亚马逊 长期仓储费:" + ex.Message);
Console.WriteLine(" 拉取亚马逊 长期仓储费 :" + ex.StackTrace);
}
}
});
Task.Factory.StartNew(() =>
{
while (true)
{
try
{
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, 15);
Console.WriteLine($"结束 拉取亚马逊 月度仓储费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
Thread.Sleep(1000 * 60 * 3 );
}
catch (Exception ex)
{
Console.WriteLine(" 拉取亚马逊 月度仓储费:" + ex.Message);
Console.WriteLine(" 拉取亚马逊 月度仓储费 :" + ex.StackTrace);
}
}
});
Task.Factory.StartNew(() =>
{
......@@ -705,6 +770,28 @@ namespace ResetOutofstock
}
});
Task.Factory.StartNew(() =>
{
while (true)
{
try
{
Console.WriteLine($"开始 解析月度仓储费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
new AmazonDataSynchroService().AnaFbaStorageFeeReport();
new AmazonDataSynchroService().AnaFbaStorageFeeReport(-1);
Console.WriteLine($"结束 解析月度仓储费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
Thread.Sleep(1000 * 3 );
}
catch (Exception ex)
{
Console.WriteLine(" 解析亚马逊报表(发货流水):" + ex.Message);
Console.WriteLine(" 解析亚马逊报表(发货流水) :" + ex.StackTrace);
}
}
});
Task.Factory.StartNew(() =>
......
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