Commit 8e0c9d34 by 泽锋 李

fix

parent 6288b2b8
...@@ -870,12 +870,22 @@ where t2.hq_type in ('fba仓') and ifnull(t3.`status`,0)=0 GROUP BY t1.bailun_s ...@@ -870,12 +870,22 @@ where t2.hq_type in ('fba仓') and ifnull(t3.`status`,0)=0 GROUP BY t1.bailun_s
foreach (var item in group_list) foreach (var item in group_list)
{ {
var mainData = item.warehouse_datas.OrderByDescending(s => s.daily_weighted_sales).FirstOrDefault(); try
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" }); var mainData = item.warehouse_datas.OrderByDescending(s => s.daily_weighted_sales).FirstOrDefault();
// 销量最高的做主sku var mother_id = 0;
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" }); mother_id = Save(new dc_base_mother_sku { sku = item.bailun_sku, warehouse_code = mainData.warehouse_code }, 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" }); // 销量最高的做主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 = new List<int> { mainData.id }, is_main = 1 }, new UserData() { UserName = "system" });
}
catch (Exception ex)
{
Console.WriteLine($"子母sku刷新 {item.bailun_sku} "+ex.Message);
Console.WriteLine($"子母sku刷新 {item.bailun_sku} "+ex.StackTrace);
//Console.WriteLine($"子母sku刷新 {item.bailun_sku} "+ item.ToJson());
}
} }
} }
......
...@@ -341,7 +341,7 @@ namespace ResetOutofstock ...@@ -341,7 +341,7 @@ namespace ResetOutofstock
{ {
while (true) while (true)
{ {
Thread.Sleep(10 * 60 * 1000);
try try
{ {
if (DateTime.Now.Hour > 8) if (DateTime.Now.Hour > 8)
...@@ -350,7 +350,7 @@ namespace ResetOutofstock ...@@ -350,7 +350,7 @@ namespace ResetOutofstock
dc_base_mother_sku_dao.GenerateData(); dc_base_mother_sku_dao.GenerateData();
Console.WriteLine($"结束刷新 子母sku数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"结束刷新 子母sku数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
} }
Thread.Sleep(10 * 60 * 1000);
} }
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