You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
package com.iflytop.gd.app.cmd;
import com.iflytop.gd.app.core.BaseCommandHandler; import com.iflytop.gd.app.model.dto.CmdDTO; import com.iflytop.gd.app.service.DeviceCommandUtilService; import com.iflytop.gd.app.service.DevicePositionService; import com.iflytop.gd.common.annotation.CommandMapping; import com.iflytop.gd.common.enums.HeatModuleCode; import com.iflytop.gd.common.enums.data.DevicePositionCode; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component;
import java.util.concurrent.CompletableFuture;
/** * 抬起托盘 */ @Slf4j @Component @RequiredArgsConstructor @CommandMapping("tray_up")//业务指令注解
public class TrayUpCommand extends BaseCommandHandler { private final DeviceCommandUtilService deviceCommandUtilService; private final DevicePositionService devicePositionService;
@Override public CompletableFuture<Void> handle(CmdDTO cmdDTO) { String heatId = cmdDTO.getStringParam("heatId"); HeatModuleCode heatModuleId = HeatModuleCode.valueOf(heatId); return runAsync(() -> { double trayLift = devicePositionService.getPosition(DevicePositionCode.trayLift).getDistance(); //获取加热位抬升托盘位置
deviceCommandUtilService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLift);//抬升加热位托盘
}); } }
|