Commit 354945cf by 泽锋 李

fix

parent 5b214046
......@@ -465,7 +465,9 @@ now() as 'push_date',
1 as 'type',
t5.usable_stock as 'stocks',
@platform as 'platform',
0 as 'has_return_goods'
0 as 'has_return_goods',
t2.buyer_name,
t_db.hq_type as 'warehouse_type'
from dc_mid_transit as t1
left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
......@@ -503,6 +505,8 @@ now() as 'push_date',
0 as 'stocks',
@platform as 'platform',
0 as 'has_return_goods',
t3.buyer_name,
t_db.hq_type as 'warehouse_type'
2 as 'type' from dc_base_stock as t1
left join dc_mid_transit as t2 on t1.warehouse_code =t2.warehouse_code and t1.bailun_sku =t2.bailun_sku
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
......@@ -554,7 +558,9 @@ now() as 'push_date',
1 as 'type',
t5.usable_stock as 'stocks',
@platform as 'platform',
0 as 'has_return_goods'
0 as 'has_return_goods',
t2.buyer_name,
t_db.hq_type as 'warehouse_type'
from dc_mid_transit as t1
left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
......@@ -588,9 +594,12 @@ now() as 'push_date',
0 as 'stocks',
@platform as 'platform',
2 as 'type' ,
0 as 'has_return_goods'
0 as 'has_return_goods',
t2.buyer_name,
t_db.hq_type as 'warehouse_type'
from dc_base_stock as t1
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku
left join (
select t1.bailun_sku,t2.area_id,sum(t1.usable_stock) as 'usable_stock' from dc_base_stock as t1
left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code
......@@ -598,7 +607,7 @@ left join (
GROUP BY t1.bailun_sku,t2.area_id
) as t6 on t1.bailun_sku = t6.bailun_sku and t_db.area_id = t6.area_id
where t1.warehouse_code in @warehouse_codes
and ifnull(t6.usable_stock,0)<=0
and ifnull(t6.usable_stock,0)<=(case when t2.buyer_name in ('张莹霞','张莹霞1') and @platform='ebay' then 2 else 0 end )
and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_shortage_push_not_config.warehouse_code=t1.warehouse_code and dc_auto_shortage_push_not_config.bailun_sku=t1.bailun_sku )
";
if (!is_all)
......
......@@ -14,6 +14,7 @@ namespace AutoTurnOver.Models
public string bailun_sku { get; set; }
public string warehouse_code { get; set; }
public string warehouse_type { get; set; }
/// <summary>
/// 是否回货
......@@ -39,5 +40,6 @@ namespace AutoTurnOver.Models
/// 平台
/// </summary>
public string platform { get; set; }
public string buyer_name { get; set; }
}
}
......@@ -456,7 +456,7 @@ namespace AutoTurnOver.Services
try
{
List<dc_auto_shortage_push> datas = new List<dc_auto_shortage_push>();
datas.AddRange(report.ChinaShortagePush(item, is_all));
datas.AddRange(report.ChinaShortagePush(item, is_all));
var err_datas = ApiServices.ShortagePush(datas, item);
// 记录推送状态
report.AddShortagePush(datas.Where(s => !err_datas.Any(e => e.warehouseCode == s.warehouse_code && s.bailun_sku == e.sku)));
......@@ -514,6 +514,22 @@ namespace AutoTurnOver.Services
}
/// <summary>
/// 过滤掉一部分不需要改在0的数据
/// </summary>
public List<dc_auto_shortage_push> ShortagePushFilter(List<dc_auto_shortage_push> datas,string platform)
{
var new_datas = datas.ToJson().ToObj<List<dc_auto_shortage_push>>();
// 规则一 如果不是ebay 过滤掉 张莹霞国内仓的数据
if (!"ebay".Equals(platform))
{
var buyers = new List<string> { "张莹霞", "张莹霞1" };
new_datas = new_datas.Where(s => !(buyers.Any(v => s.buyer_name == v) && s.warehouse_type == "国内仓")).ToList();
}
return new_datas;
}
/// <summary>
/// 缺货推送
/// </summary>
public void EbayShortagePush(bool is_all = false)
......
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