Logistics distribution is one of the main sources of carbon dioxide emissions at present, and there are also such distribution problems in the shipbuilding process. With the increasing attention paid to environmental problems, how to effectively reduce the energy consumption of block transportation and improve the utilization rate of resources in the factory is the key problem that China’s shipbuilding industry needs to solve at present. This article considers the time windows for block transportation tasks, as well as the self-loading constraints of different types of flat cars, and establishes an optimization model that minimizes the empty transport time and energy consumption of the flat cars as the optimization objective. Then, an Improved Genetic Whale Optimization Algorithm is designed, which combines the cross and mutation ideas of genetic algorithms and proposes a whale individual position updating mechanism under a mixed strategy. Furthermore, the performance and computational efficiency of the algorithm are verified through comparative analysis with other classical optimization algorithms on standard test examples. Finally, the shipyard’s block transportation example proves that the energy-saving ship block transportation scheduling method can effectively improve the efficiency of shipbuilding enterprise’s block transportation and reduce the energy consumption in the block transportation process. It proves the engineering practicality of the green dispatching method proposed in this paper, which can further provide a decision-making method for shipyard managers.