Browse Source

fix:获取当前溶液量只保留整数

master
白凤吉 2 days ago
parent
commit
4eb8f50faa
  1. 8
      src/main/java/com/iflytop/handacid/app/core/state/ChannelState.java

8
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;

Loading…
Cancel
Save