Compare commits
No commits in common. "1525954f1a3107145c78b95f9b29fbaa3a826370" and "6a50a67babea423adad1bf94b9f2ab133570ba6e" have entirely different histories.
1525954f1a
...
6a50a67bab
|
|
@ -18,14 +18,4 @@ public class ResponseCmdInfo<T> implements java.io.Serializable {
|
||||||
private String room;
|
private String room;
|
||||||
private Integer scenarioId;
|
private Integer scenarioId;
|
||||||
private T data;
|
private T data;
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "ResponseCmdInfo{" +
|
|
||||||
"cmdType='" + cmdType + '\'' +
|
|
||||||
", room='" + room + '\'' +
|
|
||||||
", scenarioId=" + scenarioId +
|
|
||||||
", data=" + data +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ import com.hivekion.statistic.service.StatisticService;
|
||||||
import com.hivekion.thread.SpringGlobalTaskManager;
|
import com.hivekion.thread.SpringGlobalTaskManager;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
@ -55,7 +54,6 @@ public class ScenarioTaskServiceImpl extends
|
||||||
@Resource
|
@Resource
|
||||||
private TaskLogicService taskLogicService;
|
private TaskLogicService taskLogicService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(Integer id, String roomId) {
|
public void start(Integer id, String roomId) {
|
||||||
log.info("id::{},roomId::{}",id,roomId);
|
log.info("id::{},roomId::{}",id,roomId);
|
||||||
|
|
@ -69,15 +67,14 @@ public class ScenarioTaskServiceImpl extends
|
||||||
|
|
||||||
|
|
||||||
//查询天气数据
|
//查询天气数据
|
||||||
WeatherResource weatherList = weatherResourceService.getOne(new QueryWrapper<WeatherResource>()
|
List<SimtoolWeather> weatherList = weatherService.queryByScenarioUuid(
|
||||||
.eq("scenario_id",id));
|
currentScenario.getGuid());
|
||||||
// currentScenario.getGuid());
|
|
||||||
//放入天气数据
|
//放入天气数据
|
||||||
redisUtil.hset(roomId + "_" + id, "weather", weatherList.getWeatherType());
|
redisUtil.hset(roomId + "_" + id, "weather", weatherList);
|
||||||
//查询任务
|
//查询任务
|
||||||
ScenarioTask queryTask = new ScenarioTask();
|
ScenarioTask queryTask = new ScenarioTask();
|
||||||
queryTask.setScenarioId(id);
|
queryTask.setScenarioId(id);
|
||||||
redisUtil.hset(roomId + "_" + id, "taskList", queryTaskList(queryTask).get(0).getTaskType());
|
redisUtil.hset(roomId + "_" + id, "taskList", queryTaskList(queryTask));
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
|
|
||||||
springGlobalTaskManager.startPerSecondTask(roomId + "_" + id + "_task", () -> {
|
springGlobalTaskManager.startPerSecondTask(roomId + "_" + id + "_task", () -> {
|
||||||
|
|
@ -138,8 +135,8 @@ public class ScenarioTaskServiceImpl extends
|
||||||
private void weatherTrigger(Scenario currentScenario, String roomId) {
|
private void weatherTrigger(Scenario currentScenario, String roomId) {
|
||||||
try {
|
try {
|
||||||
QueryWrapper<WeatherResource> weatherResourceQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<WeatherResource> weatherResourceQueryWrapper = new QueryWrapper<>();
|
||||||
weatherResourceQueryWrapper.eq("scenario_id", currentScenario.getId());
|
weatherResourceQueryWrapper.eq("scenario_id", currentScenario.getId()).eq("room_id", roomId);
|
||||||
List<WeatherResource> weatherResourceList = this.weatherResourceService.list(weatherResourceQueryWrapper);
|
List<WeatherResource> weatherResourceList = this.weatherResourceService.list();
|
||||||
ResponseCmdInfo<JSONArray> responseCmdInfo = new ResponseCmdInfo();
|
ResponseCmdInfo<JSONArray> responseCmdInfo = new ResponseCmdInfo();
|
||||||
responseCmdInfo.setScenarioId(currentScenario.getId());
|
responseCmdInfo.setScenarioId(currentScenario.getId());
|
||||||
responseCmdInfo.setRoom(roomId);
|
responseCmdInfo.setRoom(roomId);
|
||||||
|
|
@ -153,7 +150,6 @@ public class ScenarioTaskServiceImpl extends
|
||||||
responseCmdInfo.setCmdType("66-" + weatherResource.getWeatherType());
|
responseCmdInfo.setCmdType("66-" + weatherResource.getWeatherType());
|
||||||
}
|
}
|
||||||
responseCmdInfo.setData(weatherMsgArray);
|
responseCmdInfo.setData(weatherMsgArray);
|
||||||
System.out.println(responseCmdInfo.toString());
|
|
||||||
Global.sendCmdInfoQueue.add(responseCmdInfo);
|
Global.sendCmdInfoQueue.add(responseCmdInfo);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user