From c9026a3f800d94039c1dae0b873a351df43f684a Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Sat, 11 May 2024 11:24:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=BF=94=E5=9B=9E=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E5=AF=B9=E8=B1=A1extras=E6=B7=BB=E5=8A=A0fun?= =?UTF-8?q?cCode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bigmodel/configuration/BigModelInvokeUrl.java | 2 ++ .../interactive/service/IInteractiveService.java | 2 ++ .../service/impl/ExtraResolveStrategyService.java | 1 + .../service/impl/InteractiveServiceImpl.java | 9 +++++++++ .../service/impl/JumpRouteJoinStrategy.java | 1 + .../interactive/service/impl/ParamStrategy.java | 1 + .../bigmodel/schedule/InteractiveSchedule.java | 21 +++++++++++++++++++++ .../bigmodel/schedule/XxlJobHandlerConstant.java | 2 ++ 8 files changed, 39 insertions(+) diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/configuration/BigModelInvokeUrl.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/configuration/BigModelInvokeUrl.java index 0456fa2..7f8d6d5 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/configuration/BigModelInvokeUrl.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/configuration/BigModelInvokeUrl.java @@ -23,6 +23,8 @@ public class BigModelInvokeUrl { private String updateVideo; + private String updateFault; + private String updateCanvas; } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java index f740a40..b85ad2f 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java @@ -26,6 +26,8 @@ public interface IInteractiveService { Boolean updateCanvas(Map request); + void updateFault(Map request); + List getAnswerBySessionIds(String sessionIds); Boolean authentication(String stationId, String userId, String funcCode); diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java index 45a7d25..8419dee 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java @@ -64,6 +64,7 @@ public class ExtraResolveStrategyService { params.put("fdpDeviceName",data.getString("device_name")); params.put("fdpOrd",data.getString("ord")); result.setParams(params); + result.setFuncCode(FuncRouteEnum.DIAGNOSE.getFuncCode()); result.setType(FunctionConstants.TypeEnum.PARAMS.getType()); return result; } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java index 0ac3ff3..d70bcd4 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java @@ -162,6 +162,15 @@ public class InteractiveServiceImpl implements IInteractiveService { } @Override + public void updateFault(Map request) { + HttpResponse response = HttpRequest.post(fdpHost + bigModelInvokeUrl.getUpdateFault()) + .body(JSON.toJSONString(request)).execute(); + Assert.isTrue(response.getStatus() == HttpServletResponse.SC_OK, () -> { + throw new ServiceException("远程调用大模型【更新故障列表】接口失败!"); + }); + } + + @Override public List getAnswerBySessionIds(String sessionIds) { Map params = new HashMap<>(); params.put("ids",Func.toStrList(",",sessionIds).toArray()); diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java index 907266e..e3b7f55 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java @@ -47,6 +47,7 @@ public class JumpRouteJoinStrategy { // 跳转页面逻辑 ExtraVO extraVO = new ExtraVO(); extraVO.setImmediatelyJump(true); + extraVO.setFuncCode(FuncRouteEnum.OPEN_SCADA.getFuncCode()); Map params = this.scadaResolve(args); // 根据hz3000画面版本获取path Integer picResource = Integer.valueOf(params.get("picResource")); diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ParamStrategy.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ParamStrategy.java index ef081db..6e9cd62 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ParamStrategy.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ParamStrategy.java @@ -55,6 +55,7 @@ public class ParamStrategy { if(videoR.isSuccess()) { StationVideoTypeEntity video = videoR.getData(); extraVO.setType(FunctionConstants.TypeEnum.PARAMS.getType()); + extraVO.setFuncCode(FuncRouteEnum.OPEN_VIDEO.getFuncCode()); Map params = new HashMap<>(); params.put("name", video.getName()); params.put("videoHost", video.getVideoHost()); diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java index 7af5118..629d287 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java @@ -192,4 +192,25 @@ public class InteractiveSchedule { Boolean status = interactiveService.updateCanvas(param); return ReturnT.SUCCESS; } + + //@XxlJob(SYNCHRONOUS_FAULT_INSTRUCT) String params + @Scheduled(cron = "0/10 * * * * ?") + public ReturnT synchronousFaultInstruct() { + Map request = new HashMap<>(2); + // 获取站点列表 + R> stationsR = stationClient.list(new StationEntity()); + if(!stationsR.isSuccess() || CollectionUtil.isEmpty(stationsR.getData())) { + XxlJobLogger.log("获取站点列表失败!"); + return ReturnT.FAIL; + } + List updateStationList = stationsR.getData().stream().map(station -> { + UpdateStationVO stationVO = new UpdateStationVO(); + stationVO.setId(station.getCode()); + stationVO.setName(station.getName()); + return stationVO; + }).collect(Collectors.toList()); + request.put("stations", updateStationList); + interactiveService.updateFault(request); + return ReturnT.SUCCESS; + } } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/XxlJobHandlerConstant.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/XxlJobHandlerConstant.java index 9d3cefd..7317f54 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/XxlJobHandlerConstant.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/XxlJobHandlerConstant.java @@ -9,6 +9,8 @@ public interface XxlJobHandlerConstant { /**获取问答结果**/ String GET_INTERACTIVE_RESULT = "getInteractiveResult"; + String SYNCHRONOUS_FAULT_INSTRUCT = "synchronousFaultInstruct"; + /**同步视频指令**/ String SYNCHRONOUS_VIDEO_INSTRUCT = "synchronousVideoInstruct";