From 15b6b41bb6fb5dff5ad10a6faf875363917fa9d6 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Fri, 10 May 2024 11:50:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=AE=8C=E5=96=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E9=97=AE=E9=A2=98=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/hnac/hzims/bigmodel/interactive/vo/ExtraVO.java | 3 +++ .../interactive/service/impl/ExtraResolveStrategyService.java | 1 + .../bigmodel/interactive/service/impl/InteractiveServiceImpl.java | 4 ++-- .../main/java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java | 2 +- .../com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/ExtraVO.java b/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/ExtraVO.java index ab8578b..cda702f 100644 --- a/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/ExtraVO.java +++ b/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/ExtraVO.java @@ -27,6 +27,9 @@ public class ExtraVO implements Serializable { @ApiModelProperty("链接显示文字") private String label; + @ApiModelProperty("函数编号") + private String funcCode; + @ApiModelProperty("是否立即跳转") private boolean isImmediatelyJump = false; 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 c16cdb6..6c19dc0 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 @@ -84,6 +84,7 @@ public class ExtraResolveStrategyService { return selectionVO; }).collect(Collectors.toList()); result.setSelection(selectionList); + result.setFuncCode(FuncRouteEnum.CHOOSE_STATION.getFuncCode()); result.setSpecial(true); result.setType(FunctionConstants.TypeEnum.CHOOSE.getType()); } 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 48941f4..aee1bda 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 @@ -173,11 +173,11 @@ public class InteractiveServiceImpl implements IInteractiveService { List result = JSONArray.parseArray(response.body(), AnswerVO.class); result.stream().filter(answerVO -> answerVO.getRunning() == 0).forEach(answerVO -> { - String[] extras = answerVO.getExtra(); + Object[] extras = answerVO.getExtra(); if(ObjectUtil.isEmpty(answerVO.getExtra()) || extras.length == 0){ return; } - List extraList = Arrays.stream(extras).map(extraResolveStrategyService::resolve).map(JSON::toJSONString).collect(Collectors.toList()); + List extraList = Arrays.stream(extras).map(Object::toString).map(extraResolveStrategyService::resolve).map(JSON::toJSONString).collect(Collectors.toList()); answerVO.setExtra(extraList.toArray(new String[extraList.size()])); }); return result; diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java index 3b1ac38..ec2760d 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java @@ -45,6 +45,6 @@ public class AnswerVO implements Serializable { private String answer; @ApiModelProperty("其它调用的参数") - private String[] extra; + private Object[] extra; } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java index 093eb06..3a25314 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java @@ -76,7 +76,7 @@ public class InteractiveHandler extends TextWebSocketHandler { log.info("返回结果为:"+ JSON.toJSONString(askResult)); } else { - String funcCode = messageContext.getString("func"); + String funcCode = messageContext.getString("funcCode"); FuncRouteEnum funcEnum = FuncRouteEnum.getEnumByFuncCode(funcCode); switch (funcEnum) { case CHOOSE_STATION: