|
@@ -117,7 +117,17 @@ public class RetrievalFacade extends RetrievalServiceImpl {
|
|
|
public Boolean addTagRetrieval(AddTagRetrievalVO addTagRetrievalVO) {
|
|
|
if (addTagRetrievalVO.getItemList().stream().distinct().count() != addTagRetrievalVO.getItemList().size()) {
|
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
- "同义词中存在重复数据!");
|
|
|
+ "同义词中存在重复数据("+addTagRetrievalVO.getQuestionName()+")!");
|
|
|
+ }
|
|
|
+
|
|
|
+ long typeOneCou = addTagRetrievalVO.getItemList().stream().filter(i->i.getRetrievalType()==1).count();
|
|
|
+ if(typeOneCou==0){
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
+ "本体必须传("+addTagRetrievalVO.getQuestionName()+")!");
|
|
|
+ }
|
|
|
+ if(typeOneCou>1){
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
+ "本体只能有一个("+addTagRetrievalVO.getQuestionName()+")!");
|
|
|
}
|
|
|
|
|
|
Date now = DateUtil.now();
|