GO ahead, do the opposite of what I said. You can repair all sorts of things but if you have a trash battery you are back with a bike frame with wheels & pedals. Enjoy pedaling your bike unpowered into a 25 mph headwind.
I bought a new controller and 1. the brake connectors don't match any of 3 sets of handles 2. the pas sensor connector doesn't match my sensor 3. the throttle connector doesn't match any of the 3 throttles I have . My brake handles come with two varieties of connector plus one set is normally closed, the other set normally open. The controller connectors were labeled in the e-bay ad but I am not allowed to download pictures from ebay. When the controller got here the connector labels were only in chinese.
The best way to get a controller, display, brake handles, pas pickup, motor, that all match is to buy them as a kit from one vendor. ~$300 for geared hub motor & ~$200 for direct drive motor. The wheel is thrown in. You can add a battery for ~$300 more. If it turns out your old motor has the same connector as the new one & works, fine, drive it until it wears out. Then you have a spare in the shed if you wear the gears (I did @ ~4500 mi).
Or you can buy things one at a time and nothing ever works because they don't match up. Those weird connectors are sold on alibaba in lots of 100000 and you need an air tool and dies to crimp them on the wires. The brake & sensor connectors don't have names to search for them. The 11 pin juli connector is injection molded on the pins and wires, not crimped.