Junjie
昨天 1da4047a0a011bdbab1e6ae1135e4abb1bcebad2
src/main/java/com/zy/asrs/controller/StationController.java
@@ -7,6 +7,8 @@
import com.zy.asrs.service.BasDevpService;
import com.zy.asrs.service.DeviceConfigService;
import com.zy.common.utils.RedisUtil;
import com.zy.core.dispatch.StationCommandDispatchResult;
import com.zy.core.dispatch.StationCommandDispatcher;
import com.zy.core.enums.RedisKeyType;
import com.zy.core.enums.StationCommandType;
import com.zy.core.model.StationObjModel;
@@ -22,10 +24,8 @@
import com.core.common.Cools;
import com.core.common.R;
import com.zy.asrs.domain.param.StationCommandMoveParam;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.SlaveType;
import com.zy.core.model.Task;
import com.zy.core.model.command.StationCommand;
import com.zy.core.thread.StationThread;
@@ -45,6 +45,8 @@
    private ConfigService configService;
    @Autowired
    private DeviceConfigService deviceConfigService;
    @Autowired
    private StationCommandDispatcher stationCommandDispatcher;
    @PostMapping("/command/move")
    public R commandMove(@RequestBody StationCommandMoveParam param) {
@@ -73,7 +75,11 @@
        if (command == null) {
            return R.error("生成输送命令失败,路径为空或不可达");
        }
        MessageQueue.offer(SlaveType.Devp, devpNo, new Task(2, command));
        StationCommandDispatchResult dispatchResult = stationCommandDispatcher
                .dispatch(devpNo, command, "station-controller", "manual-move");
        if (!dispatchResult.isAccepted()) {
            return R.error("输送命令下发失败:" + dispatchResult.getReason());
        }
        return R.ok();
    }
@@ -118,7 +124,11 @@
        StationCommand command = stationThread.getCommand(StationCommandType.WRITE_INFO, 9997, stationId, stationId, 0);
        command.setBarcode(barcode.trim());
        MessageQueue.offer(SlaveType.Devp, devpNo, new Task(2, command));
        StationCommandDispatchResult dispatchResult = stationCommandDispatcher
                .dispatch(devpNo, command, "station-controller", "manual-barcode");
        if (!dispatchResult.isAccepted()) {
            return R.error("条码命令下发失败:" + dispatchResult.getReason());
        }
        return R.ok();
    }
@@ -172,5 +182,4 @@
        }
        return null;
    }
}