Commit 34934bc8 by 泽锋 李

FIX

parent b014a726
......@@ -602,7 +602,7 @@ left join dc_base_stock as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_
left join dc_auto_config_sku_warehouse as t6 on t1.bailun_sku = t6.bailun_sku and t1.warehouse_code = t6.warehouse_code
left join holiday_supplier_view as t_sp on t2.suppliers_id = t_sp.supplier_id
where
t_sp.supplier_id is not null or
(
( t1.warehouse_code in ('GZBLWH','BLGZ03','YWWH01') ) -- 义务仓 只要停止监控 或者停售就推送
and ( t2.`status`=1 or t6.`status`=1 )
and (ifnull(t1.quantity_unshipped,0) - ifnull(t5.usable_stock,0))>0 -- 有缺货
......@@ -612,6 +612,7 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh
{
sql += $" and not exists ( select * from dc_auto_shortage_push where dc_auto_shortage_push.warehouse_code = t1.warehouse_code and dc_auto_shortage_push.bailun_sku = t1.bailun_sku and dc_auto_shortage_push.`type`=1 and dc_auto_shortage_push.platform='{platform}' and dc_auto_shortage_push.has_return_goods=0 ) ";
}
sql += " ) or t_sp.supplier_id is not null ";
shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(sql, new { platform = platform }, commandTimeout: 0));
// 0库存推送
......@@ -632,7 +633,7 @@ left join dc_base_sku as t3 on t1.bailun_sku = t3.bailun_sku
left join dc_auto_config_sku_warehouse as t6 on t1.bailun_sku = t6.bailun_sku and t1.warehouse_code = t6.warehouse_code
left join holiday_supplier_view as t_sp on t3.suppliers_id = t_sp.supplier_id
where
t_sp.supplier_id is not null or
(
t1.usable_stock<=0 and t1.bailun_sku!=''
and ( t1.warehouse_code in ('GZBLWH','BLGZ03','YWWH01'))
and ( t3.`status`=1 or t6.`status`=1)
......@@ -642,6 +643,7 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh
{
no_library_sql += $" and not exists ( select * from dc_auto_shortage_push where dc_auto_shortage_push.warehouse_code = t1.warehouse_code and dc_auto_shortage_push.bailun_sku = t1.bailun_sku and dc_auto_shortage_push.`type`=2 and dc_auto_shortage_push.platform='{platform}' and dc_auto_shortage_push.has_return_goods=0 ) ";
}
no_library_sql += " ) or t_sp.supplier_id is not null ";
shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(no_library_sql, new { platform = platform }, commandTimeout: 0));
return shortage_list;
......@@ -1031,6 +1033,11 @@ end
{
rule1 = new List<string> { "USGCBL", "BLUSGDC", "US4PXBL", "GB4PXBL" };
}
List<string> ch_rule1 = new List<string>(){ "GZBLWH", "BLGZ03"};
if (platform == "wish")
{
ch_rule1 = new List<string>() { "GZBLWH", "BLGZ03", "YWWH01" };
}
var conn = _connection;
var shortage_list = new List<dc_return_goods_push>();
......@@ -1056,12 +1063,12 @@ left join dc_auto_config_sku_warehouse as t7 on t1.bailun_sku = t7.bailun_sku an
left join (
select t1.bailun_sku,t2.area_id,sum(t1.usable_stock) as 'sum_usable_stock' from dc_base_stock as t1
left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code
where t1.warehouse_code in ( 'GZBLWH', 'BLGZ03' )
where t1.warehouse_code in @ch_rule1
GROUP BY t1.bailun_sku,t2.area_id
) as tc1 on t1.bailun_sku = tc1.bailun_sku and t_db.area_id = tc1.area_id
left join (
select t1.bailun_sku,t2.area_id,sum(t1.quantity_unshipped) as 'sum_unshipped_quantity',sum(t1.quantity_purchase) as 'sum_quantity_purchase' from dc_mid_transit as t1 left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code
where t1.quantity_unshipped>0 and t1.warehouse_code in ( 'GZBLWH', 'BLGZ03' )
where t1.quantity_unshipped>0 and t1.warehouse_code in @ch_rule1
GROUP BY t1.bailun_sku,t2.area_id
) as tc2 on t1.bailun_sku = tc2.bailun_sku and t_db.area_id = tc2.area_id
left join (
......
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