|
|
|
@ -86,6 +86,7 @@ public class AskQuestionLibraryManageServiceImpl implements AskQuestionLibraryMa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public String saveQuestionLibrary(AskTemplateQuestionLibrary askTemplateQuestionLibrary) {
|
|
|
|
|
assertSave(askTemplateQuestionLibrary);
|
|
|
|
|
|
|
|
|
@ -107,8 +108,7 @@ public class AskQuestionLibraryManageServiceImpl implements AskQuestionLibraryMa
|
|
|
|
|
}
|
|
|
|
|
one.setQuestion(question);
|
|
|
|
|
askTemplateQuestionLibraryService.updateById(one);
|
|
|
|
|
// 对问题库进行更新操作
|
|
|
|
|
qaKnowledgeManageService.refreshQaKnowledge();
|
|
|
|
|
|
|
|
|
|
return one.getId();
|
|
|
|
|
}else {
|
|
|
|
|
// 新增数据
|
|
|
|
@ -139,10 +139,21 @@ public class AskQuestionLibraryManageServiceImpl implements AskQuestionLibraryMa
|
|
|
|
|
askTemplateQuestionLibrary.setDefaultAnswerCode(nextDefaultCode);
|
|
|
|
|
|
|
|
|
|
askTemplateQuestionLibraryService.save(askTemplateQuestionLibrary);
|
|
|
|
|
return askTemplateQuestionLibrary.getId();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public String saveQuestionLibrary(AskTemplateQuestionLibrary askTemplateQuestionLibrary, boolean refreshQaKnowledge) {
|
|
|
|
|
|
|
|
|
|
String questionLibraryId = this.saveQuestionLibrary(askTemplateQuestionLibrary);
|
|
|
|
|
if (refreshQaKnowledge) {
|
|
|
|
|
// 对问题库进行更新操作
|
|
|
|
|
qaKnowledgeManageService.refreshQaKnowledge();
|
|
|
|
|
return askTemplateQuestionLibrary.getId();
|
|
|
|
|
}
|
|
|
|
|
return questionLibraryId;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -155,9 +166,8 @@ public class AskQuestionLibraryManageServiceImpl implements AskQuestionLibraryMa
|
|
|
|
|
Assert.notNull(library, "知识库不存在");
|
|
|
|
|
Assert.isTrue(askTemplateQuestionLibrary.getDictId().equals(library.getDictId()), "不允许修改类目");
|
|
|
|
|
|
|
|
|
|
this.saveQuestionLibrary(askTemplateQuestionLibrary);
|
|
|
|
|
this.saveQuestionLibrary(askTemplateQuestionLibrary,true);
|
|
|
|
|
// 对问题库进行更新操作
|
|
|
|
|
qaKnowledgeManageService.refreshQaKnowledge();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -197,7 +207,7 @@ public class AskQuestionLibraryManageServiceImpl implements AskQuestionLibraryMa
|
|
|
|
|
}
|
|
|
|
|
questionLibrary.setDescription(currentDTO.getQuestion());
|
|
|
|
|
questionLibrary.setDefaultAnswer(currentDTO.getAnswer());
|
|
|
|
|
this.saveQuestionLibrary(questionLibrary);
|
|
|
|
|
this.saveQuestionLibrary(questionLibrary,false);
|
|
|
|
|
}
|
|
|
|
|
// 对问题库进行更新操作
|
|
|
|
|
qaKnowledgeManageService.refreshQaKnowledge();
|
|
|
|
|