调整
This commit is contained in:
parent
9bae6bd66b
commit
82893895b5
@ -160,7 +160,7 @@ public class WebSocketVueServiceImpl extends WebSocketService {
|
||||
data.setData(dataParam);
|
||||
data.setType(0);
|
||||
}
|
||||
// 打印
|
||||
// 打印 status = 0
|
||||
// {"Topic":"sdcp/request/12345678","command":"PRINT"}
|
||||
else if (command.equals(CapabilitieEnum.PRINT.name())) {
|
||||
BusDevice device = myDeviceService.getByDeviceCode(deviceSn);
|
||||
@ -177,7 +177,7 @@ public class WebSocketVueServiceImpl extends WebSocketService {
|
||||
data.setData(dataParam);
|
||||
data.setFrom(0);
|
||||
}
|
||||
// 暂停
|
||||
// 暂停 status = (1 || 2)
|
||||
// {"Topic":"sdcp/request/12345678","command":"PAUSE"}
|
||||
else if (command.equals(CapabilitieEnum.PAUSE.name())) {
|
||||
BusDevice device = myDeviceService.getByDeviceCode(deviceSn);
|
||||
@ -193,11 +193,11 @@ public class WebSocketVueServiceImpl extends WebSocketService {
|
||||
data.setData(dataParam);
|
||||
data.setFrom(0);
|
||||
}
|
||||
// 退出
|
||||
// 退出 status = !(-1 || 0)
|
||||
// {"Topic":"sdcp/request/12345678","command":"EXIT"}
|
||||
else if (command.equals(CapabilitieEnum.EXIT.name())) {
|
||||
BusDevice device = myDeviceService.getByDeviceCode(deviceSn);
|
||||
if (device.getStatus().equals(CurrentStatusEnum.SDCP_MACHINE_STATUS_IDLE.getCode())) {
|
||||
if (device.getStatus().equals(CurrentStatusEnum.SDCP_MACHINE_STATUS_DEFAULT.getCode()) || device.getStatus().equals(CurrentStatusEnum.SDCP_MACHINE_STATUS_IDLE.getCode())) {
|
||||
Map<String, Object> commandResult = new HashMap<>();
|
||||
commandResult.put("deviceSn", deviceSn);
|
||||
sendVueMessage(session, JSON.toJSONString(new SocketMsg(commandResult, "当前状态无法操作退出", MsgEnum.ERROR)));
|
||||
@ -209,11 +209,11 @@ public class WebSocketVueServiceImpl extends WebSocketService {
|
||||
data.setData(dataParam);
|
||||
data.setFrom(0);
|
||||
}
|
||||
// 继续
|
||||
// 继续 status = 1 && PrintStatus = 6
|
||||
// {"Topic":"sdcp/request/12345678","command":"CONTINUE"}
|
||||
else if (command.equals(CapabilitieEnum.CONTINUE.name())) {
|
||||
BusDevice device = myDeviceService.getByDeviceCode(deviceSn);
|
||||
if (!(device.getStatus().equals(CurrentStatusEnum.SDCP_MACHINE_STATUS_PRINTING.getCode()) || device.getPrintStatus().equals(PrintInfoStatusEnum.SDCP_PRINT_STATUS_PAUSED.getCode()))) {
|
||||
if (!(device.getStatus().equals(CurrentStatusEnum.SDCP_MACHINE_STATUS_PRINTING.getCode()) && device.getPrintStatus().equals(PrintInfoStatusEnum.SDCP_PRINT_STATUS_PAUSED.getCode()))) {
|
||||
Map<String, Object> commandResult = new HashMap<>();
|
||||
commandResult.put("deviceSn", deviceSn);
|
||||
sendVueMessage(session, JSON.toJSONString(new SocketMsg(commandResult, "当前状态无法操作继续", MsgEnum.ERROR)));
|
||||
|
Loading…
Reference in New Issue
Block a user