#
taisheng
2025-05-24 53ae8e478f6034579303c51bdf881ffa526c942c
src/main/java/com/zy/asrs/controller/CommandInfoController.java
@@ -15,6 +15,7 @@
import com.core.common.R;
import com.zy.common.web.BaseController;
import com.zy.core.cache.MessageQueue;
import com.zy.core.enums.CommandStatusType;
import com.zy.core.enums.SlaveType;
import com.zy.core.model.Task;
import com.zy.core.model.command.CommandPackage;
@@ -149,7 +150,7 @@
            return R.error("指令不存在");
        }
        commandInfo.setCommandStatus(2);//执行状态
        commandInfo.setCommandStatus(CommandStatusType.EXECUTE.id);//执行状态
        commandInfo.setExecuteTime(new Date());
        if (commandInfoService.updateById(commandInfo)) {
            //将指令进行投递
@@ -162,11 +163,11 @@
            switch (type) {
                case Crn:
                    CrnCommand crnCommand = JSON.parseObject(commandPackage.getCommand().toString(), CrnCommand.class);
                    MessageQueue.offer(type, crnCommand.getCrnNo(), new Task(2, crnCommand));
                    MessageQueue.offer(type, crnCommand.getCrnNo(), new Task(5, crnCommand));
                    break;
                case Devp:
                    StaProtocol staProtocol = JSON.parseObject(commandPackage.getCommand().toString(), StaProtocol.class);
                    MessageQueue.offer(type, staProtocol.getSiteId(), new Task(2, staProtocol));
                    MessageQueue.offer(type, staProtocol.getSiteId(), new Task(3, staProtocol));
                    break;
            }
        }
@@ -181,7 +182,7 @@
            return R.error("指令不存在");
        }
        commandInfo.setCommandStatus(3);//完成状态
        commandInfo.setCommandStatus(CommandStatusType.COMPLETE.id);//完成状态
        commandInfo.setCompleteTime(new Date());
        commandInfoService.updateById(commandInfo);
        return R.ok();