In unmanned aerial vehicle (UAV)-assisted data collection system, UAVs can be deployed to charge ground terminals (GTs) via wireless power transfer (WPT) and collect data from them via wireless information transmission (WIT). In this letter, we aim to minimize the time required by a UAV via jointly optimizing the trajectory of the UAV and the transmission scheduling for all the GTs. This problem is formulated as a mixed integer nonlinear programming (MINLP) which are difficult to address in general. To this end, we develop an iterative algorithm based on binary search and successive convex optimization (SCO) to solve it. The simulation shows that our proposed solution outperforms the benchmark algorithms.