From 0945e87a95cc30e05d3a6bfe89adbe03acd51fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Wed, 11 Jun 2025 20:44:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=B7=A5=E8=89=BA=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E4=B8=8D=E8=83=BD=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iflytop/gd/app/command/control/FanStartCommand.java | 7 +++++++ .../java/com/iflytop/gd/app/command/control/FanStopCommand.java | 7 +++++++ .../java/com/iflytop/gd/app/command/control/HeatStartCommand.java | 8 +++++++- .../java/com/iflytop/gd/app/command/control/HeatStopCommand.java | 7 +++++++ .../com/iflytop/gd/app/command/control/MoveToHeatAreaCommand.java | 5 ++++- .../iflytop/gd/app/command/control/MoveToSolutionAreaCommand.java | 5 ++++- .../com/iflytop/gd/app/command/control/ShakeStartCommand.java | 7 ++++++- .../java/com/iflytop/gd/app/command/control/ShakeStopCommand.java | 7 +++++++ .../com/iflytop/gd/app/command/control/SolutionAddCommand.java | 5 +++++ .../java/com/iflytop/gd/app/command/control/TakePhotoCommand.java | 5 +++++ .../java/com/iflytop/gd/app/command/control/TrayDownCommand.java | 6 ++++++ .../java/com/iflytop/gd/app/command/control/TrayUpCommand.java | 6 ++++++ .../com/iflytop/gd/app/command/control/WarmUpStartCommand.java | 7 +++++++ .../java/com/iflytop/gd/app/service/crafts/CraftsStepService.java | 5 +++-- 14 files changed, 81 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/iflytop/gd/app/command/control/FanStartCommand.java b/src/main/java/com/iflytop/gd/app/command/control/FanStartCommand.java index 33878a4..94bbc3c 100644 --- a/src/main/java/com/iflytop/gd/app/command/control/FanStartCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/control/FanStartCommand.java @@ -1,11 +1,14 @@ package com.iflytop.gd.app.command.control; import com.iflytop.gd.app.core.BaseCommandHandler; +import com.iflytop.gd.app.model.bo.status.device.TrayState; import com.iflytop.gd.app.model.dto.CmdDTO; import com.iflytop.gd.app.service.device.DeviceStateService; import com.iflytop.gd.app.service.device.module.HeatModuleService; import com.iflytop.gd.common.annotation.CommandMapping; import com.iflytop.gd.common.enums.HeatModuleCode; +import com.iflytop.gd.common.exception.AppException; +import com.iflytop.gd.common.result.ResultCode; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -27,6 +30,10 @@ public class FanStartCommand extends BaseCommandHandler { public CompletableFuture handle(CmdDTO cmdDTO) { String heatId = cmdDTO.getStringParam("heatId"); HeatModuleCode heatModuleCode = HeatModuleCode.valueOf(heatId); + TrayState trayState = deviceStateService.getDeviceState().getTrayStateByHeatModuleCode(heatModuleCode); + if (trayState != null && trayState.getCrafts() != null) { + throw new AppException(ResultCode.CRAFT_RUNNING); + } return runAsync(() -> { heatModuleService.fanStart(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode); deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setFanOpen(true); diff --git a/src/main/java/com/iflytop/gd/app/command/control/FanStopCommand.java b/src/main/java/com/iflytop/gd/app/command/control/FanStopCommand.java index 76066b0..a684242 100644 --- a/src/main/java/com/iflytop/gd/app/command/control/FanStopCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/control/FanStopCommand.java @@ -1,11 +1,14 @@ package com.iflytop.gd.app.command.control; import com.iflytop.gd.app.core.BaseCommandHandler; +import com.iflytop.gd.app.model.bo.status.device.TrayState; import com.iflytop.gd.app.model.dto.CmdDTO; import com.iflytop.gd.app.service.device.DeviceStateService; import com.iflytop.gd.app.service.device.module.HeatModuleService; import com.iflytop.gd.common.annotation.CommandMapping; import com.iflytop.gd.common.enums.HeatModuleCode; +import com.iflytop.gd.common.exception.AppException; +import com.iflytop.gd.common.result.ResultCode; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -27,6 +30,10 @@ public class FanStopCommand extends BaseCommandHandler { public CompletableFuture handle(CmdDTO cmdDTO) { String heatId = cmdDTO.getStringParam("heatId"); HeatModuleCode heatModuleCode = HeatModuleCode.valueOf(heatId); + TrayState trayState = deviceStateService.getDeviceState().getTrayStateByHeatModuleCode(heatModuleCode); + if (trayState != null && trayState.getCrafts() != null) { + throw new AppException(ResultCode.CRAFT_RUNNING); + } return runAsync(() -> { heatModuleService.fanClose(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode); deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setFanOpen(false); diff --git a/src/main/java/com/iflytop/gd/app/command/control/HeatStartCommand.java b/src/main/java/com/iflytop/gd/app/command/control/HeatStartCommand.java index b87bf71..60fcf66 100644 --- a/src/main/java/com/iflytop/gd/app/command/control/HeatStartCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/control/HeatStartCommand.java @@ -1,6 +1,7 @@ package com.iflytop.gd.app.command.control; import com.iflytop.gd.app.core.BaseCommandHandler; +import com.iflytop.gd.app.model.bo.status.device.TrayState; import com.iflytop.gd.app.model.dto.CmdDTO; import com.iflytop.gd.app.service.api.DevicePositionService; import com.iflytop.gd.app.service.device.DeviceStateService; @@ -9,6 +10,8 @@ import com.iflytop.gd.common.annotation.CommandMapping; import com.iflytop.gd.common.enums.HeatModuleCode; import com.iflytop.gd.common.enums.HeatingType; import com.iflytop.gd.common.enums.data.DevicePositionCode; +import com.iflytop.gd.common.exception.AppException; +import com.iflytop.gd.common.result.ResultCode; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -36,7 +39,10 @@ public class HeatStartCommand extends BaseCommandHandler { Integer seconds = cmdDTO.getIntegerParam("seconds"); Double temperature = cmdDTO.getDoubleParam("temperature"); HeatModuleCode heatModuleCode = HeatModuleCode.valueOf(heatId); - + TrayState trayState = deviceStateService.getDeviceState().getTrayStateByHeatModuleCode(heatModuleCode); + if (trayState != null && trayState.getCrafts() != null) { + throw new AppException(ResultCode.CRAFT_RUNNING); + } return runAsync(() -> { heatModuleService.heatRodOpen(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode, temperature); deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTargetTime(time); diff --git a/src/main/java/com/iflytop/gd/app/command/control/HeatStopCommand.java b/src/main/java/com/iflytop/gd/app/command/control/HeatStopCommand.java index 2214e82..56cd8ab 100644 --- a/src/main/java/com/iflytop/gd/app/command/control/HeatStopCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/control/HeatStopCommand.java @@ -1,12 +1,15 @@ package com.iflytop.gd.app.command.control; import com.iflytop.gd.app.core.BaseCommandHandler; +import com.iflytop.gd.app.model.bo.status.device.TrayState; import com.iflytop.gd.app.model.dto.CmdDTO; import com.iflytop.gd.app.service.device.DeviceStateService; import com.iflytop.gd.app.service.device.module.HeatModuleService; import com.iflytop.gd.common.annotation.CommandMapping; import com.iflytop.gd.common.enums.HeatModuleCode; import com.iflytop.gd.common.enums.HeatingType; +import com.iflytop.gd.common.exception.AppException; +import com.iflytop.gd.common.result.ResultCode; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -29,6 +32,10 @@ public class HeatStopCommand extends BaseCommandHandler { public CompletableFuture handle(CmdDTO cmdDTO) { String heatId = cmdDTO.getStringParam("heatId"); HeatModuleCode heatModuleCode = HeatModuleCode.valueOf(heatId); + TrayState trayState = deviceStateService.getDeviceState().getTrayStateByHeatModuleCode(heatModuleCode); + if (trayState != null && trayState.getCrafts() != null) { + throw new AppException(ResultCode.CRAFT_RUNNING); + } return runAsync(() -> { //关闭加热 heatModuleService.heatRodClose(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode); diff --git a/src/main/java/com/iflytop/gd/app/command/control/MoveToHeatAreaCommand.java b/src/main/java/com/iflytop/gd/app/command/control/MoveToHeatAreaCommand.java index c8204e2..d845fc2 100644 --- a/src/main/java/com/iflytop/gd/app/command/control/MoveToHeatAreaCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/control/MoveToHeatAreaCommand.java @@ -52,6 +52,7 @@ public class MoveToHeatAreaCommand extends BaseCommandHandler { } String heatId = cmdDTO.getStringParam("heatId"); HeatModuleCode heatModuleCode = HeatModuleCode.valueOf(heatId); + TrayState trayState = deviceStateService.getDeviceState().getTrayInSolutionModule(); //校验目标加热位是否有托盘 try { @@ -68,6 +69,9 @@ public class MoveToHeatAreaCommand extends BaseCommandHandler { if(solutionModuleState.getTrayStatus() == 0){ throw new AppException(ResultCode.SOLUTION_MODULE_NO_TRAY); } + if (trayState != null && trayState.getCrafts() != null) { + throw new AppException(ResultCode.CRAFT_RUNNING); + } } catch (Exception e) { deviceStateService.getCommandMutexState().get().setMoveToHeatAreaCommandExecuting(false); throw e; @@ -92,7 +96,6 @@ public class MoveToHeatAreaCommand extends BaseCommandHandler { return runAsync(() -> { try { - TrayState trayState = deviceStateService.getDeviceState().getTrayInSolutionModule(); trayState.setHeatModuleId(heatModuleCode); capModuleService.capUpBalanceNoWait(cmdDTO.getCommandId(), cmdDTO.getCommand());//提升拍子存放区至拍子夹取的高度 gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidAreaTrayPoint3D); //将机械臂移动至加液模块上方 diff --git a/src/main/java/com/iflytop/gd/app/command/control/MoveToSolutionAreaCommand.java b/src/main/java/com/iflytop/gd/app/command/control/MoveToSolutionAreaCommand.java index b3f66eb..4d6cfbf 100644 --- a/src/main/java/com/iflytop/gd/app/command/control/MoveToSolutionAreaCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/control/MoveToSolutionAreaCommand.java @@ -55,6 +55,7 @@ public class MoveToSolutionAreaCommand extends BaseCommandHandler { } String heatId = cmdDTO.getStringParam("heatId"); HeatModuleCode heatModuleCode = HeatModuleCode.valueOf(heatId); + TrayState trayState = deviceStateService.getDeviceState().getTrayStateByHeatModuleCode(heatModuleCode); //校验目标加热位是否有托盘 try { @@ -71,6 +72,9 @@ public class MoveToSolutionAreaCommand extends BaseCommandHandler { if(solutionModuleState.getTrayStatus() == 1){ throw new AppException(ResultCode.SOLUTION_MODULE_OCCUPIED); } + if (trayState != null && trayState.getCrafts() != null) { + throw new AppException(ResultCode.CRAFT_RUNNING); + } } catch (Exception e) { deviceStateService.getCommandMutexState().get().setMoveToSolutionAreaCommandExecuting(false); throw e; @@ -95,7 +99,6 @@ public class MoveToSolutionAreaCommand extends BaseCommandHandler { return runAsync(() -> { try { - TrayState trayState = deviceStateService.getDeviceState().getTrayStateByHeatModuleCode(heatModuleCode); solutionModuleService.requestSolutionModule();//申请使用加液区并等待 capModuleService.capUpBalanceNoWait(cmdDTO.getCommandId(), cmdDTO.getCommand()); //提升拍子存放区至拍子夹取的高度 gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatAreaCapClawPointPoint3D);//将机械臂移动至加热模块拍子上方 diff --git a/src/main/java/com/iflytop/gd/app/command/control/ShakeStartCommand.java b/src/main/java/com/iflytop/gd/app/command/control/ShakeStartCommand.java index d091de8..d3bef4b 100644 --- a/src/main/java/com/iflytop/gd/app/command/control/ShakeStartCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/control/ShakeStartCommand.java @@ -1,6 +1,7 @@ package com.iflytop.gd.app.command.control; import com.iflytop.gd.app.core.BaseCommandHandler; +import com.iflytop.gd.app.model.bo.status.device.TrayState; import com.iflytop.gd.app.model.dto.CmdDTO; import com.iflytop.gd.app.service.device.DeviceStateService; import com.iflytop.gd.app.service.device.module.SolutionModuleService; @@ -32,9 +33,13 @@ public class ShakeStartCommand extends BaseCommandHandler { || deviceStateService.getCommandMutexState().get().isShakeStartCommandExecuting()) { throw new AppException(ResultCode.CMD_BUSY); } - if(deviceStateService.getDeviceState().getSolutionModule().getTrayStatus() != 1){ + if (deviceStateService.getDeviceState().getSolutionModule().getTrayStatus() != 1) { throw new AppException(ResultCode.SOLUTION_MODULE_NO_TRAY); } + TrayState trayState = deviceStateService.getDeviceState().getTrayInSolutionModule(); + if (trayState != null && trayState.getCrafts() != null) { + throw new AppException(ResultCode.CRAFT_RUNNING); + } return runAsync(() -> { deviceStateService.getCommandMutexState().get().setShakeStartCommandExecuting(true); solutionModuleService.shakeStart(cmdDTO.getCommandId(), cmdDTO.getCommand());//开始摇匀 diff --git a/src/main/java/com/iflytop/gd/app/command/control/ShakeStopCommand.java b/src/main/java/com/iflytop/gd/app/command/control/ShakeStopCommand.java index 0bbee68..6139b33 100644 --- a/src/main/java/com/iflytop/gd/app/command/control/ShakeStopCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/control/ShakeStopCommand.java @@ -1,10 +1,13 @@ package com.iflytop.gd.app.command.control; import com.iflytop.gd.app.core.BaseCommandHandler; +import com.iflytop.gd.app.model.bo.status.device.TrayState; import com.iflytop.gd.app.model.dto.CmdDTO; import com.iflytop.gd.app.service.device.DeviceStateService; import com.iflytop.gd.app.service.device.module.SolutionModuleService; import com.iflytop.gd.common.annotation.CommandMapping; +import com.iflytop.gd.common.exception.AppException; +import com.iflytop.gd.common.result.ResultCode; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -24,6 +27,10 @@ public class ShakeStopCommand extends BaseCommandHandler { @Override public CompletableFuture handle(CmdDTO cmdDTO) { + TrayState trayState = deviceStateService.getDeviceState().getTrayInSolutionModule(); + if (trayState != null && trayState.getCrafts() != null) { + throw new AppException(ResultCode.CRAFT_RUNNING); + } return runAsync(() -> { solutionModuleService.shakeStop(cmdDTO.getCommandId(), cmdDTO.getCommand());//停止摇匀 solutionModuleService.shakeOrigin(cmdDTO.getCommandId(), cmdDTO.getCommand());//摇匀回原点 diff --git a/src/main/java/com/iflytop/gd/app/command/control/SolutionAddCommand.java b/src/main/java/com/iflytop/gd/app/command/control/SolutionAddCommand.java index ebcf861..07973bd 100644 --- a/src/main/java/com/iflytop/gd/app/command/control/SolutionAddCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/control/SolutionAddCommand.java @@ -4,6 +4,7 @@ import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import com.iflytop.gd.app.core.BaseCommandHandler; +import com.iflytop.gd.app.model.bo.status.device.TrayState; import com.iflytop.gd.app.model.dto.CmdDTO; import com.iflytop.gd.app.model.entity.Container; import com.iflytop.gd.app.service.api.ContainerService; @@ -50,6 +51,10 @@ public class SolutionAddCommand extends BaseCommandHandler { if (deviceStateService.getDeviceState().getSolutionModule().getTrayStatus() != 1) { throw new AppException(ResultCode.SOLUTION_MODULE_NO_TRAY); } + TrayState trayState = deviceStateService.getDeviceState().getTrayInSolutionModule(); + if (trayState != null && trayState.getCrafts() != null) { + throw new AppException(ResultCode.CRAFT_RUNNING); + } deviceStateService.getCommandMutexState().get().setSolutionAddCommandExecuting(true); deviceStateService.getDeviceState().getSolutionModule().setPumping(true); return runAsync(() -> { diff --git a/src/main/java/com/iflytop/gd/app/command/control/TakePhotoCommand.java b/src/main/java/com/iflytop/gd/app/command/control/TakePhotoCommand.java index 49da86f..f0cb00d 100644 --- a/src/main/java/com/iflytop/gd/app/command/control/TakePhotoCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/control/TakePhotoCommand.java @@ -1,6 +1,7 @@ package com.iflytop.gd.app.command.control; import com.iflytop.gd.app.core.BaseCommandHandler; +import com.iflytop.gd.app.model.bo.status.device.TrayState; import com.iflytop.gd.app.model.dto.CmdDTO; import com.iflytop.gd.app.service.device.DeviceStateService; import com.iflytop.gd.app.service.device.module.SolutionModuleService; @@ -29,6 +30,10 @@ public class TakePhotoCommand extends BaseCommandHandler { if(deviceStateService.getDeviceState().getSolutionModule().getTrayStatus() != 1){ throw new AppException(ResultCode.SOLUTION_MODULE_NO_TRAY); } + TrayState trayState = deviceStateService.getDeviceState().getTrayInSolutionModule(); + if (trayState != null && trayState.getCrafts() != null) { + throw new AppException(ResultCode.CRAFT_RUNNING); + } return runAsync(() -> { solutionModuleService.fillLightOpen(cmdDTO.getCommandId(), cmdDTO.getCommand(), 100.0); solutionModuleService.takePhoto(cmdDTO.getCommandId(), cmdDTO.getCommand());//拍照 diff --git a/src/main/java/com/iflytop/gd/app/command/control/TrayDownCommand.java b/src/main/java/com/iflytop/gd/app/command/control/TrayDownCommand.java index 39f864c..41ab585 100644 --- a/src/main/java/com/iflytop/gd/app/command/control/TrayDownCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/control/TrayDownCommand.java @@ -1,6 +1,7 @@ package com.iflytop.gd.app.command.control; import com.iflytop.gd.app.core.BaseCommandHandler; +import com.iflytop.gd.app.model.bo.status.device.TrayState; import com.iflytop.gd.app.model.dto.CmdDTO; import com.iflytop.gd.app.service.api.DevicePositionService; import com.iflytop.gd.app.service.device.DeviceStateService; @@ -38,6 +39,11 @@ public class TrayDownCommand extends BaseCommandHandler { } String heatId = cmdDTO.getStringParam("heatId"); HeatModuleCode heatModuleCode = HeatModuleCode.valueOf(heatId); + + TrayState trayState = deviceStateService.getDeviceState().getTrayInSolutionModule(); + if (trayState != null && trayState.getCrafts() != null) { + throw new AppException(ResultCode.CRAFT_RUNNING); + } //从数据库获取加热位下降托盘位置 double trayLower = devicePositionService.getPosition(DevicePositionCode.trayLower).getDistance(); return runAsync(() -> { diff --git a/src/main/java/com/iflytop/gd/app/command/control/TrayUpCommand.java b/src/main/java/com/iflytop/gd/app/command/control/TrayUpCommand.java index 5c69bfb..10f95e8 100644 --- a/src/main/java/com/iflytop/gd/app/command/control/TrayUpCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/control/TrayUpCommand.java @@ -1,6 +1,7 @@ package com.iflytop.gd.app.command.control; import com.iflytop.gd.app.core.BaseCommandHandler; +import com.iflytop.gd.app.model.bo.status.device.TrayState; import com.iflytop.gd.app.model.dto.CmdDTO; import com.iflytop.gd.app.service.api.DevicePositionService; import com.iflytop.gd.app.service.device.DeviceStateService; @@ -36,6 +37,11 @@ public class TrayUpCommand extends BaseCommandHandler { } String heatId = cmdDTO.getStringParam("heatId"); HeatModuleCode heatModuleCode = HeatModuleCode.valueOf(heatId); + + TrayState trayState = deviceStateService.getDeviceState().getTrayInSolutionModule(); + if (trayState != null && trayState.getCrafts() != null) { + throw new AppException(ResultCode.CRAFT_RUNNING); + } //获取加热位抬升托盘位置 double trayLift = devicePositionService.getPosition(DevicePositionCode.trayLift).getDistance(); return runAsync(() -> { diff --git a/src/main/java/com/iflytop/gd/app/command/control/WarmUpStartCommand.java b/src/main/java/com/iflytop/gd/app/command/control/WarmUpStartCommand.java index d65d381..802eec0 100644 --- a/src/main/java/com/iflytop/gd/app/command/control/WarmUpStartCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/control/WarmUpStartCommand.java @@ -1,12 +1,15 @@ package com.iflytop.gd.app.command.control; import com.iflytop.gd.app.core.BaseCommandHandler; +import com.iflytop.gd.app.model.bo.status.device.TrayState; import com.iflytop.gd.app.model.dto.CmdDTO; import com.iflytop.gd.app.service.device.DeviceStateService; import com.iflytop.gd.app.service.device.module.HeatModuleService; import com.iflytop.gd.common.annotation.CommandMapping; import com.iflytop.gd.common.enums.HeatModuleCode; import com.iflytop.gd.common.enums.HeatingType; +import com.iflytop.gd.common.exception.AppException; +import com.iflytop.gd.common.result.ResultCode; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -29,6 +32,10 @@ public class WarmUpStartCommand extends BaseCommandHandler { String heatId = cmdDTO.getStringParam("heatId"); HeatModuleCode heatModuleCode = HeatModuleCode.valueOf(heatId); Double temperature = cmdDTO.getDoubleParam("temperature"); + TrayState trayState = deviceStateService.getDeviceState().getTrayStateByHeatModuleCode(heatModuleCode); + if (trayState != null && trayState.getCrafts() != null) { + throw new AppException(ResultCode.CRAFT_RUNNING); + } return runAsync(() -> { heatModuleService.heatRodOpen(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode, temperature); deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setWarmUpTemperature(temperature); diff --git a/src/main/java/com/iflytop/gd/app/service/crafts/CraftsStepService.java b/src/main/java/com/iflytop/gd/app/service/crafts/CraftsStepService.java index 66fa550..986bd3b 100644 --- a/src/main/java/com/iflytop/gd/app/service/crafts/CraftsStepService.java +++ b/src/main/java/com/iflytop/gd/app/service/crafts/CraftsStepService.java @@ -98,7 +98,10 @@ public class CraftsStepService { * 工艺执行完毕 */ public void finish(CraftsContext craftsContext) throws Exception { + HeatModuleCode heatModuleCode = craftsContext.getHeatModuleCode(); moveToSolutionModule(craftsContext.getHeatModuleCode()); + heatModuleService.heatRodClose(heatModuleCode);//停止加热 + deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.finish); //蜂鸣器提示 // otherModuleService.craftsFinishBeepRemind(); } @@ -200,8 +203,6 @@ public class CraftsStepService { deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTrayUp(0);//加热模块托盘升降状态 delay(second); log.info("工艺{},加热完成", heatModuleCode); - heatModuleService.heatRodClose(heatModuleCode);//停止加热 - deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.finish); log.info("工艺{},抬升加热位托盘", heatModuleCode); heatModuleService.heaterMotorMove(heatModuleCode, trayLift);//抬升加热位托盘 return true;