|
@ -376,56 +376,21 @@ public class RobotService {
|
|
|
relationCode = relationCode.replace(",","','");
|
|
|
if(relaitonCodeType==1){
|
|
|
//1常见问题
|
|
|
List<BaseKnowledgeQuestion> questionList = findTopQuestionList(5,relationCode);
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (BaseKnowledgeQuestion question:questionList){
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("id",question.getId());
|
|
|
json.put("questionName",question.getQuestionName());
|
|
|
jsonArray.add(jsonArray);
|
|
|
}
|
|
|
JSONObject result = new JSONObject();
|
|
|
result.put("content",jsonArray);
|
|
|
result.put("content_type",ImUtil.ContentType.KnowCommonQuestion);
|
|
|
result.put("content",relationCode);
|
|
|
result.put("content_type",ImUtil.ContentType.KnowCommonQuestion.getValue());
|
|
|
result.put("session_id",session_id);
|
|
|
map.put("2",result);
|
|
|
}else if(relaitonCodeType==2){
|
|
|
List<BaseKnowledgeDict> dictList = findTopDictList(5,relationCode);
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (BaseKnowledgeDict dict:dictList){
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("id",dict.getId());
|
|
|
json.put("name",dict.getName());
|
|
|
jsonArray.add(jsonArray);
|
|
|
}
|
|
|
JSONObject result = new JSONObject();
|
|
|
result.put("content",jsonArray);
|
|
|
result.put("content_type",ImUtil.ContentType.KnowCommonDict);
|
|
|
result.put("content",relationCode);
|
|
|
result.put("content_type",ImUtil.ContentType.KnowCommonDict.getValue());
|
|
|
result.put("session_id",session_id);
|
|
|
map.put("2",result);
|
|
|
}else if(relaitonCodeType==3){
|
|
|
List<BaseKnowledgeQuestions> questionsList = findTopQuestionsList(5,relationCode);
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (BaseKnowledgeQuestions questions:questionsList){
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("id",questions.getId());
|
|
|
json.put("questionsName",questions.getQuestionsName());
|
|
|
json.put("businessType",questions.getBusinessType());
|
|
|
//查找关联问题
|
|
|
JSONArray relationArray = new JSONArray();
|
|
|
List<BaseKnowledgeQuestionsRelation> relationList = knowledgeQuestionsRelationDao.selectByQuestionsId(questions.getId());
|
|
|
for (BaseKnowledgeQuestionsRelation relation:relationList){
|
|
|
JSONObject rel = new JSONObject();
|
|
|
rel.put("questionId",relation.getQuestionId());
|
|
|
rel.put("questionName",relation.getQuestionName());
|
|
|
relationArray.add(relationArray);
|
|
|
}
|
|
|
json.put("relation",relationArray);
|
|
|
jsonArray.add(jsonArray);
|
|
|
}
|
|
|
JSONObject result = new JSONObject();
|
|
|
result.put("content",jsonArray);
|
|
|
result.put("content_type",ImUtil.ContentType.KnowCommonQuestions);
|
|
|
result.put("content",relationCode);
|
|
|
result.put("content_type",ImUtil.ContentType.KnowCommonQuestions.getValue());
|
|
|
result.put("session_id",session_id);
|
|
|
map.put("2",result);
|
|
|
}
|