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 9b2ab5f..89c7f3c 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 @@ -40,4 +40,10 @@ public class ExtraVO implements Serializable { @ApiModelProperty("选项") private List selection; + @ApiModelProperty("") + private String agentName; + + @ApiModelProperty("") + private Map agentData; + } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ChoiceAnswerResolveServiceImpl.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ChoiceAnswerResolveServiceImpl.java index 47bb78a..bcc2462 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ChoiceAnswerResolveServiceImpl.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ChoiceAnswerResolveServiceImpl.java @@ -35,13 +35,13 @@ public class ChoiceAnswerResolveServiceImpl implements IAnswerResolveService { @Override public ExtraVO getExtra(JSONObject originExtra) { - ExtraVO result = new ExtraVO(); - JSONArray selections = JSONArray.parseArray(JSON.toJSONString(originExtra.get("data"))); - result.setSelection(selections); + ExtraVO result = JSONObject.parseObject(JSON.toJSONString(originExtra),ExtraVO.class); result.setSpecial(true); String funcCode = originExtra.getString("func"); result.setFuncCode(funcCode); result.setType(FuncRouteEnum.getEnumByFuncCode(funcCode).getType().getType()); + JSONArray selections = JSONArray.parseArray(JSON.toJSONString(originExtra.get("data"))); + result.setSelection(selections); return result; } } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/FrontEndInteractiveSchedule.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/FrontEndInteractiveSchedule.java index cb70eb0..39b63fa 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/FrontEndInteractiveSchedule.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/FrontEndInteractiveSchedule.java @@ -69,7 +69,7 @@ public class FrontEndInteractiveSchedule { IAnswerResolveService answerResolveService = AnswerResolveFactory.getResolveService(extra); JSONObject extraObject = JSONObject.parseObject(JSON.toJSONString(extra)); return answerResolveService.getExtra(extraObject); - }).toArray(); + }).map(JSON::toJSONString).toArray(); answerVO.setExtras(resolveExtras); } catch(Exception e) { 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 fc6337f..810c022 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 @@ -16,6 +16,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.SpringUtil; import org.springframework.beans.factory.annotation.Autowired; @@ -125,12 +126,10 @@ public class InteractiveHandler extends TextWebSocketHandler { private void handleDefaultChoose(JSONObject messageContext,String sessionId) { IInteractiveService interactiveService = SpringUtil.getBean(IInteractiveService.class); - String userId = messageContext.getString("userId"); - String funcCode = messageContext.getString("funcCode"); - Map extra = new HashMap<>(2); - extra.put("func",funcCode); + Map extra = messageContext.toJavaObject(Map.class); + extra.put("func",extra.get("funcCode")); extra.put("data",messageContext.getObject("selection", JSONObject.class)); - interactiveService.specialAsk(sessionId,userId,extra); + interactiveService.specialAsk(sessionId, (String) extra.get("userId"),extra); } private void handleVideoChoose(JSONObject messageContext,String sessionId) {