Browse Source

fix:完善问题选项问题解析

zhongwei
haungxing 9 months ago
parent
commit
15b6b41bb6
  1. 3
      hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/ExtraVO.java
  2. 1
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java
  3. 4
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java
  4. 2
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java
  5. 2
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java

3
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;

1
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());
}

4
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<AnswerVO> 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<String> extraList = Arrays.stream(extras).map(extraResolveStrategyService::resolve).map(JSON::toJSONString).collect(Collectors.toList());
List<String> 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;

2
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;
}

2
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:

Loading…
Cancel
Save