Commit 5a267793 by 泽锋 李

fix

parent c97bc38c
...@@ -875,7 +875,7 @@ order by t1.gmt_modified asc ...@@ -875,7 +875,7 @@ order by t1.gmt_modified asc
/// </summary> /// </summary>
public static void GenerateData() public static void GenerateData()
{ {
var group_list = _connection.Query<temp_turnover_dto>(@"select t1.bailun_sku,GROUP_CONCAT(CONCAT(t1.warehouse_code,'_',t1.daily_weighted_sales,'_',t1.id)) as 'warehouse_codes' from dc_auto_turnover as t1 var group_list = _connection.Query<temp_turnover_dto>(@"select t1.bailun_sku,t2.area_name,GROUP_CONCAT(CONCAT(t1.warehouse_code,'_',t1.daily_weighted_sales,'_',t1.id)) as 'warehouse_codes' from dc_auto_turnover as t1
left join dc_base_warehouse as t2 on t1.warehouse_code =t2.warehouse_code left join dc_base_warehouse as t2 on 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 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.hq_type in ('fba仓') and ifnull(t3.`status`,0)=0 GROUP BY t1.bailun_sku,t2.area_id HAVING count(1)>1 where t2.hq_type in ('fba仓') and ifnull(t3.`status`,0)=0 GROUP BY t1.bailun_sku,t2.area_id HAVING count(1)>1
...@@ -887,7 +887,7 @@ where t2.hq_type in ('fba仓') and ifnull(t3.`status`,0)=0 GROUP BY t1.bailun_s ...@@ -887,7 +887,7 @@ where t2.hq_type in ('fba仓') and ifnull(t3.`status`,0)=0 GROUP BY t1.bailun_s
{ {
var mainData = item.warehouse_datas.OrderByDescending(s => s.daily_weighted_sales).FirstOrDefault(); var mainData = item.warehouse_datas.OrderByDescending(s => s.daily_weighted_sales).FirstOrDefault();
var mother_id = 0; var mother_id = 0;
mother_id = Save(new dc_base_mother_sku { sku = item.bailun_sku, warehouse_code = mainData.warehouse_code }, new UserData() { UserName = "system" }); mother_id = Save(new dc_base_mother_sku { sku = item.bailun_sku+"-"+item.area_name, warehouse_code = mainData.warehouse_code }, new UserData() { UserName = "system" });
// 销量最高的做主sku // 销量最高的做主sku
BatchSet(new batch_set_input_dto { mother_id = mother_id, ids = item.warehouse_datas.Where(s => s.id != mainData.id).Select(s => s.id).ToList() }, new UserData() { UserName = "system" }); BatchSet(new batch_set_input_dto { mother_id = mother_id, ids = item.warehouse_datas.Where(s => s.id != mainData.id).Select(s => s.id).ToList() }, new UserData() { UserName = "system" });
BatchSet(new batch_set_input_dto { mother_id = mother_id, ids = new List<int> { mainData.id }, is_main = 1 }, new UserData() { UserName = "system" }); BatchSet(new batch_set_input_dto { mother_id = mother_id, ids = new List<int> { mainData.id }, is_main = 1 }, new UserData() { UserName = "system" });
...@@ -907,6 +907,7 @@ where t2.hq_type in ('fba仓') and ifnull(t3.`status`,0)=0 GROUP BY t1.bailun_s ...@@ -907,6 +907,7 @@ where t2.hq_type in ('fba仓') and ifnull(t3.`status`,0)=0 GROUP BY t1.bailun_s
{ {
public int id { get; set; } public int id { get; set; }
public string bailun_sku { get; set; } public string bailun_sku { get; set; }
public string area_name { get; set; }
public string warehouse_codes { get; set; } public string warehouse_codes { get; set; }
public List<warehouse_data_dto> warehouse_datas public List<warehouse_data_dto> warehouse_datas
{ {
......
...@@ -34,7 +34,7 @@ namespace ResetOutofstock ...@@ -34,7 +34,7 @@ namespace ResetOutofstock
//dc_base_mother_sku_dao.ResetTurnOver("M-352984501", "GBFBABLA"); //dc_base_mother_sku_dao.ResetTurnOver("M-352984501", "GBFBABLA");
//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();
//dc_auto_turnover.set_full_stock_use_days_turnover_sales(dc_auto_turnover.GetModel("250924601", "USFBABLXJ")); //dc_auto_turnover.set_full_stock_use_days_turnover_sales(dc_auto_turnover.GetModel("250924601", "USFBABLXJ"));
} }
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