|
|
@ -32,9 +32,23 @@ public class TrayMoveTitrationAreaCommand extends BaseCommandHandler { |
|
|
|
public CompletableFuture<Void> handle(CommandDTO commandDTO) { |
|
|
|
Integer tubeNum = commandDTO.getIntegerParam("tubeNum"); |
|
|
|
String moduleCode = commandDTO.getStringParam("titrationModuleCode"); |
|
|
|
if (StringUtils.isEmpty(moduleCode) || tubeNum == null) { |
|
|
|
if (tubeNum == null) { |
|
|
|
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); |
|
|
|
boolean trayExist = switch (titrationModuleCode) { //1、首先检测试管所在的托盘传感器的值 |
|
|
|
case MultipleModuleCode.MODULE_1 -> deviceState.isTrayExist1(); |
|
|
|