Prechádzať zdrojové kódy

feature 解决Key重复导致得报错

xiahan 1 rok pred
rodič
commit
a963d93fd5

+ 1 - 1
cx-knowledge-base/cx-knowledge-base-common/src/main/java/com/rongwei/bscommon/sys/service/impl/KnowledgeBaseServiceImpl.java

@@ -76,7 +76,7 @@ public class KnowledgeBaseServiceImpl implements KnowledgeBaseService {
                     List<KBDictDataVo> kbDictDataVoList = collect.stream().filter(dictData -> dictData.getLabel().contains(searchContent)).collect(Collectors.toList());
                     String searchValue = kbDictDataVoList.stream().map(KBDictDataVo::getValue).collect(Collectors.joining(","));
                     info.setSearchValue(StringUtils.isBlank(searchValue) ? "" : searchValue);
-                    info.setDictData(collect.stream().collect(Collectors.toMap(KBDictDataVo::getValue, KBDictDataVo::getLabel)));
+                    info.setDictData(collect.stream().collect(Collectors.toMap(KBDictDataVo::getValue, KBDictDataVo::getLabel,(existingValue, newValue) -> existingValue)));
                 } else {
                     info.setSearchValue(searchContent);
                 }