The industrial Internet of Things (IIoT) has been viewed as a typical application for the fifth generation (5G) mobile networks. This paper investigates the energy efficiency (EE) optimization problem for the device-to-device (D2D) communications underlaying unmanned aerial vehicles (UAVs)-assisted IIoT networks with simultaneous wireless information and power transfer (SWIPT). We aim to maximize the EE of the system while satisfying the constraints of transmission rate and transmission power budget. However, the designed EE optimization problem is non-convex involving joint optimization of the UAV's location, beam pattern, power control and time scheduling, which is difficult to tackle directly. To solve this problem, we present a joint UAV location and resource allocation algorithm to decouple the original problem into several sub-problems and solve them sequentially. Specifically, we first apply the Dinkelbach method to transform the fraction problem to a subtractive-form one, and propose a mulitiobjective evolutionary algorithm based on decomposition (MOEA/D) based algorithm to optimize the beam pattern. We then optimize UAV's location and power control using the successive convex optimization techniques. Finally, after solving the above variables, the original problem can be transformed into a single-variable problem with respect to the charging time, which is linear and can be tackled directly. Numerical results verify that significant EE gain can be obtained by our proposed algorithm as compared to the benchmark schemes.