From 4eb8f50faafca2f9fe15f6a375c75a9bc6f70a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Sat, 2 Aug 2025 09:59:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=8E=B7=E5=8F=96=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E6=BA=B6=E6=B6=B2=E9=87=8F=E5=8F=AA=E4=BF=9D=E7=95=99=E6=95=B4?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iflytop/handacid/app/core/state/ChannelState.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/iflytop/handacid/app/core/state/ChannelState.java b/src/main/java/com/iflytop/handacid/app/core/state/ChannelState.java index 349a472..504cd3b 100644 --- a/src/main/java/com/iflytop/handacid/app/core/state/ChannelState.java +++ b/src/main/java/com/iflytop/handacid/app/core/state/ChannelState.java @@ -9,6 +9,9 @@ import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; +import java.math.BigDecimal; +import java.math.RoundingMode; + @Schema(description = "通道状态") @Data @Component @@ -47,6 +50,11 @@ public class ChannelState { @Schema(description = "领取溶液量(单位:mL)") private volatile Double receivedVolume; + public Integer getCurrentVolume() { + BigDecimal bd = BigDecimal.valueOf(currentVolume); + return bd.setScale(0, RoundingMode.DOWN).intValue(); + } + public ChannelState(ChannelCode channelCode, Double concentration, Double targetVolume, Double receivedVolume, Double currentVolume) { this.channelCode = channelCode; this.concentration = concentration;