Commit edf3bf5e by 裴大威

fix500-2

parent 91e1a9a1
...@@ -290,9 +290,14 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz { ...@@ -290,9 +290,14 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
if (selfRobotKeyword.getId()==null){ if (selfRobotKeyword.getId()==null){
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "id不能为空!"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "id不能为空!");
} }
List<String> keywords = selfRobotKeywordDao.getKeywords(selfRobotKeyword.getBookGroupId()); List<SelfRobotKeyword> keywords = selfRobotKeywordDao.getListByBookGroupId(selfRobotKeyword.getBookGroupId());
if (!ListUtils.isEmpty(keywords)&&keywords.contains(selfRobotKeyword.getKeyword())){ if (!ListUtils.isEmpty(keywords)){
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "关键词不能重复!"); for (SelfRobotKeyword robotKeyword:keywords){
if (robotKeyword.getBookGroupId()!=selfRobotKeyword.getBookGroupId()
&&robotKeyword.getKeyword().equals(selfRobotKeyword.getKeyword())){
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "关键词不能重复!");
}
}
} }
checkAddSelfRobotKeyword(selfRobotKeyword); 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