The container terminal is a crucial transshipment node in the sea and land cargo transport supply chain, and the efficiency of container collection and distribution has always been a research hotspot. In this paper, we consider the impact of transshipment containers resulting from various uncertainties and integrate the operations of external truck pickups with the handling of transshipment containers in the import yard of the container terminal. In light of the varying number of transshipment containers and transit times for different blocks, coupled with the unpredictable arrival order of external trucks leading to the unknown number of relocations, it is proposed to dynamically adjust the upper limit of the appointed quota for each block. We establish a two stage mixed integer programming model for the truck appointment quota and the block relocation problem. The objective functions aim to minimize the number of relocations and minimize the number of yard crane moves under the maximal appointment quota, respectively. This model is utilized for dynamically regulating the upper limit of the appointed quota for each block and determining the time intervals for picking up the appointed and transshipment containers, along with the yard crane scheduling scheme. The problem is solved using CPLEX and the improved variable neighborhood search algorithm (IVNS). The IVNS incorporates the correction strategy, decoding strategy, and scheduling rules designed to align closely with the characteristics of the problem. Through scheme comparison and sensitivity analysis, five management insights are proposed for terminals. Experimental results demonstrate that the approach presented in this paper effectively enhances the utilization efficiency of yard cranes, reduces yard congestion, and yields benefits for both terminals and trucking companies.