Commit 5148b686 by 泽锋 李

刷新母sku的周转建议

parent 18d8269a
...@@ -463,7 +463,7 @@ where t1.mother_sku_warehouse_code in @mother_sku_warehouse_codes ", new ...@@ -463,7 +463,7 @@ where t1.mother_sku_warehouse_code in @mother_sku_warehouse_codes ", new
bailun_sku_warehouse_codes = map_sku_datas.Select(s => s.bailun_sku_warehouse_code).ToList() bailun_sku_warehouse_codes = map_sku_datas.Select(s => s.bailun_sku_warehouse_code).ToList()
}).ToList(); }).ToList();
var turn_first_data = turn_datas.FirstOrDefault(); var turn_first_data = turn_datas.OrderByDescending(s=>s.daily_weighted_sales).FirstOrDefault();
var warehouse_data = conn.QueryFirstOrDefault<dc_base_warehouse>(" select * from dc_base_warehouse where warehouse_code=@warehouse_code ", new { warehouse_code = monther_warehouse_code }); var warehouse_data = conn.QueryFirstOrDefault<dc_base_warehouse>(" select * from dc_base_warehouse where warehouse_code=@warehouse_code ", new { warehouse_code = monther_warehouse_code });
var mother_turn_data = new Models.dc_auto_turnover() var mother_turn_data = new Models.dc_auto_turnover()
{ {
...@@ -796,7 +796,7 @@ where t1.mother_sku_warehouse_code in @mother_sku_warehouse_codes ", new ...@@ -796,7 +796,7 @@ where t1.mother_sku_warehouse_code in @mother_sku_warehouse_codes ", new
/// </summary> /// </summary>
public static void SynchroCalculationTurnOver() public static void SynchroCalculationTurnOver()
{ {
var task_name = $"SynchroCalculationTurnOver_v1"; var task_name = $"SynchroCalculationTurnOver_v2";
var conn = MyMySqlConnection._connection; ; var conn = MyMySqlConnection._connection; ;
// 查询最后一次成功抓取的记录 // 查询最后一次成功抓取的记录
var last_task_synchro_log = conn.QuerySingleOrDefault<task_synchro_log>(" select * from task_synchro_log where task_name=@task_name and status=1 order by end_time desc limit 1 ", new { task_name = task_name }); var last_task_synchro_log = conn.QuerySingleOrDefault<task_synchro_log>(" select * from task_synchro_log where task_name=@task_name and status=1 order by end_time desc limit 1 ", new { task_name = task_name });
...@@ -815,7 +815,7 @@ where t1.mother_sku_warehouse_code in @mother_sku_warehouse_codes ", new ...@@ -815,7 +815,7 @@ where t1.mother_sku_warehouse_code in @mother_sku_warehouse_codes ", new
} }
else else
{ {
new_task_synchro_log.start_time = DateTime.Now.AddMinutes(-10); new_task_synchro_log.start_time = DateTime.Now.AddDays(-10);
} }
new_task_synchro_log.id = conn.Insert(new_task_synchro_log) ?? 0; new_task_synchro_log.id = conn.Insert(new_task_synchro_log) ?? 0;
...@@ -826,7 +826,7 @@ where t1.mother_sku_warehouse_code in @mother_sku_warehouse_codes ", new ...@@ -826,7 +826,7 @@ where t1.mother_sku_warehouse_code in @mother_sku_warehouse_codes ", new
{ {
var datas = conn.Query<dc_base_mother_sku_map>($@" select t2.* from dc_auto_turnover as t1 var datas = conn.Query<dc_base_mother_sku_map>($@" select t2.* from dc_auto_turnover as t1
INNER join dc_base_mother_sku_map as t2 on t1.bailun_sku_warehouse_code = t2.bailun_sku_warehouse_code INNER join dc_base_mother_sku_map as t2 on t1.bailun_sku_warehouse_code = t2.bailun_sku_warehouse_code
where t1.gmt_modified>=@btime and t1.gmt_modified <=@etime and t1.daily_weighted_sales>1 where t1.gmt_modified>=@btime and t1.gmt_modified <=@etime -- and t1.daily_weighted_sales>1
order by t1.gmt_modified asc order by t1.gmt_modified asc
limit {(page - 1) * rows},{rows} ", new { btime = new_task_synchro_log.start_time, etime = new_task_synchro_log.end_time }, commandTimeout: 0).ToList(); limit {(page - 1) * rows},{rows} ", new { btime = new_task_synchro_log.start_time, etime = new_task_synchro_log.end_time }, commandTimeout: 0).ToList();
if (datas.Count <= 0) { break; } if (datas.Count <= 0) { break; }
......
...@@ -31,7 +31,7 @@ namespace ResetOutofstock ...@@ -31,7 +31,7 @@ namespace ResetOutofstock
//daily.ResetFbaExtendSales(DateTime.Now); //daily.ResetFbaExtendSales(DateTime.Now);
//dc_base_mother_sku_dao.SynchroCalculationTurnOver(); //dc_base_mother_sku_dao.SynchroCalculationTurnOver();
//dc_base_mother_sku_dao.ResetTurnOver("M-test123", "MMDUSFBA"); dc_base_mother_sku_dao.ResetTurnOver("M-LM-EO-007", "MMDUSFBA");
//dc_base_transfer_extend_dao.SynchroLmsTransferOrder(); //dc_base_transfer_extend_dao.SynchroLmsTransferOrder();
//dc_base_full_link_wait_order_dao.ResetDatas(); //dc_base_full_link_wait_order_dao.ResetDatas();
//dc_base_mother_sku_dao.GenerateData(); //dc_base_mother_sku_dao.GenerateData();
......
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