|
@@ -252,23 +252,36 @@ public class DataServiceImpl extends BaseServiceImpl<DataMapper, Data> implement
|
|
|
}
|
|
|
countSize.getAndIncrement();
|
|
|
});
|
|
|
- //是否选择已标注,如果已标注则需要检测所有图片是否标注
|
|
|
- if (!labeledList.isEmpty()) {
|
|
|
- // 已标注数量
|
|
|
- long unmarkedCount = labeledList.stream().filter(Boolean.FALSE::equals).count();
|
|
|
+ // TODO 李兆晏 确认逻辑是否正确 start
|
|
|
+// //是否选择已标注,如果已标注则需要检测所有图片是否标注
|
|
|
+// if (!labeledList.isEmpty()) {
|
|
|
+// // 已标注数量
|
|
|
+// long unmarkedCount = labeledList.stream().filter(Boolean.FALSE::equals).count();
|
|
|
+// // 未标注数量
|
|
|
+// long markedCount = labeledList.stream().filter(Boolean.TRUE::equals).count();
|
|
|
+// // 如果存在未标注的数据,则返回错误信息
|
|
|
+// if (unmarkedCount > 0 && labeled) {
|
|
|
+// String format = String.format("错误: 已标注文件 %d 个,未标注文件 %d 个", markedCount, unmarkedCount);
|
|
|
+// return CommonResult.fail(format);
|
|
|
+// }
|
|
|
+// // 如果存在标注的数据,则返回错误信息
|
|
|
+// if (markedCount > 0 && !labeled) {
|
|
|
+// String format = String.format("错误: 已标注文件 %d 个,未标注文件 %d 个", markedCount, unmarkedCount);
|
|
|
+// return CommonResult.fail(format);
|
|
|
+// }
|
|
|
+// }
|
|
|
+ if (labeled){
|
|
|
// 未标注数量
|
|
|
+ long unmarkedCount = labeledList.stream().filter(Boolean.FALSE::equals).count();
|
|
|
+ // 已标注数量
|
|
|
long markedCount = labeledList.stream().filter(Boolean.TRUE::equals).count();
|
|
|
- // 如果存在未标注的数据,则返回错误信息
|
|
|
- if (unmarkedCount > 0 && labeled) {
|
|
|
- String format = String.format("错误: 已标注文件 %d 个,未标注文件 %d 个", markedCount, unmarkedCount);
|
|
|
- return CommonResult.fail(format);
|
|
|
- }
|
|
|
- // 如果存在标注的数据,则返回错误信息
|
|
|
- if (markedCount > 0 && !labeled) {
|
|
|
+
|
|
|
+ if (unmarkedCount > 0) {
|
|
|
String format = String.format("错误: 已标注文件 %d 个,未标注文件 %d 个", markedCount, unmarkedCount);
|
|
|
return CommonResult.fail(format);
|
|
|
}
|
|
|
}
|
|
|
+ // TODO 李兆晏 确认逻辑是否正确 end
|
|
|
dataMapper.insertBatch(dataList);
|
|
|
FileUtils.deleteFile(destZip);
|
|
|
} catch (Exception e) {
|