Commit d3a2f399 by lizefeng

增量推送广州03仓,记录百伦单号

parent 9ae1eb18
......@@ -391,7 +391,7 @@ where t2.`status`=2 and t1.bailun_sku = t2.bailun_sku and quantity_final_advise=
_connection.Execute(@" INSERT into dc_auto_purchase_advise_detailed(`bailun_sku`,`warehouse_code`,`quantity_init_advise`,`quantity_final_advise`,
`product_inner_code`,`goods_quantity_init_advise`,`goods_moq`,`good_sku_codes`,`goods_history_fourteenday_sales`,`history_fourteenday_sales`,
`quantity_actual`,`main_id`,
`forecast_formula`,`fit_forecast_formula`,`turnover_days`,`supplier_delivery`,`inspection_delivery`,`transfer_delivery`,`sales_upper_limit`,`ispush`,`type`,`suppliers_id`,`quantity_out_stock`,`purchase_type_jit`)
`forecast_formula`,`fit_forecast_formula`,`turnover_days`,`supplier_delivery`,`inspection_delivery`,`transfer_delivery`,`sales_upper_limit`,`ispush`,`type`,`suppliers_id`,`quantity_out_stock`,`purchase_type_jit`,`bailun_order_ids`)
(
select
t1.bailun_sku,
......@@ -417,13 +417,14 @@ where t2.`status`=2 and t1.bailun_sku = t2.bailun_sku and quantity_final_advise=
2 as 'type',
t6.suppliers_id,
t7.quantity_out_stock,
0 as 'purchase_type_jit'
0 as 'purchase_type_jit',
t8.bailun_order_ids
from dc_base_stock as t1
left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code
left join ( select bailun_sku,sum(bailun_sku_quantity_ordered) as 'quantity' from dc_base_oms_sku where warehouse_code in ('BLGZ03') and website='us' and gmt_create>@time GROUP BY bailun_sku ) as t8 on t1.bailun_sku =t8.bailun_sku
left join ( select bailun_sku,sum(bailun_sku_quantity_ordered) as 'quantity',GROUP_CONCAT(bailun_order_id) as 'bailun_order_ids' from dc_base_oms_sku where warehouse_code in ('BLGZ03') and website='us' and gmt_create>@time GROUP BY bailun_sku ) as t8 on t1.bailun_sku =t8.bailun_sku
where t6.`status`=2 and ( t6.buyer_name in ('赵美聪') and t1.warehouse_code in ('BLGZ03') )
and t6.suppliers_name not in ('深圳市龙岗区平湖欧妮菲制衣厂','深圳市福田区曼戈制衣厂')
and ( t5.`status`=0 or t5.`status` is null ) and t8.quantity>0
......
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