|
@@ -451,6 +451,24 @@ public class TargetIdentificationTaskServiceImpl extends BaseServiceImpl<TargetI
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 检查是否有test集
|
|
|
+ * @param batch
|
|
|
+ */
|
|
|
+ private boolean hasTestSet(String batch) {
|
|
|
+ String[] batches = batch.split(",");
|
|
|
+
|
|
|
+ for (String batchNum : batches) {
|
|
|
+ List<DataVo> dataVoList = dataService.getDataByBatchNum(batchNum);
|
|
|
+ for (DataVo dataVo : dataVoList) {
|
|
|
+ if (StringUtils.isEmpty(dataVo.getLabelurl())) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
private void createTestTask(Long taskId, CreateTargetIdentificationTaskDto taskDto, Map<String, String> records) {
|
|
|
List<TaskDto> algTaskList = taskDto.getAlgTaskList();
|
|
|
List<String> testBatchNumList = taskDto.getTestBatchNumList();
|
|
@@ -497,7 +515,7 @@ public class TargetIdentificationTaskServiceImpl extends BaseServiceImpl<TargetI
|
|
|
subtaskDetail.setName(algName + "_验证");
|
|
|
subtaskDetail.setParameters(params.get(1));
|
|
|
copyFilesToPath(batchNum, subtaskPath, true);
|
|
|
- subtaskDetail.setType(algorithmModelVo.getVerifyUrl() + ";;;" + records.get(algName));
|
|
|
+ subtaskDetail.setType(algorithmModelVo.getVerifyUrl() + ";;;" + (records != null ? records.get(algName) : ""));
|
|
|
subtaskDetailsService.insert(subtaskDetail);
|
|
|
// reset to '测试'
|
|
|
subtaskPath = "/" + UUID.randomUUID().toString().replace("-", "_");
|
|
@@ -508,9 +526,11 @@ public class TargetIdentificationTaskServiceImpl extends BaseServiceImpl<TargetI
|
|
|
|
|
|
subtaskDetail.setName(algName + "_测试");
|
|
|
subtaskDetail.setPreprocessPath(subtaskDetail.getPreprocessPath() + "/images");
|
|
|
- subtaskDetail.setType(algorithmModelVo.getTestUrl() + ";;;" + records.get(algName));
|
|
|
- copyFilesToPath(batchNum, subtaskPath, false);
|
|
|
- subtaskDetailsService.insert(subtaskDetail);
|
|
|
+ subtaskDetail.setType(algorithmModelVo.getTestUrl() + ";;;" + (records != null ? records.get(algName) : ""));
|
|
|
+ if (hasTestSet(batchNum)) {
|
|
|
+ copyFilesToPath(batchNum, subtaskPath, false);
|
|
|
+ subtaskDetailsService.insert(subtaskDetail);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|