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 712b2bf..47908f1 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 @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import org.springblade.core.tool.utils.BeanUtil; import java.io.Serializable; @@ -47,4 +48,9 @@ public class AnswerVO implements Serializable { @ApiModelProperty("其它调用的参数") private Object[] extras; + public static void error(AnswerVO usualVO) { + usualVO.setRunning(0); + usualVO.setStatus(-2); + } + } 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 759c3b8..32c132d 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 @@ -109,9 +109,9 @@ public class InteractiveSchedule { answerVO.setExtras(extraList.toArray(new String[extraList.size()])); } catch(Exception e) { - redisTemplate.opsForList().leftPush(HZIMS_BIGMODEL_ASK_KEY,answerVO.getSessionId()); e.printStackTrace(); - throw new RuntimeException(e); + AnswerVO.error(answerVO); + answerVO.setAnswer("非常抱歉,系统在处理您的请求时遇到了问题。请稍后再试或联系我们的客服团队。"); } } if(sessionIds.contains(answerVO.getSessionId())){