|
@@ -2,6 +2,7 @@ package org.jeecg.modules.largeScreen.component;
|
|
|
|
|
|
import org.jeecg.modules.itdmOpenDaping.entity.ItdmDaping;
|
|
|
import org.jeecg.modules.largeScreen.config.CronTaskRegistrar;
|
|
|
+import org.jeecg.modules.largeScreen.task.DemoTask3;
|
|
|
import org.jeecg.modules.largeScreen.task.SchedulingRunnable;
|
|
|
import org.jeecg.modules.largeScreen.util.EncoderClassListVo;
|
|
|
import org.jeecg.modules.largeScreen.util.SpringUtils;
|
|
@@ -36,9 +37,9 @@ public class WebSocketServer3 {
|
|
|
private Session session;
|
|
|
|
|
|
//改的地方
|
|
|
-// public DemoTask3 getDemoTask3() {
|
|
|
-// return SpringUtils.getBean(DemoTask3.class);
|
|
|
-// }
|
|
|
+ public DemoTask3 getDemoTask3() {
|
|
|
+ return SpringUtils.getBean(DemoTask3.class);
|
|
|
+ }
|
|
|
|
|
|
public CronTaskRegistrar getCronTaskRegistrar() {
|
|
|
return SpringUtils.getBean(CronTaskRegistrar.class);
|
|
@@ -53,13 +54,13 @@ public class WebSocketServer3 {
|
|
|
public void onOpen(Session session) {
|
|
|
this.session = session;
|
|
|
webSocketSet.add(this);
|
|
|
-//
|
|
|
-// sendUser(this.getDemoTask3().dakaiwangye(), session);
|
|
|
-// SchedulingRunnable task = new SchedulingRunnable("demoTask3", "dakaidaping", session);
|
|
|
-//
|
|
|
+
|
|
|
+ sendUser(this.getDemoTask3().chushihua(), session);
|
|
|
+ SchedulingRunnable task = new SchedulingRunnable("demoTask3", "taskWithParamsList", session);
|
|
|
+
|
|
|
addOnlineCount();//在线数加1
|
|
|
-// this.getCronTaskRegistrar().addCronTask(task, "0/100 * * * * ?");//30秒传一次数据
|
|
|
-// webSocketSet1.put(session.getId(), task);
|
|
|
+ this.getCronTaskRegistrar().addCronTask(task, "0/30 * * * * ?");//30秒传一次数据
|
|
|
+ webSocketSet1.put(session.getId(), task);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -69,7 +70,7 @@ public class WebSocketServer3 {
|
|
|
public void onClose(Session session) {
|
|
|
webSocketSet.remove(this);
|
|
|
subOnlineCount();
|
|
|
-// this.getCronTaskRegistrar().removeCronTask(webSocketSet1.get(session.getId()));
|
|
|
+ this.getCronTaskRegistrar().removeCronTask(webSocketSet1.get(session.getId()));
|
|
|
}
|
|
|
|
|
|
/**
|