diff --git a/src/main/java/com/iflytop/gd/app/cmd/MoveToHeatAreaCommand.java b/src/main/java/com/iflytop/gd/app/cmd/MoveToHeatAreaCommand.java index 0cc4740..ade79e5 100644 --- a/src/main/java/com/iflytop/gd/app/cmd/MoveToHeatAreaCommand.java +++ b/src/main/java/com/iflytop/gd/app/cmd/MoveToHeatAreaCommand.java @@ -41,12 +41,12 @@ public class MoveToHeatAreaCommand extends BaseCommandHandler { if (isExecuting.get()) { throw new AppException(ResultCode.COMMAND_ALREADY_EXECUTING); } - deviceStateService.setGantryArmStateIdle(true); - isExecuting.set(true); String heatId = cmdDTO.getStringParam("heatId"); HeatModuleCode heatModuleId = HeatModuleCode.valueOf(heatId); //校验目标加热位是否有托盘 try{ + deviceStateService.setGantryArmStateIdle(true); + isExecuting.set(true); Boolean heatModuleTray = deviceCommandUtilService.heatModuleTray(heatModuleId); if (!heatModuleTray) { throw new AppException(ResultCode.TARGET_HEAT_MODULE_NO_TRAY); diff --git a/src/main/java/com/iflytop/gd/app/cmd/MoveToSolutionAreaCommand.java b/src/main/java/com/iflytop/gd/app/cmd/MoveToSolutionAreaCommand.java index d3eb455..211ac5d 100644 --- a/src/main/java/com/iflytop/gd/app/cmd/MoveToSolutionAreaCommand.java +++ b/src/main/java/com/iflytop/gd/app/cmd/MoveToSolutionAreaCommand.java @@ -40,12 +40,12 @@ public class MoveToSolutionAreaCommand extends BaseCommandHandler { if (isExecuting.get()) { throw new AppException(ResultCode.COMMAND_ALREADY_EXECUTING); } - deviceStateService.setGantryArmStateIdle(true); - isExecuting.set(true); String heatId = cmdDTO.getStringParam("heatId"); HeatModuleCode heatModuleId = HeatModuleCode.valueOf(heatId); //校验目标加热位是否有托盘 try{ + deviceStateService.setGantryArmStateIdle(true); + isExecuting.set(true); Boolean heatModuleTray = deviceCommandUtilService.heatModuleTray(heatModuleId); if (heatModuleTray) { throw new AppException(ResultCode.TARGET_HEAT_MODULE_OCCUPIED);