This commit is contained in:
limin 2025-01-22 16:15:35 +08:00
parent 6c99644989
commit cf6333ad0e

View File

@ -129,13 +129,18 @@ public class DatasetServiceImpl implements DatasetService {
throw new ServiceException(new ErrorCode(
20000, "数据集文件不能为空"));
}
if (status != 2 && dataset.getDatasetType() == 2){
throw new ServiceException(new ErrorCode(
20000, "评估数据集只能上传标注完成的数据"));
}else if (dataset.getStatus() != status) {
throw new ServiceException(new ErrorCode(
20000, "数据集标注状态错误!应该是【" + DatasetStatusEnum.getStatusByName(status) + ""));
if (dataset.getDatasetType() == 2){
if (status != 2 ){
throw new ServiceException(new ErrorCode(
20000, "评估数据集只能上传标注完成的数据"));
}
}else {
if (dataset.getStatus() != status) {
throw new ServiceException(new ErrorCode(
20000, "数据集标注状态错误!应该是【" + DatasetStatusEnum.getStatusByName(status) + ""));
}
}
dataset.setStatus(status);
datasetMapper.updateById(dataset);
}
@ -221,12 +226,16 @@ public class DatasetServiceImpl implements DatasetService {
throw new ServiceException(new ErrorCode(
20000, "数据集文件不能为空"));
}
if (status != 2 && updateObj.getDatasetType() == 2){
throw new ServiceException(new ErrorCode(
20000, "评估数据集只能上传标注完成的数据"));
}else if (updateObj.getStatus() != status) {
throw new ServiceException(new ErrorCode(
20000, "数据集标注状态错误!应该是【" + DatasetStatusEnum.getStatusByName(status) + ""));
if (updateObj.getDatasetType() == 2){
if (status != 2 ){
throw new ServiceException(new ErrorCode(
20000, "评估数据集只能上传标注完成的数据"));
}
} else {
if (updateObj.getStatus() != status) {
throw new ServiceException(new ErrorCode(
20000, "数据集标注状态错误!应该是【" + DatasetStatusEnum.getStatusByName(status) + ""));
}
}
updateObj.setStatus(status);
}