diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java index 3f382bf..b1d08fd 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java @@ -9,6 +9,7 @@ import com.mt.wms.core.dal.service.*; import com.mt.wms.core.utils.CodeGeneratorHelper; import com.mt.wms.core.utils.HttpClient; import com.mt.wms.core.vo.R; +import com.mt.wms.empty.websocket.WebSocketServer; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -61,6 +62,13 @@ public class ScheduledTask extends BaseService { private PointInfoServiceBiz pointInfoServiceBiz; @Resource private RunTaskUtils runTaskUtils; + @Resource + private WebSocketServer webSocketServer; + + @Scheduled(fixedDelay = 5000) + public void testWebsocket() throws IOException { + webSocketServer.sendtoAll(LocalDateTime.now()+"测试"); + } /** * 查询加工完成的窑炉