|
@@ -57,14 +57,14 @@ public class GatewayController {
|
|
|
gateway.setTerminalNum(gateWayAddParam.getTerminalNum());
|
|
|
gatewayService.save(gateway);
|
|
|
|
|
|
- List terminalList = new ArrayList();
|
|
|
+
|
|
|
for (int i = 1; i <= gateWayAddParam.getTerminalNum(); i++){
|
|
|
Terminal terminal = new Terminal();
|
|
|
terminal.setDeviceCode(deviceCode + i);
|
|
|
terminal.setGatewayId(gateway.getId());
|
|
|
terminal.setBuildId(gateway.getLocationId());
|
|
|
terminal.setFarmId(gateWayAddParam.getFarmId());
|
|
|
- terminalList.add(terminal);
|
|
|
+ terminalService.save(terminal);
|
|
|
List portList = new ArrayList();
|
|
|
for (int j = 1; j < 9; j++){
|
|
|
TerminalPort terminalPort = new TerminalPort();
|
|
@@ -75,7 +75,6 @@ public class GatewayController {
|
|
|
}
|
|
|
portService.saveBatch(portList);
|
|
|
}
|
|
|
- terminalService.saveBatch(terminalList);
|
|
|
|
|
|
return Result.SUCCESS();
|
|
|
}
|