| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.asrs.domain.NotifyDto; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.zy.asrs.service.DeviceConfigService; |
| | |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public synchronized void notifyShuttle() { |
| | | List<DeviceConfig> deviceList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> deviceList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Crn))); |
| | | for (DeviceConfig device : deviceList) { |
| | | notifyMsg(String.valueOf(SlaveType.Crn), device.getDeviceNo()); |
| | |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public synchronized void notifyForkLift() { |
| | | List<DeviceConfig> deviceList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> deviceList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Rgv))); |
| | | for (DeviceConfig device : deviceList) { |
| | | notifyMsg(String.valueOf(SlaveType.Rgv), device.getDeviceNo()); |
| | |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public synchronized void notifyStation() { |
| | | List<DeviceConfig> deviceList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> deviceList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | for (DeviceConfig device : deviceList) { |
| | | notifyMsg(String.valueOf(SlaveType.Devp), device.getDeviceNo()); |
| | |
| | | } |
| | | |
| | | private synchronized void notifyMsg(String notifyType, Integer device) { |
| | | Config notifyEnableConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyEnable")); |
| | | Config notifyEnableConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "notifyEnable")); |
| | | if (notifyEnableConfig == null) { |
| | | return; |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | Config notifyUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyUri")); |
| | | Config notifyUriConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "notifyUri")); |
| | | if (notifyUriConfig == null) { |
| | | return; |
| | | } |
| | | String notifyUri = notifyUriConfig.getValue(); |
| | | |
| | | Config notifyUriPathConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyUriPath")); |
| | | Config notifyUriPathConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "notifyUriPath")); |
| | | if (notifyUriPathConfig == null) { |
| | | return; |
| | | } |