There are three forces doing work. The applied one, gravity and friction. According to the work-energy theorem, the change of KE equal to the work done on the body. It moves with constant speed, KE does not change. The entire work done of all forces is zero. You obtained the magnitude of the work of gravity, now get the work of the constant force, and decide which one is positive and which is negative. The work of the dissipative force + work of gravity + work of applied force = 0

There is work done by the applied force, 40 m* 9 kN = 360 kJ. Gravity does negative work as the force is opposite to the vertical displacement. This work is -240 kJ. The third is the work of friction or other dissipative force Wd, it opposes motion so it has to be taken with negative sign. 360-240-Wd=0
You can think on an other way. The applied force increases the potential energy as it lifts up the body by 12 m. The work of the applied force is 360 kJ, the change of PE is 240 kJ. The difference will be dissipated, as the KE does not change.