Commit ec57eb56 by lizefeng

优化缺货明细算法

parent 5f08a2de
......@@ -798,7 +798,117 @@ Truncate table dc_base_oms_sku_outofstock_temp;
INSERT into dc_base_oms_sku_outofstock_temp (
select
t1.*,( CASE WHEN ( `t1`.`warehouse_code` IN ( 'QYBLZZ', 'GZBLWH' ) ) THEN 'QYBLZZ-GZBLWH' ELSE `t1`.`warehouse_code` END ) as 'warehouse_code_extend'
t1.`id`,
t1.`origin_order_id`,
t1.`platform_type`,
t1.`transaction_id`,
t1.`pay_time`,
t1.`pay_method`,
t1.`pay_account`,
t1.`pay_status`,
t1.`collection_account`,
t1.`platform_order_type`,
t1.`website`,
t1.`create_time`,
t1.`paid_time`,
t1.`refund_time`,
t1.`seller_id`,
t1.`bailun_account_id`,
t1.`hq_account`,
t1.`seller_account`,
t1.`seller_order_id`,
t1.`seller_email`,
t1.`order_update_time`,
t1.`seller_order_exchange_rate`,
t1.`seller_other_exchange_rate`,
t1.`finance_order_exchange_rate`,
t1.`finance_other_exchange_rate`,
t1.`cny_to_usd_exchange_rate`,
t1.`order_to_usd_exchange_rate`,
t1.`other_to_usd_exchange_rate` ,
t1.`order_currency`,
t1.`other_currency`,
t1.`seller_name`,
t1.`bailun_order_id`,
t1.`platform_order_status`,
t1.`bailun_order_status`,
t1.`bailun_payment_status`,
t1.`bailun_interception_status`,
t1.`shipping_status`,
t1.`bailun_sku`,
t1.`bailun_sku_title_en`,
t1.`bailun_sku_title_cn`,
t1.`bailun_sku_quantity_ordered`,
t1.`bailun_sku_quantity_shipped`,
t1.`bailun_sku_quantity_refund`,
t1.`bailun_sku_quantity_picked`,
t1.`warehouse_name`,
t1.`warehouse_code_fba`,
t1.`warehouse_code`,
t1.`bailun_sku_unit_price`,
t1.`bailun_sku_weight`,
t1.`bailun_sku_size`,
t1.`amount_sales`,
t1.`amount_total`,
t1.`amount_shipping`,
t1.`amount_product`,
t1.`amount_tax`,
t1.`amount_adjustment`,
t1.`amount_gift_wrap`,
t1.`amount_refund`,
t1.`amount_prepaid`,
t1.`cost_total`,
t1.`cost_promotion`,
t1.`cost_platform_fee`,
t1.`cost_product`,
t1.`cost_shipping`,
t1.`cost_package`,
t1.`cost_fba_fee`,
t1.`cost_paypal_fee`,
t1.`cost_refund_commisson`,
t1.`cost_handle_bailun`,
t1.`cost_handle_platform`,
t1.`cost_tail`,
t1.`cost_first`,
t1.`cost_logistics`,
t1.`profit_total`,
t1.`profit_rate`,
t1.`receipt_country`,
t1.`receipt_city`,
t1.`receipt_area`,
t1.`receipt_address`,
t1.`receipt_address_2`,
t1.`receipt_postal_code`,
t1.`receiver`,
t1.`receiver_phone`,
t1.`buyer_id`,
t1.`buyer_name`,
t1.`buyer_email`,
t1.`has_fba_exception`,
t1.`has_platform_exception`,
t1.`has_cancle`,
t1.`area_id`,
t1.`bailun_category_id`,
t1.`bailun_category_name`,
t1.`gmt_create`,
t1.`gmt_modified`,
t1.`ratio_weight`,
t1.`ratio_price`,
t1.`bailun_picking_status`,
t1.`bailun_require_logistics`,
t1.`has_delete`,
t1.`has_scalp`,
t1.`logistics_method_code`,
t1.`logistics_method_name`,
t1.`has_innersale`,
t1.`company_id`,
t1.`bailun_refund_status`,
t1.`refund_obj`,
t1.`refund_type`,
t1.`refund_reference_id`,
t1.`has_fba_s`,
t1.`bailun_sku_quantity_pushed`,
( CASE WHEN ( `t1`.`warehouse_code` IN ( 'QYBLZZ', 'GZBLWH' ) ) THEN 'QYBLZZ-GZBLWH' ELSE `t1`.`warehouse_code` END ) as 'warehouse_code_extend'
from dc_base_oms_sku as t1
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
......
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