From 02c06af4f498f12ec8f296dfb5ed605777f71633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Sat, 14 Jun 2025 13:53:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=97=A0=E7=94=A8=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gd/app/command/control/TakePhotoCommand.java | 44 ---------------------- 1 file changed, 44 deletions(-) delete mode 100644 src/main/java/com/iflytop/gd/app/command/control/TakePhotoCommand.java 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 deleted file mode 100644 index f0cb00d..0000000 --- a/src/main/java/com/iflytop/gd/app/command/control/TakePhotoCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -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; - -import java.util.concurrent.CompletableFuture; - -/** - * 拍照 - */ -@Slf4j -@Component -@RequiredArgsConstructor -@CommandMapping("take_photo")//业务指令注解 -public class TakePhotoCommand extends BaseCommandHandler { - private final SolutionModuleService solutionModuleService; - private final DeviceStateService deviceStateService; - - @Override - public CompletableFuture handle(CmdDTO cmdDTO) { - 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());//拍照 - solutionModuleService.fillLightClose(cmdDTO.getCommandId(), cmdDTO.getCommand());//关闭补光灯 - }); - } -} -