| | |
| | | package com.zy.core; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.zy.asrs.service.DeviceConfigService; |
| | |
| | | |
| | | private void initMq(){ |
| | | // 初始化堆垛机mq |
| | | List<DeviceConfig> crnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> crnList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Crn))); |
| | | for (DeviceConfig crn : crnList) { |
| | | MessageQueue.init(SlaveType.Crn, crn.getDeviceNo()); |
| | | } |
| | | // 初始化双工位堆垛机mq |
| | | List<DeviceConfig> dualCrnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> dualCrnList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.DualCrn))); |
| | | for (DeviceConfig crn : dualCrnList) { |
| | | MessageQueue.init(SlaveType.DualCrn, crn.getDeviceNo()); |
| | | } |
| | | // 初始化Rgv小车mq |
| | | List<DeviceConfig> rgvList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> rgvList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Rgv))); |
| | | for (DeviceConfig rgv : rgvList) { |
| | | MessageQueue.init(SlaveType.Rgv, rgv.getDeviceNo()); |
| | | } |
| | | // 初始化输送线mq |
| | | List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> devpList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | for (DeviceConfig devp : devpList) { |
| | | MessageQueue.init(SlaveType.Devp, devp.getDeviceNo()); |
| | | } |
| | | // 初始化条码扫描仪mq |
| | | List<DeviceConfig> barcodeList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> barcodeList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Barcode))); |
| | | for (DeviceConfig barcode : barcodeList) { |
| | | MessageQueue.init(SlaveType.Barcode, barcode.getDeviceNo()); |
| | | } |
| | | // 初始化Led灯mq |
| | | List<DeviceConfig> ledList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> ledList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Led))); |
| | | for (DeviceConfig led : ledList) { |
| | | MessageQueue.init(SlaveType.Led, led.getDeviceNo()); |
| | |
| | | } |
| | | |
| | | private void initThread(){ |
| | | List<DeviceConfig> crnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> crnList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Crn))); |
| | | if(!crnList.isEmpty()) { |
| | | News.info("初始化堆垛机........................................................"); |
| | |
| | | } |
| | | } |
| | | |
| | | List<DeviceConfig> dualCrnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> dualCrnList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.DualCrn))); |
| | | if(!dualCrnList.isEmpty()) { |
| | | News.info("初始化双工位堆垛机........................................................"); |
| | |
| | | } |
| | | } |
| | | |
| | | List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> devpList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | if(!devpList.isEmpty()) { |
| | | News.info("初始化输送站........................................................"); |
| | |
| | | } |
| | | } |
| | | |
| | | List<DeviceConfig> rgvList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> rgvList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Rgv))); |
| | | if(!rgvList.isEmpty()) { |
| | | News.info("初始化RGV........................................................"); |