|
|
|
@ -251,7 +251,7 @@ public class IotThingDictServiceImpl extends BaseServiceImpl<IotThingDictMapper, |
|
|
|
throw new SysException("字典编码和字典类型不能为空,请检查下excel数据"); |
|
|
|
} |
|
|
|
Map<String, Long> codeCountMap = sheetData.stream() |
|
|
|
.collect(Collectors.groupingBy(IotThingDictExcel::getCode, Collectors.counting())); // 使用 groupingBy 收集器按照 code 进行分组,并计数 |
|
|
|
.collect(Collectors.groupingBy(s-> s.getCode()+":"+s.getGroupName(), Collectors.counting())); // 使用 groupingBy 收集器按照 code 进行分组,并计数 |
|
|
|
String duplicates = codeCountMap.entrySet().stream() |
|
|
|
.filter(entry -> entry.getValue() > 1) // 过滤出计数大于 1 的 entry |
|
|
|
.map(Map.Entry::getKey) // 获取过滤后的 entry 的 key,即重复的 code 值 |
|
|
|
|