Browse Source

预充关闭阀门

master
王梦远 3 days ago
parent
commit
9dc1e8db23
  1. 8
      src/main/java/com/iflytop/handacid/app/service/ChannelCtrlService.java

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

@ -140,6 +140,11 @@ public class ChannelCtrlService {
}
List<CommandFuture> commandFutureList = new ArrayList<>();
for (ChannelState channelState : channelStateList) {
//打开阀门
DeviceCommand valveOpenDeviceCommand = getValveOpenCommandByChannel(channelState.getChannelCode());
CommandFuture valveOpenCommandFuture = deviceCommandService.sendCommand(valveOpenDeviceCommand);
CommandUtil.wait(valveOpenCommandFuture);
DeviceCommand deviceCommand = getPumpForwardRotateCommandByChannel(channelState.getChannelCode());
commandFutureList.add(deviceCommandService.sendCommand(deviceCommand));
AuditRecord auditRecord = new AuditRecord(deviceState.getCurrentUser().getId(), deviceState.getCurrentUser().getNickname(), channelState.getSolutionId(),
@ -173,6 +178,9 @@ public class ChannelCtrlService {
for (ChannelState channelCode : channelCodeList) {
channelCode.setPre(true);
channelCode.setStateCode(ChannelStateCode.IDLE);
//关闭阀门
DeviceCommand valveCloseDeviceCommand = getValveCloseCommandByChannel(channelCode.getChannelCode());
deviceCommandService.sendCommand(valveCloseDeviceCommand);
}
}
});

Loading…
Cancel
Save