Commit 5267f74e by 泽锋 李

【张莹霞/张莹霞1/黄静洁】&& 【BLGBPX】的sku 不用改在线

parent a412b85c
......@@ -905,7 +905,8 @@ now() as 'push_time',
when t_db.warehouse_code in ( 'GZBLWH', 'QYBLZZ' ) and t2.buyer_name not in ('张莹霞','张莹霞1') then IFNULL(t4.sum_usable_stock, 0) - IFNULL(t5.sum_unshipped_quantity, 0)
else t_stock.usable_stock - ifnull(t3.quantity_unshipped,0)
end
) as 'stocks'
) as 'stocks',
t2.buyer_name
from dc_auto_shortage_push as t1
left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku
left join dc_mid_transit as t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code = t3.warehouse_code
......@@ -920,7 +921,8 @@ when t_db.warehouse_code in ( 'GZBLWH', 'QYBLZZ' ) and t2.buyer_name not in ('
when(t3.quantity_out_stock is null or t3.quantity_out_stock <= 0) and ifnull(t_stock.usable_stock,0)> ifnull(t3.quantity_unshipped, 0) then 1
else 0
end
) = 1";
) = 1
";
shortage_list.AddRange(conn.Query<dc_return_goods_push>(sql,new { platform= platform }, commandTimeout: 0));
return shortage_list;
......
......@@ -11,6 +11,7 @@ namespace AutoTurnOver.Models
public int shortage_push_id { get; set; }
public string bailun_sku { get; set; }
public string buyer_name { get; set; }
public string warehouse_code { get; set; }
......
......@@ -534,15 +534,28 @@ namespace AutoTurnOver.Services
}
public void PlatformReturnGoodsPush(string platform)
{
var datas = report.ReturnGoodsPush(platform);
var err_datas = ApiServices.ReturnGoodsPush(datas, platform);
// 先走一遍过滤条件,把数据过滤一遍
var filter_datas = ReturnGoodsPushFilter(datas);
var err_datas = ApiServices.ReturnGoodsPush(filter_datas, platform);
// 记录推送状态
report.AddReturnGoodsPush(datas.Where(s => !err_datas.Any(e => e.warehouseCode == s.warehouse_code && s.bailun_sku == e.sku)));
report.AddReturnGoodsPush(filter_datas.Where(s => !err_datas.Any(e => e.warehouseCode == s.warehouse_code && s.bailun_sku == e.sku)));
// 移除缺货改零记录 (如果以后再没有库存,继续改零)
report.removeShortagePush(datas.Where(s => !err_datas.Any(e => e.warehouseCode == s.warehouse_code && s.bailun_sku == e.sku)).Select(s=>s.shortage_push_id));
}
/// <summary>
/// 过滤掉一部分不需要改在线的数据
/// </summary>
public List<dc_return_goods_push> ReturnGoodsPushFilter(List<dc_return_goods_push> datas)
{
var buyers = new List<string> { "张莹霞", "张莹霞1", "黄静洁" };
var warehouse_codes = new List<string> { "BLGBPX" };
return datas.Where(s => !(buyers.Any(v=>s.buyer_name==v) && warehouse_codes.Any(v => s.warehouse_code == v))).ToList();
}
public List<dynamic> GetSkuWebsiteSales(bailun_sku_website_sales_search_dto search_data)
{
var order_list = report.GetSkuWebsiteSales(search_data);
......
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