Commit f60ee6b3 by 泽锋 李

fix

parent 8b62cb62
...@@ -1641,7 +1641,9 @@ where t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code; ...@@ -1641,7 +1641,9 @@ where t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code;
/// </summary> /// </summary>
public static void ResetOmsOutofstock() public static void ResetOmsOutofstock()
{ {
var datas = _connection.Query<dc_base_oms_sku_outofstock_temp>(@"select try
{
var datas = _connection.Query<dc_base_oms_sku_outofstock_temp>(@"select
t1.`id`, t1.`id`,
t1.`origin_order_id`, t1.`origin_order_id`,
t1.`platform_type`, t1.`platform_type`,
...@@ -1758,23 +1760,30 @@ from dc_base_oms_sku as t1 ...@@ -1758,23 +1760,30 @@ from dc_base_oms_sku as t1
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
where t1.company_id=1 and t1.has_innersale=0 and t1.create_time>'2019-03-01 12:00:00' and t1.bailun_picking_status!='TotalPicked' and t1.bailun_order_status = 'Handling' and t1.has_delete=0 and t1.has_scalp=0 and t1.has_buyer_remark = 0 where t1.company_id=1 and t1.has_innersale=0 and t1.create_time>'2019-03-01 12:00:00' and t1.bailun_picking_status!='TotalPicked' and t1.bailun_order_status = 'Handling' and t1.has_delete=0 and t1.has_scalp=0 and t1.has_buyer_remark = 0
and t1.has_platsku_remark = 0 and t1.bailun_interception_status not in ('Success','Part') and t1.platform_type!='FBA'",commandTimeout:0).ToList(); and t1.has_platsku_remark = 0 and t1.bailun_interception_status not in ('Success','Part') and t1.platform_type!='FBA'", commandTimeout: 0).ToList();
_connection.Execute(@" _connection.Execute(@"
-- 清空视图表的数据 -- 清空视图表的数据
Truncate table dc_base_oms_sku_outofstock_temp; Truncate table dc_base_oms_sku_outofstock_temp;
", commandTimeout: 0); ", commandTimeout: 0);
foreach (var item in datas) foreach (var item in datas)
{ {
_connection.Insert(item); _connection.Insert(item);
} }
_connection.Execute(@" _connection.Execute(@"
alter table dc_base_oms_sku_outofstock rename dc_base_oms_sku_outofstockTemp; alter table dc_base_oms_sku_outofstock rename dc_base_oms_sku_outofstockTemp;
alter table dc_base_oms_sku_outofstock_temp rename dc_base_oms_sku_outofstock; alter table dc_base_oms_sku_outofstock_temp rename dc_base_oms_sku_outofstock;
alter table dc_base_oms_sku_outofstockTemp rename dc_base_oms_sku_outofstock_temp; alter table dc_base_oms_sku_outofstockTemp rename dc_base_oms_sku_outofstock_temp;
truncate table dc_base_oms_sku_outofstock_temp; ", commandTimeout: 0); truncate table dc_base_oms_sku_outofstock_temp; ", commandTimeout: 0);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
} }
/// <summary> /// <summary>
......
...@@ -23,7 +23,7 @@ namespace ResetOutofstock ...@@ -23,7 +23,7 @@ namespace ResetOutofstock
//report.ResetOmsOutofstock(); //report.ResetOmsOutofstock();
//report.CalculationSalesTrend(); //report.CalculationSalesTrend();
//report.ResetLastweekData(); //report.ResetLastweekData();
report.ResetOmsOutofstock(); //report.ResetOmsOutofstock();
} }
catch (Exception ex) catch (Exception ex)
{ {
......
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