Compare commits

..

No commits in common. "1525954f1a3107145c78b95f9b29fbaa3a826370" and "6a50a67babea423adad1bf94b9f2ab133570ba6e" have entirely different histories.

2 changed files with 6 additions and 20 deletions

View File

@ -18,14 +18,4 @@ public class ResponseCmdInfo<T> implements java.io.Serializable {
private String room;
private Integer scenarioId;
private T data;
@Override
public String toString() {
return "ResponseCmdInfo{" +
"cmdType='" + cmdType + '\'' +
", room='" + room + '\'' +
", scenarioId=" + scenarioId +
", data=" + data +
'}';
}
}

View File

@ -21,7 +21,6 @@ import com.hivekion.statistic.service.StatisticService;
import com.hivekion.thread.SpringGlobalTaskManager;
import java.time.format.DateTimeFormatter;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -55,7 +54,6 @@ public class ScenarioTaskServiceImpl extends
@Resource
private TaskLogicService taskLogicService;
@Override
public void start(Integer id, String roomId) {
log.info("id::{},roomId::{}",id,roomId);
@ -69,15 +67,14 @@ public class ScenarioTaskServiceImpl extends
//查询天气数据
WeatherResource weatherList = weatherResourceService.getOne(new QueryWrapper<WeatherResource>()
.eq("scenario_id",id));
// currentScenario.getGuid());
List<SimtoolWeather> weatherList = weatherService.queryByScenarioUuid(
currentScenario.getGuid());
//放入天气数据
redisUtil.hset(roomId + "_" + id, "weather", weatherList.getWeatherType());
redisUtil.hset(roomId + "_" + id, "weather", weatherList);
//查询任务
ScenarioTask queryTask = new ScenarioTask();
queryTask.setScenarioId(id);
redisUtil.hset(roomId + "_" + id, "taskList", queryTaskList(queryTask).get(0).getTaskType());
redisUtil.hset(roomId + "_" + id, "taskList", queryTaskList(queryTask));
new Thread(() -> {
springGlobalTaskManager.startPerSecondTask(roomId + "_" + id + "_task", () -> {
@ -138,8 +135,8 @@ public class ScenarioTaskServiceImpl extends
private void weatherTrigger(Scenario currentScenario, String roomId) {
try {
QueryWrapper<WeatherResource> weatherResourceQueryWrapper = new QueryWrapper<>();
weatherResourceQueryWrapper.eq("scenario_id", currentScenario.getId());
List<WeatherResource> weatherResourceList = this.weatherResourceService.list(weatherResourceQueryWrapper);
weatherResourceQueryWrapper.eq("scenario_id", currentScenario.getId()).eq("room_id", roomId);
List<WeatherResource> weatherResourceList = this.weatherResourceService.list();
ResponseCmdInfo<JSONArray> responseCmdInfo = new ResponseCmdInfo();
responseCmdInfo.setScenarioId(currentScenario.getId());
responseCmdInfo.setRoom(roomId);
@ -153,7 +150,6 @@ public class ScenarioTaskServiceImpl extends
responseCmdInfo.setCmdType("66-" + weatherResource.getWeatherType());
}
responseCmdInfo.setData(weatherMsgArray);
System.out.println(responseCmdInfo.toString());
Global.sendCmdInfoQueue.add(responseCmdInfo);
} catch (Exception ex) {