Browse Source

fix:修复循环依赖

master
白凤吉 4 days ago
parent
commit
59ea542004
  1. 7
      src/main/java/com/iflytop/handacid/app/service/ChannelCtrlService.java

7
src/main/java/com/iflytop/handacid/app/service/ChannelCtrlService.java

@ -29,7 +29,6 @@ import java.util.concurrent.CompletableFuture;
@RequiredArgsConstructor
public class ChannelCtrlService {
private final FormulationService formulationService;
private final ChannelCtrlService channelCtrlService;
private final DeviceCommandService deviceCommandService;
private final DeviceState deviceState;
@ -48,7 +47,7 @@ public class ChannelCtrlService {
List<CommandFuture> commandFutureList = new ArrayList<>();
for (ChannelState channelState : channelStateList) {
Formulation formulation = formulationService.getOne(new LambdaQueryWrapper<Formulation>().eq(Formulation::getSolutionId, channelState.getSolutionId()));
DeviceCommand deviceCommand = channelCtrlService.getPumpMoveByCommandByChannel(channelState.getChannelCode(), formulation.getRevolutions());
DeviceCommand deviceCommand = getPumpMoveByCommandByChannel(channelState.getChannelCode(), formulation.getRevolutions());
commandFutureList.add(deviceCommandService.sendCommand(deviceCommand));
}
CommandUtil.wait(commandFutureList);
@ -58,7 +57,7 @@ public class ChannelCtrlService {
List<CommandFuture> commandFutureList = new ArrayList<>();
for (ChannelState channelState : channelStateList) {
Formulation formulation = formulationService.getOne(new LambdaQueryWrapper<Formulation>().eq(Formulation::getSolutionId, channelState.getSolutionId()));
DeviceCommand deviceCommand = channelCtrlService.getPumpMoveByCommandByChannel(channelState.getChannelCode(), formulation.getRevolutions());
DeviceCommand deviceCommand = getPumpMoveByCommandByChannel(channelState.getChannelCode(), formulation.getRevolutions());
commandFutureList.add(deviceCommandService.sendCommand(deviceCommand));
}
CommandUtil.wait(commandFutureList);
@ -86,7 +85,7 @@ public class ChannelCtrlService {
}
List<CommandFuture> commandFutureList = new ArrayList<>();
for (ChannelState channelState : channelStateList) {
DeviceCommand deviceCommand = channelCtrlService.getPumpForwardRotateCommandByChannel(channelState.getChannelCode());
DeviceCommand deviceCommand = getPumpForwardRotateCommandByChannel(channelState.getChannelCode());
commandFutureList.add(deviceCommandService.sendCommand(deviceCommand));
}
CommandUtil.wait(commandFutureList);

Loading…
Cancel
Save