Commit 2752ee18 by guanzhenshan

1

parent 25ad38e5
......@@ -10,18 +10,18 @@ namespace Bailun.DC.DailyItemNoProfitRate
static async Task Main(string[] args)
{
//Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
//var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
//{
// services.AddHostedService<Services>();
//});
Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
services.AddHostedService<Services>();
});
//await builder.RunConsoleAsync();
await builder.RunConsoleAsync();
var _service = new Services();
var day = DateTime.Parse(DateTime.Now.AddDays(-2).ToShortDateString());
_service.Init(day.AddDays(-20), day);
_service.OneDayItemNoProfitRate(day.AddDays(-1), day);
//var _service = new Services();
//var day = DateTime.Parse(DateTime.Now.AddDays(-2).ToShortDateString());
//_service.Init(day.AddDays(-20), day);
//_service.OneDayItemNoProfitRate(day.AddDays(-1), day);
}
}
}
......@@ -30,7 +30,7 @@ namespace Bailun.DC.DailyItemNoProfitRate
try
{
if ((now.Hour == 10 && now.Minute == 45)) //17:05启动
if ((now.Hour == 13 && now.Minute == 15)) //17:05启动
{
Console.WriteLine("开始启动 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
......@@ -108,7 +108,7 @@ namespace Bailun.DC.DailyItemNoProfitRate
var index = 1;
foreach (var item in listBaseOrder)
{
str += $"('{item.day}',{item.order_sku_id},'{item.bailun_order_id}','{item.origin_order_id}','{item.item_id}','{item.platform_sku}',{item.platform_sku_quantity_ordered},{item.count},'{item.bailun_sku}','{item.paid_time.ToString("yyyy-MM-dd HH:mm:ss")}',{item.amount_sales},{item.cost_product},{item.cost_platform_fee},{item.cost_paypal_fee},{item.cost_fba_fee},{item.cost_first},{item.cost_logistics},{item.cost_handle_platform},{item.cost_handle_bailun},'{item.warehouse_code}','{item.shipping_status}','{item.seller_order_exchange_rate}','{item.platform_type}','{item.website}','{item.bailun_account_id}'),";
str += $"('{item.day.ToString("yyyy-MM-dd")}',{item.order_sku_id},'{item.bailun_order_id}','{item.origin_order_id}','{item.item_id}','{item.platform_sku}',{item.platform_sku_quantity_ordered},{item.count},'{item.bailun_sku}','{item.paid_time.ToString("yyyy-MM-dd HH:mm:ss")}',{item.amount_sales},{item.cost_product},{item.cost_platform_fee},{item.cost_paypal_fee},{item.cost_fba_fee},{item.cost_first},{item.cost_logistics},{item.cost_handle_platform},{item.cost_handle_bailun},'{item.warehouse_code}','{item.shipping_status}','{item.seller_order_exchange_rate}','{item.platform_type}','{item.website}','{item.bailun_account_id}'),";
if (index % 1000 == 0 || index == list.Count)
{
//保存数据
......@@ -126,6 +126,8 @@ namespace Bailun.DC.DailyItemNoProfitRate
index++;
}
listBaseOrder = new List<dc_mid_itemno_profit_order>();
Console.WriteLine("完成保存基础订单数据" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
//更新提现损耗字段 只有ebay的
......@@ -156,7 +158,7 @@ namespace Bailun.DC.DailyItemNoProfitRate
}
//取出订单明细
listOrders = cn.Query<Models.dc_mid_itemno_profit_order>($"select * from dc_mid_itemno_profit_order where day>='{start.ToString("yyyy-MM-dd")}' and day<'{end.AddDays(1).ToString("yyyy-MM-dd")}'").AsList();
listOrders = cn.Query<Models.dc_mid_itemno_profit_order>($"select * from dc_mid_itemno_profit_order where day>='{start.ToString("yyyy-MM-dd")}' and day<'{end.AddDays(1).ToString("yyyy-MM-dd")}'",null,null,true,6*60).AsList();
Console.WriteLine("完成取出订单数据" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
//取出item no的广告GMV
......
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