Due to its NP-Hard property, the Travelling Salesman Problem (TSP) has long been a prominent research topic in path planning. The goal is to design the algorithm with the fastest execution speed in order to find the path with the lowest travelling cost. In particular, new generative AI technology is continually emerging. The question of how to exploit algorithms from this realm to perform TSP path planning, especially in dynamic environments, is an important and interesting problem. The TSP application scenario investigated by this paper is that of an Unmanned Aerial Vehicle (UAV) that needs to patrol all specific ship-targets on the sea surface before returning to its origin. Hence, during the flight, we must consider real-time changes in wind velocity and direction, as well as the dynamic addition or removal of ship targets due to mission requirements. Specifically, we implement a Deep Reinforcement Learning (DRL) model based on the Transformer architecture, which is widely used in Generative AI, to solve the TSP path-planning problem in dynamic environments. Finally, we conduct numerous simulation experiments to compare the performance of our DRL model and the traditional heuristic algorithm, the Simulated Annealing (SA) method, in terms of operation time and path distance in solving the ordinary TSP, to verify the advantages of our model. Notably, traditional heuristic algorithms cannot be applied to dynamic environments, in which wind velocity and direction can change at any time.