Browse Source

兼容试管不选择滴定区直接移动

master
王梦远 1 week ago
parent
commit
34a07ea066
  1. 16
      src/main/java/com/iflytop/colortitration/app/command/control/transfer/TrayMoveTitrationAreaCommand.java

16
src/main/java/com/iflytop/colortitration/app/command/control/transfer/TrayMoveTitrationAreaCommand.java

@ -32,9 +32,23 @@ public class TrayMoveTitrationAreaCommand extends BaseCommandHandler {
public CompletableFuture<Void> handle(CommandDTO commandDTO) { public CompletableFuture<Void> handle(CommandDTO commandDTO) {
Integer tubeNum = commandDTO.getIntegerParam("tubeNum"); Integer tubeNum = commandDTO.getIntegerParam("tubeNum");
String moduleCode = commandDTO.getStringParam("titrationModuleCode"); String moduleCode = commandDTO.getStringParam("titrationModuleCode");
if (StringUtils.isEmpty(moduleCode) || tubeNum == null) {
if (tubeNum == null) {
throw new AppException(ResultCode.INVALID_PARAMETER);//参数缺失 throw new AppException(ResultCode.INVALID_PARAMETER);//参数缺失
} }
if (StringUtils.isEmpty(moduleCode)) {
boolean titration1Exist = deviceState.getTitrationModuleStateMap().get(MultipleModuleCode.MODULE_1).isTubeExist();
if (!titration1Exist) {
moduleCode = MultipleModuleCode.MODULE_1.name();
} else {
boolean titration2Exist = deviceState.getTitrationModuleStateMap().get(MultipleModuleCode.MODULE_2).isTubeExist();
if (!titration2Exist) {
moduleCode = MultipleModuleCode.MODULE_2.name();
} else {
throw new AppException(ResultCode.TARGET_MODULE_OCCUPIED);//无空闲的滴定位
}
}
}
MultipleModuleCode titrationModuleCode = MultipleModuleCode.valueOf(moduleCode); MultipleModuleCode titrationModuleCode = MultipleModuleCode.valueOf(moduleCode);
boolean trayExist = switch (titrationModuleCode) { //1首先检测试管所在的托盘传感器的值 boolean trayExist = switch (titrationModuleCode) { //1首先检测试管所在的托盘传感器的值
case MultipleModuleCode.MODULE_1 -> deviceState.isTrayExist1(); case MultipleModuleCode.MODULE_1 -> deviceState.isTrayExist1();

Loading…
Cancel
Save