Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 7 months ago
parent
commit
0269ba5d8f
  1. 6
      hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/ExtraVO.java
  2. 6
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ChoiceAnswerResolveServiceImpl.java
  3. 2
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/FrontEndInteractiveSchedule.java
  4. 9
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java

6
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("选项") @ApiModelProperty("选项")
private List selection; private List selection;
@ApiModelProperty("")
private String agentName;
@ApiModelProperty("")
private Map<String,Object> agentData;
} }

6
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 @Override
public ExtraVO getExtra(JSONObject originExtra) { public ExtraVO getExtra(JSONObject originExtra) {
ExtraVO result = new ExtraVO(); ExtraVO result = JSONObject.parseObject(JSON.toJSONString(originExtra),ExtraVO.class);
JSONArray selections = JSONArray.parseArray(JSON.toJSONString(originExtra.get("data")));
result.setSelection(selections);
result.setSpecial(true); result.setSpecial(true);
String funcCode = originExtra.getString("func"); String funcCode = originExtra.getString("func");
result.setFuncCode(funcCode); result.setFuncCode(funcCode);
result.setType(FuncRouteEnum.getEnumByFuncCode(funcCode).getType().getType()); result.setType(FuncRouteEnum.getEnumByFuncCode(funcCode).getType().getType());
JSONArray selections = JSONArray.parseArray(JSON.toJSONString(originExtra.get("data")));
result.setSelection(selections);
return result; return result;
} }
} }

2
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); IAnswerResolveService answerResolveService = AnswerResolveFactory.getResolveService(extra);
JSONObject extraObject = JSONObject.parseObject(JSON.toJSONString(extra)); JSONObject extraObject = JSONObject.parseObject(JSON.toJSONString(extra));
return answerResolveService.getExtra(extraObject); return answerResolveService.getExtra(extraObject);
}).toArray(); }).map(JSON::toJSONString).toArray();
answerVO.setExtras(resolveExtras); answerVO.setExtras(resolveExtras);
} }
catch(Exception e) { catch(Exception e) {

9
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.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R; 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.Func;
import org.springblade.core.tool.utils.SpringUtil; import org.springblade.core.tool.utils.SpringUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -125,12 +126,10 @@ public class InteractiveHandler extends TextWebSocketHandler {
private void handleDefaultChoose(JSONObject messageContext,String sessionId) { private void handleDefaultChoose(JSONObject messageContext,String sessionId) {
IInteractiveService interactiveService = SpringUtil.getBean(IInteractiveService.class); IInteractiveService interactiveService = SpringUtil.getBean(IInteractiveService.class);
String userId = messageContext.getString("userId"); Map<String, Object> extra = messageContext.toJavaObject(Map.class);
String funcCode = messageContext.getString("funcCode"); extra.put("func",extra.get("funcCode"));
Map<String, Object> extra = new HashMap<>(2);
extra.put("func",funcCode);
extra.put("data",messageContext.getObject("selection", JSONObject.class)); 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) { private void handleVideoChoose(JSONObject messageContext,String sessionId) {

Loading…
Cancel
Save