_connection.Execute(@" update dc_auto_turnover as t1,
dc_base_sku as t2
set t1.adv_uid = CONCAT(t2.product_inner_code,t2.suppliers_id,t1.warehouse_code)
where t1.bailun_sku = t2.bailun_sku and t1.gmt_modified>=@btime
",new{btime=date},commandTimeout:0);
//RedundancyDeduction("QYBLZZ", "GZBLWH");
//RedundancyDeduction("QYBLZZ", "GZBLWH");
//RedundancyDeduction("GZBLWH", "QYBLZZ");
//RedundancyDeduction("GZBLWH", "QYBLZZ");
...
@@ -487,15 +491,15 @@ tr_task.remarks as 'replace_logistics_remarks',
...
@@ -487,15 +491,15 @@ tr_task.remarks as 'replace_logistics_remarks',
t9.quantity_transfer_order as 'quantity_transfer_order',
t9.quantity_transfer_order as 'quantity_transfer_order',
t9.quantity_transfer_temp_schedule as 'quantity_transfer_temp_schedule',
t9.quantity_transfer_temp_schedule as 'quantity_transfer_temp_schedule',
t9.quantity_transfer_temporary_storage as 'quantity_transfer_temporary_storage'
t9.quantity_transfer_temporary_storage as 'quantity_transfer_temporary_storage'
from dc_auto_turnover as t1
from (select * from dc_auto_turnover where gmt_modified>=@btime ) 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_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_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_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
left join dc_aims_goods_moq as t7 on t6.product_inner_code = t7.product_inner_code and t1.warehouse_code = t7.warehouse_code and t6.suppliers_id = t7.suppliers_id
left join dc_aims_goods_moq as t7 on t1.adv_uid = t7.u_id
left join dc_auto_jit_tag as t8 on t1.tag_id = t8.id
left join dc_auto_jit_tag as t8 on t1.tag_id = t8.id
left join dc_auto_replace_logistics_task as tr_task on t1.auto_replace_logistics_task_id = tr_task.id
left join dc_auto_replace_logistics_task as tr_task on t1.auto_replace_logistics_task_id = tr_task.id
left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse_code = t9.warehouse_code
left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse_code = t9.warehouse_code
where t1.gmt_modified>=@btime
where 1=1
and t6.`status`=2
and t6.`status`=2
-- and (t1.history_fourteenday_sales>0 or t1.quantity_out_stock>0 )
-- and (t1.history_fourteenday_sales>0 or t1.quantity_out_stock>0 )
and ( t5.`status`=0 or t5.`status` is null ) and t7.sum_quantity_init_advise>0
and ( t5.`status`=0 or t5.`status` is null ) and t7.sum_quantity_init_advise>0