#
Junjie
4 天以前 ce9c9af4a3710d17e17814bab629ab4ef474f3f1
src/main/java/com/zy/asrs/task/NotifyScheduler.java
@@ -4,7 +4,9 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zy.asrs.domain.NotifyDto;
import com.zy.asrs.entity.DeviceConfig;
import com.zy.asrs.entity.HttpRequestLog;
import com.zy.asrs.service.DeviceConfigService;
import com.zy.asrs.service.HttpRequestLogService;
import com.zy.asrs.utils.NotifyUtils;
import com.zy.common.utils.HttpHandler;
@@ -32,23 +34,27 @@
    @Autowired
    private NotifyUtils notifyUtils;
    @Autowired
    private SlaveProperties slaveProperties;
    @Autowired
    private ConfigService configService;
    @Autowired
    private HttpRequestLogService httpRequestLogService;
    @Autowired
    private DeviceConfigService deviceConfigService;
    @Scheduled(cron = "0/3 * * * * ? ")
    public synchronized void notifyShuttle(){
        for (ShuttleSlave slave : slaveProperties.getShuttle()) {
            notifyMsg(String.valueOf(SlaveType.Shuttle), slave.getId());
        List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
                .eq("device_type", String.valueOf(SlaveType.Shuttle)));
        for (DeviceConfig device : shuttleList) {
            notifyMsg(String.valueOf(SlaveType.Shuttle), device.getDeviceNo());
        }
    }
    @Scheduled(cron = "0/3 * * * * ? ")
    public synchronized void notifyForkLift(){
        for (ForkLiftSlave slave : slaveProperties.getForkLift()) {
            notifyMsg(String.valueOf(SlaveType.ForkLift), slave.getId());
        List<DeviceConfig> forkLiftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
                .eq("device_type", String.valueOf(SlaveType.ForkLift)));
        for (DeviceConfig device : forkLiftList) {
            notifyMsg(String.valueOf(SlaveType.ForkLift), device.getDeviceNo());
        }
    }