Commit 714a87d8 by 泽锋 李

母sku采购建议

parent 44a60596
...@@ -673,7 +673,7 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware ...@@ -673,7 +673,7 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware
not_mother_datas = not_mother_datas.Where(s=> !maps.Any(v=>v.bailun_sku_warehouse_code==s.bailun_sku_warehouse_code)).ToList(); not_mother_datas = not_mother_datas.Where(s=> !maps.Any(v=>v.bailun_sku_warehouse_code==s.bailun_sku_warehouse_code)).ToList();
foreach (var item in mother_datas) foreach (var item in mother_datas)
{ {
if (item.bailun_sku == "M-352984501" ) if (item.bailun_sku == "M-221622401-美国")
{ {
} }
...@@ -1172,14 +1172,16 @@ where t1.bailun_order_status != 'Canceled' ...@@ -1172,14 +1172,16 @@ where t1.bailun_order_status != 'Canceled'
and t1.paid_time>=@btime "; and t1.paid_time>=@btime ";
foreach (var item in originalDatas) foreach (var item in originalDatas)
{ {
if (item.is_mother_map_sku == 0)
{
DynamicParameters parameters = new DynamicParameters(); DynamicParameters parameters = new DynamicParameters();
parameters.Add("btime", btime); parameters.Add("btime", btime);
parameters.Add("bailun_sku",item.bailun_sku); parameters.Add("bailun_sku", item.bailun_sku);
parameters.Add("warehouse_code", item.warehouse_code); parameters.Add("warehouse_code", item.warehouse_code);
// 新品 (只出过一个单,就只补缺货了) // 新品 (只出过一个单,就只补缺货了)
var orders = _connection.QueryFirstOrDefault<int?>(order_sql+ " and bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", parameters) ?? 0; var orders = _connection.QueryFirstOrDefault<int?>(order_sql + " and bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", parameters) ?? 0;
//新旧品判定 //新旧品判定
if ( item.first_order_date!=null && (now - item.first_order_date.Value).TotalDays > 14) if (item.first_order_date != null && (now - item.first_order_date.Value).TotalDays > 14)
{ {
// 旧品 // 旧品
if (orders <= 1) if (orders <= 1)
...@@ -1192,12 +1194,14 @@ where t1.bailun_order_status != 'Canceled' ...@@ -1192,12 +1194,14 @@ where t1.bailun_order_status != 'Canceled'
{ {
if (orders <= 1) if (orders <= 1)
{ {
item.quantity_final_advise = (int)Math.Ceiling( item.fixed_quantity_out_stock??0); item.quantity_final_advise = (int)Math.Ceiling(item.fixed_quantity_out_stock ?? 0);
item.remarks = $"新品({item.first_order_date}), 30天内只出了 {orders} 单,只补缺货 ({(item.fixed_quantity_out_stock ?? 0)}) "; item.remarks = $"新品({item.first_order_date}), 30天内只出了 {orders} 单,只补缺货 ({(item.fixed_quantity_out_stock ?? 0)}) ";
} }
} }
}
datas.Add(item); datas.Add(item);
} }
......
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