#
Junjie
3 天以前 691f0d4c4836c75fefa1d3b7fba4a72153751dd4
src/main/java/com/zy/core/ServerBootstrap.java
@@ -9,13 +9,7 @@
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.SlaveType;
import com.zy.core.model.*;
import com.zy.core.properties.SlaveProperties;
import com.zy.core.thread.*;
import com.zy.core.thread.impl.LfdZyForkLiftMasterThread;
import com.zy.core.thread.impl.LfdZyForkLiftSlaveThread;
import com.zy.core.thread.impl.NyShuttleThread;
import com.zy.core.thread.impl.ZyForkLiftThread;
import com.zy.core.utils.DeviceMsgUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -74,6 +68,7 @@
    private void initThread(){
        List<DeviceConfig> allDevices = new ArrayList<>();
        List<DeviceConfig> fakeDevices = new ArrayList<>();
//        // 初始化货叉提升机
//        List<DeviceConfig> forkLiftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
@@ -111,7 +106,6 @@
        // 初始化四向穿梭车
        List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
                .eq("device_type", String.valueOf(SlaveType.Shuttle)));
        allDevices.addAll(shuttleList);
        for (DeviceConfig deviceConfig : shuttleList) {
            News.info("初始化四向穿梭车......................................................");
            ThreadHandler thread = null;
@@ -123,11 +117,18 @@
            new Thread(thread).start();
            SlaveConnection.put(SlaveType.Shuttle, deviceConfig.getDeviceNo(), thread);
            if (deviceConfig.getFake() == 1) {
                fakeDevices.add(deviceConfig);
            }else {
                allDevices.add(deviceConfig);
            }
        }
        //设备初始化完毕
        deviceMsgUtils.sendDeviceConfig(JSON.toJSONString(allDevices));
        deviceMsgUtils.sendFakeDeviceConfig(JSON.toJSONString(fakeDevices));
    }