Commit c153ada1 by 泽锋 李

fix

parent 9ef30b34
...@@ -1520,45 +1520,6 @@ alter table buy_ontheway_detail_temp rename buy_ontheway_detail; ...@@ -1520,45 +1520,6 @@ alter table buy_ontheway_detail_temp rename buy_ontheway_detail;
alter table buy_ontheway_detailTemp rename buy_ontheway_detail_temp; alter table buy_ontheway_detailTemp rename buy_ontheway_detail_temp;
truncate table buy_ontheway_detail_temp; ", commandTimeout: 0); truncate table buy_ontheway_detail_temp; ", commandTimeout: 0);
//刷新无库仓商品日均
// _connection.Execute(@" -- 刷新无库仓商品日均
//set session transaction isolation level read uncommitted;
//start transaction;
//-- 清空视图表的数据
//Truncate table dc_not_stock_goods_sales_temp;
//INSERT into dc_not_stock_goods_sales_temp(`product_inner_code`,`warehouse_code`,`test_sales`,`success_sales`) (
// select
//t2.product_inner_code,t2.warehouse_code,
//sum(case when TIMESTAMPDIFF(day,t2.push_time,t1.pay_time)<=21 then t1.bailun_sku_quantity_ordered else 0 end) as 'test_sales', -- 推送之后 21 日的销量
//sum(case when TIMESTAMPDIFF(day,t1.pay_time,now())<=7 then t1.bailun_sku_quantity_ordered else 0 end) as 'success_sales' -- 最近7日销量
//from dc_base_sku as t2
//left join dc_base_oms_sku as t1 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
//left join dc_auto_config_sku_warehouse as t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code = t3.warehouse_code
//where t2.warehouse_code='BLGZ03' and (t1.id is null or t1.bailun_order_status!='Canceled') and (t3.`status`=0 or t3.`status` is null) and t2.push_time >= '2010-01-01'
//GROUP BY t2.product_inner_code,t2.warehouse_code
//);
//alter table dc_not_stock_goods_sales rename dc_not_stock_goods_salesTemp;
//alter table dc_not_stock_goods_sales_temp rename dc_not_stock_goods_sales;
//alter table dc_not_stock_goods_salesTemp rename dc_not_stock_goods_sales_temp;
//truncate table dc_not_stock_goods_sales_temp; ", commandTimeout: 0);
// _connection.Execute(@" -- 记录历史缺货
//set session transaction isolation level read uncommitted;
//start transaction;
//insert ignore into dc_outofstock_history(`bailun_sku`,`warehouse_code`,`date`) (
// select
// t1.bailun_sku,t1.warehouse_code,now() as 'date'
// from dc_mid_transit as t1
//left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku
//left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
//left join china_warehouse_stock as t3 on t1.bailun_sku = t3.bailun_sku and t_db.hq_type='国内仓'
//left join china_warehouse_unshipped as t4 on t1.bailun_sku = t4.bailun_sku and t_db.hq_type='国内仓'
//where ( t_db.hq_type!='国内仓' or t2.buyer_name not in ('张莹霞','张莹霞1') ) and t_db.hq_type!='fba仓' and (case when t_db.hq_type='国内仓' then (ifnull(t4.sum_unshipped_quantity,0) - ifnull(t3.sum_usable_stock,0)) else t1.quantity_out_stock end )>0
//) ");
_connection.Execute(@" -- 刷新在途 _connection.Execute(@" -- 刷新在途
set session transaction isolation level read uncommitted; set session transaction isolation level read uncommitted;
start transaction; start transaction;
......
...@@ -50,26 +50,27 @@ namespace ResetOutofstock ...@@ -50,26 +50,27 @@ namespace ResetOutofstock
} }
} }
if (now.Hour == 1 && now.Minute == 1)
if (now.Hour == 02 && now.Minute == 1)
{ {
Console.WriteLine($"开始 刷新最近7天的oms数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"开始 刷新jit安全库存,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
report.ResetOutofstock(); dc_auto_pick_up_goods_order_dao.GenerateOrder(DateTime.Now.AddDays(-1), DateTime.Now);
Console.WriteLine($"结束 刷新最近7天的oms数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"结束 刷新jit安全库存,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
} }
if (now.Hour==8 && now.Minute == 1) if (now.Hour==8 && now.Minute == 1)
{ {
Console.WriteLine($"开始 刷新jit安全库存,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"开始 刷新jit安全库存,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
report.ResetInventory(); report.ResetInventory();
Console.WriteLine($"结束 刷新jit安全库存,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"结束 刷新jit安全库存,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
} }
if(now.Hour==02 && now.Minute == 1) if (now.Hour == 9 && now.Minute == 20)
{ {
Console.WriteLine($"开始 刷新jit安全库存,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"开始 刷新最近7天的oms数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
dc_auto_pick_up_goods_order_dao.GenerateOrder(DateTime.Now.AddDays(-1), DateTime.Now); report.ResetOms7();
Console.WriteLine($"结束 刷新jit安全库存,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"结束 刷新最近7天的oms数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
} }
} }
public override void Dispose() public override void Dispose()
......
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