From 053acbbca888f03179dbf64aa1e6df9ef7e43aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Fri, 1 Aug 2025 15:38:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BD=BF=E7=94=A8=E7=9A=84=E9=87=8F?= =?UTF-8?q?=E5=86=99=E5=85=A5=E5=88=B0=E6=95=B0=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iflytop/handacid/app/service/ChannelCtrlService.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/iflytop/handacid/app/service/ChannelCtrlService.java b/src/main/java/com/iflytop/handacid/app/service/ChannelCtrlService.java index bdcdb61..3b709a9 100644 --- a/src/main/java/com/iflytop/handacid/app/service/ChannelCtrlService.java +++ b/src/main/java/com/iflytop/handacid/app/service/ChannelCtrlService.java @@ -12,8 +12,10 @@ import com.iflytop.handacid.app.core.command.DeviceCommandGenerator; import com.iflytop.handacid.app.core.state.ChannelState; import com.iflytop.handacid.app.core.state.DeviceState; import com.iflytop.handacid.common.model.entity.AuditRecord; +import com.iflytop.handacid.common.model.entity.Channel; import com.iflytop.handacid.common.model.entity.Formulation; import com.iflytop.handacid.common.service.AuditRecordService; +import com.iflytop.handacid.common.service.ChannelService; import com.iflytop.handacid.common.service.FormulationService; import com.iflytop.handacid.common.service.SystemConfigService; import lombok.RequiredArgsConstructor; @@ -36,11 +38,15 @@ public class ChannelCtrlService { private final DeviceState deviceState; private final AuditRecordService auditRecordService; private final SystemConfigService systemConfigService; + private final ChannelService channelService; /** * 开始加液 */ public void solutionAddStart() { + if(deviceState.isSolutionAdding()){ + return; + } CompletableFuture.runAsync(() -> { List channelStateList = deviceState.filterChannelStatesIsSelected(); try { @@ -84,6 +90,9 @@ public class ChannelCtrlService { currentVolume = 0; } channelState.setCurrentVolume(currentVolume); + Channel channel = channelService.getOne(new LambdaQueryWrapper<>(new Channel()).eq(Channel::getCode, channelState.getChannelCode())); + channel.setCurrentVolume(currentVolume); + channelService.updateById(channel); AuditRecord auditRecord = new AuditRecord(deviceState.getCurrentUser().getId(), deviceState.getCurrentUser().getNickname(), channelState.getSolutionId(), channelState.getSolutionName(), formulation.getConcentration(), channelState.getChannelCode().name(), dispensedVolume); auditRecordService.saveOrUpdate(auditRecord); @@ -123,6 +132,9 @@ public class ChannelCtrlService { currentVolume = 0; } channelState.setCurrentVolume(currentVolume); + Channel channel = channelService.getOne(new LambdaQueryWrapper<>(new Channel()).eq(Channel::getCode, channelState.getChannelCode())); + channel.setCurrentVolume(currentVolume); + channelService.updateById(channel); AuditRecord auditRecord = new AuditRecord(deviceState.getCurrentUser().getId(), deviceState.getCurrentUser().getNickname(), channelState.getSolutionId(), channelState.getSolutionName(), formulation.getConcentration(), channelState.getChannelCode().name(), dispensedVolume); auditRecordService.saveOrUpdate(auditRecord);