#
Junjie
3 天以前 877b2519157cea762b1e63e9c57c09614216d684
src/main/java/com/zy/core/ServerBootstrap.java
@@ -11,7 +11,9 @@
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.SlaveType;
import com.zy.core.thread.TrafficControlThread;
import com.zy.core.thread.impl.NyShuttleThread;
import com.zy.core.thread.impl.TrafficControlImplThread;
import com.zy.core.thread.impl.ZyForkLiftThread;
import com.zy.core.utils.DeviceMsgUtils;
import lombok.extern.slf4j.Slf4j;
@@ -61,14 +63,16 @@
        List<DeviceConfig> forkLiftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
                .eq("device_type", String.valueOf(SlaveType.ForkLift)));
        for (DeviceConfig forkLift : forkLiftList) {
            MessageQueue.init(SlaveType.ForkLift, forkLift);
            MessageQueue.init(SlaveType.ForkLift, forkLift.getDeviceNo());
        }
        // 初始化四向穿梭车mq
        List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
                .eq("device_type", String.valueOf(SlaveType.Shuttle)));
        for (DeviceConfig shuttle : shuttleList) {
            MessageQueue.init(SlaveType.Shuttle, shuttle);
            MessageQueue.init(SlaveType.Shuttle, shuttle.getDeviceNo());
        }
        MessageQueue.init(SlaveType.TrafficControl, 1);
    }
    private void initThread(){
@@ -128,6 +132,10 @@
        //设备初始化完毕
        deviceMsgUtils.sendDeviceConfig(JSON.toJSONString(allDevices));
        deviceMsgUtils.sendFakeDeviceConfig(JSON.toJSONString(fakeDevices));
        TrafficControlThread trafficControlThread = new TrafficControlImplThread(redisUtil);
        new Thread(trafficControlThread).start();
        SlaveConnection.put(SlaveType.TrafficControl, 1, trafficControlThread);
    }