|
@@ -108,7 +108,7 @@ public class RetrievalFacade extends RetrievalServiceImpl {
|
|
|
retrievalMappingFacade.update(retrievalMapping, mappingQe);
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 添加或者编辑标签同义词
|
|
|
*
|
|
@@ -349,6 +349,19 @@ public class RetrievalFacade extends RetrievalServiceImpl {
|
|
|
QueryWrapper<QuestionInfo> questionInfoQe = new QueryWrapper<>();
|
|
|
questionInfoQe.in("tag_name", questionNames);
|
|
|
List<QuestionInfo> questionInfos = questionFacade.list(questionInfoQe);
|
|
|
+
|
|
|
+
|
|
|
+ Map<String,Long> quesCouMap = questionInfos.stream().collect(Collectors.groupingBy(QuestionInfo::getTagName, Collectors.counting()));
|
|
|
+ for(String key:quesCouMap.keySet()){
|
|
|
+ if(quesCouMap.get(key)>1){
|
|
|
+ sbf.append(key).append(" ");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(sbf.length()>0){
|
|
|
+ sbf.append("数据不规范");
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
|
|
|
+ }
|
|
|
+
|
|
|
Map<String, Long> questionIdMap = questionInfos.stream().collect(Collectors.toMap(QuestionInfo::getTagName, i -> i.getId()));
|
|
|
if(questionNames.size()==questionInfos.size()){
|
|
|
List<QuestionInfo> questionInfos_ = questionInfos.stream().filter(p->p.getTagType()==TagTypeEnum.T8.getKey()||p.getTagType()==TagTypeEnum.T10.getKey()||p.getTagType()==TagTypeEnum.T11.getKey()).collect(Collectors.toList());
|