|
|
@ -24,7 +24,9 @@ import lombok.AllArgsConstructor; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.web.socket.TextMessage; |
|
|
|
import org.springframework.web.socket.TextMessage; |
|
|
|
import org.springframework.web.socket.WebSocketSession; |
|
|
|
import org.springframework.web.socket.WebSocketSession; |
|
|
@ -32,6 +34,7 @@ import org.springframework.web.socket.WebSocketSession; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import java.util.Optional; |
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
import java.util.concurrent.ThreadPoolExecutor; |
|
|
|
import java.util.concurrent.ThreadPoolExecutor; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
@ -108,7 +111,7 @@ public class InteractiveSchedule { |
|
|
|
wsService.sendMessage(session,message); |
|
|
|
wsService.sendMessage(session,message); |
|
|
|
} |
|
|
|
} |
|
|
|
// 问题回答完成,去除redis问题标记
|
|
|
|
// 问题回答完成,去除redis问题标记
|
|
|
|
if(answerVO.getStatus() == 0){ |
|
|
|
if(answerVO.getRunning() == 0){ |
|
|
|
sessionIds.remove(answerVO.getSessionId()); |
|
|
|
sessionIds.remove(answerVO.getSessionId()); |
|
|
|
} |
|
|
|
} |
|
|
|
redisTemplate.opsForValue().set(HZIMS_BIGMODEL_ASK_KEY, JSONObject.toJSONString(sessionIds)); |
|
|
|
redisTemplate.opsForValue().set(HZIMS_BIGMODEL_ASK_KEY, JSONObject.toJSONString(sessionIds)); |
|
|
@ -153,15 +156,42 @@ public class InteractiveSchedule { |
|
|
|
|
|
|
|
|
|
|
|
@XxlJob(SYNCHRONOUS_SCADA_INSTRUCT) |
|
|
|
@XxlJob(SYNCHRONOUS_SCADA_INSTRUCT) |
|
|
|
public ReturnT synchronousScadaInstruct(String params) { |
|
|
|
public ReturnT synchronousScadaInstruct(String params) { |
|
|
|
Result<List<ProjectVO>> projectListR = projectClient.getProjectByAppId(); |
|
|
|
// 查询项目数据
|
|
|
|
if(projectListR.isSuccess()) { |
|
|
|
Result<List<ProjectVO>> projects = projectClient.getProjectByAppId(); |
|
|
|
List<String> projectIds = projectListR.getData().stream().map(ProjectVO::getId).collect(Collectors.toList()); |
|
|
|
if(!projects.isSuccess() || CollectionUtil.isEmpty(projects.getData())){ |
|
|
|
Result<List<CanvasVO>> canvasListR = scadaClient.getCanvasList(projectIds); |
|
|
|
return ReturnT.SUCCESS; |
|
|
|
if(canvasListR.isSuccess() && CollectionUtil.isNotEmpty(canvasListR.getData())) { |
|
|
|
|
|
|
|
List<CanvasVO> canvasList = canvasListR.getData(); |
|
|
|
|
|
|
|
//TODO 同步站点画面指令
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 请求fdp同步实时画面方法参数定义
|
|
|
|
|
|
|
|
Map<String,Object> param = new HashMap<>(2); |
|
|
|
|
|
|
|
List<UpdateStationVO> stations = projects.getData().stream().map(station -> { |
|
|
|
|
|
|
|
UpdateStationVO updateStation = new UpdateStationVO(); |
|
|
|
|
|
|
|
updateStation.setId(station.getId()); |
|
|
|
|
|
|
|
updateStation.setName(station.getName()); |
|
|
|
|
|
|
|
return updateStation; |
|
|
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
param.put("stations", stations); |
|
|
|
|
|
|
|
// 查询画面信息
|
|
|
|
|
|
|
|
Result<List<CanvasVO>> canvas = scadaClient.getCanvasList(projects.getData().stream().map(ProjectVO::getId).collect(Collectors.toList())); |
|
|
|
|
|
|
|
if(!canvas.isSuccess() || CollectionUtil.isEmpty(canvas.getData())) { |
|
|
|
|
|
|
|
return ReturnT.SUCCESS; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
List<UpdateUsualVO> updateUsuals = canvas.getData().stream().map(canva -> { |
|
|
|
|
|
|
|
UpdateUsualVO usualVO = new UpdateUsualVO(); |
|
|
|
|
|
|
|
usualVO.setStationId(canva.getProjectId()); |
|
|
|
|
|
|
|
usualVO.setName(canva.getName()); |
|
|
|
|
|
|
|
// 画面id =
|
|
|
|
|
|
|
|
String id = Optional.of(canva.getPicSource()).map(String::valueOf).orElse("") + "^" + |
|
|
|
|
|
|
|
Optional.ofNullable(canva.getContext()).orElse("") + "^" + |
|
|
|
|
|
|
|
Optional.ofNullable(canva.getStationNum()).orElse("") + "^" + |
|
|
|
|
|
|
|
Optional.ofNullable(canva.getProjectId()).orElse("") + "^" + |
|
|
|
|
|
|
|
Optional.ofNullable(canva.getTaskId()).map(String::valueOf).orElse("") + "^" + |
|
|
|
|
|
|
|
Optional.ofNullable(canva.getName()).orElse("") + "^" + |
|
|
|
|
|
|
|
Optional.ofNullable(canva.getId()).map(String::valueOf).orElse("") + "^"; |
|
|
|
|
|
|
|
usualVO.setId(id); |
|
|
|
|
|
|
|
return usualVO; |
|
|
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
param.put("canvases", updateUsuals); |
|
|
|
|
|
|
|
Boolean status = interactiveService.updateCanvas(param); |
|
|
|
return ReturnT.SUCCESS; |
|
|
|
return ReturnT.SUCCESS; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|