Commit 0f7172fe by 阮思源

Merge branch 'feat-fix500-2' into 'master'

fix500-2

See merge request rays/pcloud-book!336
parents 91e1a9a1 edf3bf5e
......@@ -290,10 +290,15 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
if (selfRobotKeyword.getId()==null){
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "id不能为空!");
}
List<String> keywords = selfRobotKeywordDao.getKeywords(selfRobotKeyword.getBookGroupId());
if (!ListUtils.isEmpty(keywords)&&keywords.contains(selfRobotKeyword.getKeyword())){
List<SelfRobotKeyword> keywords = selfRobotKeywordDao.getListByBookGroupId(selfRobotKeyword.getBookGroupId());
if (!ListUtils.isEmpty(keywords)){
for (SelfRobotKeyword robotKeyword:keywords){
if (robotKeyword.getBookGroupId()!=selfRobotKeyword.getBookGroupId()
&&robotKeyword.getKeyword().equals(selfRobotKeyword.getKeyword())){
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "关键词不能重复!");
}
}
}
checkAddSelfRobotKeyword(selfRobotKeyword);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment