|
|
|
@ -107,20 +107,18 @@ public class AskQuestionLibraryManageServiceImpl implements AskQuestionLibraryMa
|
|
|
|
|
// 原始数据已经存在,更新数据
|
|
|
|
|
if (Objects.nonNull(one)){
|
|
|
|
|
// 更新数据
|
|
|
|
|
if (CollUtil.isEmpty(questionMap.get(one.getId()))){
|
|
|
|
|
// 相似问不为空。查看相似问是否存在
|
|
|
|
|
List<String> questionList = questionMap.get(one.getId());
|
|
|
|
|
if (CollUtil.isEmpty(questionList) || !questionList.contains(askTemplateQuestionLibrary.getStandardQuestion())){
|
|
|
|
|
// 不存在相似问,新增一条相似问数据
|
|
|
|
|
AskTemplateQuestionSimilarity similarity = new AskTemplateQuestionSimilarity();
|
|
|
|
|
similarity.setSimilarityQuestion(askTemplateQuestionLibrary.getStandardQuestion());
|
|
|
|
|
similarity.setLibraryId(one.getId());
|
|
|
|
|
askTemplateQuestionSimilarityService.save(similarity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<String> questionList = questionMap.get(one.getId());
|
|
|
|
|
// 相似问不为空。查看相似问是否存在
|
|
|
|
|
if (CollUtil.isEmpty(questionList) || !questionList.contains(askTemplateQuestionLibrary.getStandardQuestion())) {
|
|
|
|
|
// 不存在相似问,新增一条相似问数据
|
|
|
|
|
AskTemplateQuestionSimilarity similarity = new AskTemplateQuestionSimilarity();
|
|
|
|
|
similarity.setSimilarityQuestion(askTemplateQuestionLibrary.getStandardQuestion());
|
|
|
|
|
similarity.setLibraryId(one.getId());
|
|
|
|
|
askTemplateQuestionSimilarityService.save(similarity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return one.getId();
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
// 新增数据
|
|
|
|
|
// askTemplateQuestionLibrary.setQuestion(CollUtil.newArrayList(askTemplateQuestionLibrary.getDescription()));
|
|
|
|
|
// if (StrUtil.isNotEmpty(commonDic.getDescription())){
|
|
|
|
@ -151,7 +149,7 @@ public class AskQuestionLibraryManageServiceImpl implements AskQuestionLibraryMa
|
|
|
|
|
String questionLibraryId = this.saveQuestionLibrary(askTemplateQuestionLibrary);
|
|
|
|
|
if (refreshQaKnowledge) {
|
|
|
|
|
// 对问题库进行更新操作
|
|
|
|
|
qaKnowledgeManageService.refreshQaKnowledge();
|
|
|
|
|
qaKnowledgeManageService.saveOrUpdateQuestionLibrary(CollUtil.newArrayList(questionLibraryId));
|
|
|
|
|
}
|
|
|
|
|
return questionLibraryId;
|
|
|
|
|
|
|
|
|
|