|
|
|
|
@ -40,11 +40,13 @@ public class OcrTaskTypeServiceImpl extends ServiceImpl<OcrTaskTypeMapper, OcrTa
|
|
|
|
|
AssertUtils.notTrue(super.count(countQueryWrapper)>0,String.format("[%s]-已存在",ocrTaskType.getTypeName()));
|
|
|
|
|
}
|
|
|
|
|
//判断重复类型名
|
|
|
|
|
Map<String, Long> countMap = ocrTaskTypes.stream().map(o->o.getTypeName()).collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
|
|
|
|
|
if (countMap.keySet().size()>0) {
|
|
|
|
|
//有重复的类型名
|
|
|
|
|
String typeName = countMap.keySet().stream().filter(key -> countMap.get(key) > 1).distinct().collect(Collectors.joining(","));
|
|
|
|
|
AssertUtils.isEmpty(typeName,String.format("[%s]-重复了",typeName));
|
|
|
|
|
if (ocrTaskTypes.size()>0) {
|
|
|
|
|
Map<String, Long> countMap = ocrTaskTypes.stream().map(o->o.getTypeName()).collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
|
|
|
|
|
if (countMap.keySet().size()>0) {
|
|
|
|
|
//有重复的类型名
|
|
|
|
|
String typeName = countMap.keySet().stream().filter(key -> countMap.get(key) > 1).distinct().collect(Collectors.joining(","));
|
|
|
|
|
AssertUtils.isEmpty(typeName,String.format("[%s]-重复了",typeName));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|