|
|
@ -2,11 +2,14 @@ package com.qyft.ms.app.front.cmd; |
|
|
|
|
|
|
|
import cn.hutool.json.JSONObject; |
|
|
|
import com.qyft.ms.system.common.annotation.CommandMapping; |
|
|
|
import com.qyft.ms.system.common.constant.CommandStatus; |
|
|
|
import com.qyft.ms.system.common.device.command.CommandFuture; |
|
|
|
import com.qyft.ms.system.common.device.command.DeviceCommandGenerator; |
|
|
|
import com.qyft.ms.system.common.device.command.FrontResponseGenerator; |
|
|
|
import com.qyft.ms.system.core.handler.BaseCommandHandler; |
|
|
|
import com.qyft.ms.system.model.bo.DeviceCommand; |
|
|
|
import com.qyft.ms.system.model.form.FrontCmdControlForm; |
|
|
|
import com.qyft.ms.system.service.WebSocketService; |
|
|
|
import com.qyft.ms.system.service.device.DeviceCommandService; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@ -22,6 +25,7 @@ import java.util.concurrent.CompletableFuture; |
|
|
|
public class DemoCommand extends BaseCommandHandler { |
|
|
|
|
|
|
|
private final DeviceCommandService deviceCommandService; |
|
|
|
private final WebSocketService webSocketService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public CompletableFuture<Void> handle(FrontCmdControlForm form) { |
|
|
@ -42,6 +46,8 @@ public class DemoCommand extends BaseCommandHandler { |
|
|
|
commandWait(motorXyzPositionGetCommandFuture); |
|
|
|
|
|
|
|
JSONObject responseResultJson = motorXyzPositionGetCommandFuture.getResponseResult(); |
|
|
|
|
|
|
|
webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.ERROR, "参数XXX必填")); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|