Commit 6b86b104 by 泽锋 李

广州03 仓加入监控

parent 303014f8
......@@ -478,18 +478,18 @@ left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
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', 'QYBLZZ' )
where t1.warehouse_code in ( 'GZBLWH', 'QYBLZZ' ,'BLGZ03')
GROUP BY t1.bailun_sku,t2.area_id
) as t3 on t1.bailun_sku = t3.bailun_sku and t_db.area_id = t3.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', 'QYBLZZ' )
where t1.quantity_unshipped>0 and t1.warehouse_code in ( 'GZBLWH', 'QYBLZZ','BLGZ03' )
GROUP BY t1.bailun_sku,t2.area_id
) as t4 on t1.bailun_sku = t4.bailun_sku and t_db.area_id = t4.area_id
left join dc_base_stock as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
left join dc_auto_config_sku_warehouse as t6 on t1.bailun_sku = t6.bailun_sku and t1.warehouse_code = t6.warehouse_code
where
t1.warehouse_code in ('GZBLWH', 'QYBLZZ')
t1.warehouse_code in ('GZBLWH', 'QYBLZZ','BLGZ03')
and t1.bailun_sku not in ('942904501')
and ( t2.buyer_name not in ('张莹霞','张莹霞1','赵美聪','黄镜洁','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站') or t2.`status`=1 )
and ( t1.quantity_purchase<=0 and (ifnull(t4.sum_unshipped_quantity,0) - ifnull(t3.sum_usable_stock,0))>0 ) -- 有缺货
......@@ -520,17 +520,17 @@ left join dc_base_sku as t3 on t1.bailun_sku = t3.bailun_sku
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', 'QYBLZZ' )
where t1.warehouse_code in ( 'GZBLWH', 'QYBLZZ','BLGZ03' )
GROUP BY t1.bailun_sku,t2.area_id
) as t4 on t1.bailun_sku = t4.bailun_sku and t_db.area_id = t4.area_id
left join (
select t1.bailun_sku,t2.area_id,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', 'QYBLZZ' )
where t1.quantity_unshipped>0 and t1.warehouse_code in ( 'GZBLWH', 'QYBLZZ' ,'BLGZ03')
GROUP BY t1.bailun_sku,t2.area_id
) as t5 on t1.bailun_sku = t5.bailun_sku and t_db.area_id = t5.area_id
left join dc_auto_config_sku_warehouse as t6 on t1.bailun_sku = t6.bailun_sku and t1.warehouse_code = t6.warehouse_code
where t1.usable_stock<=0 and t1.bailun_sku!=''
and t1.warehouse_code in ('GZBLWH', 'QYBLZZ')
and t1.warehouse_code in ('GZBLWH', 'QYBLZZ','BLGZ03')
and t1.bailun_sku not in ('942904501')
and ( t3.buyer_name not in ('张莹霞','张莹霞1','赵美聪','黄镜洁','赵美聪','赵美聪1','秦振荣','李华娟','赵美聪-独立站') or t3.`status`=1 )
and (@platform!='aliexpress' or t3.`status`=1 or t6.`status`=1 ) -- 速卖通的必须要停止监控才推送
......
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