数据集进度修改

This commit is contained in:
limin 2024-12-30 16:49:36 +08:00
parent 7cfdc907fb
commit 5bfbe0d588
7 changed files with 8 additions and 8 deletions

View File

@ -47,6 +47,6 @@ public class DatasetPageReqVO extends PageParam {
private Long dataLength;
@Schema(description = "标注进度", example = "20")
private String annotateProgress;
private Integer annotateProgress;
}

View File

@ -55,7 +55,7 @@ public class DatasetRespVO {
private Long dataLength;
@Schema(description = "标注进度", example = "20")
private String annotateProgress;
private Integer annotateProgress;
/* @Schema(description = "数据集数据文件", example = "[]")
private List<DatasetQuestionRespVO> datasetQuestionRespVOS;*/

View File

@ -42,7 +42,7 @@ public class DatasetSaveReqVO {
private Long dataLength;
@Schema(description = "标注进度", example = "20")
private String annotateProgress;
private Integer annotateProgress;
@Schema(description = "数据集数据文件", example = "[]")
private List<DatasetFilesSaveReqVO> datasetFiles;

View File

@ -66,6 +66,6 @@ public class DatasetDO extends BaseDO {
/**
* 标注进度
*/
private String annotateProgress;
private Integer annotateProgress;
}

View File

@ -33,6 +33,6 @@ public interface DatasetMapper extends BaseMapperX<DatasetDO> {
.orderByDesc(DatasetDO::getId));
}
@Update("update llm_dataset set annotate_progress = CONCAT(#{formattedRatio}, '%') where id = #{datasetId}")
void updateProcess(@Param("formattedRatio") String formattedRatio, @Param("datasetId") Long datasetId);
@Update("update llm_dataset set annotate_progress = #{formattedRatio} where id = #{datasetId}")
void updateProcess(@Param("formattedRatio") Integer formattedRatio, @Param("datasetId") Long datasetId);
}

View File

@ -108,7 +108,7 @@ public class DatasetQuestionServiceImpl implements DatasetQuestionService {
wrapper.eq(DatasetQuestionDO::getStatus,2);
Long annoCount = datasetQuestionMapper.selectCount(wrapper);
double ratio = sumCount == 0 ? 0 : ((double) annoCount / sumCount) *100;
String formattedRatio = String.format("%.2f", ratio);
Integer formattedRatio = ratio == 0 ? 0 : (int) ratio;
datasetMapper.updateProcess(formattedRatio, updateReqVOS.get(0).getDatasetId());
}

View File

@ -107,7 +107,7 @@ public class DatasetServiceImpl implements DatasetService {
.eq(DatasetQuestionDO::getDatasetId, updateObj.getId())
.eq(DatasetQuestionDO::getStatus,2));
double ratio = count == 0 ? 0 : ((double) annoCount / count) *100;
String formattedRatio = String.format("%.2f%%", ratio);
Integer formattedRatio = ratio == 0 ? 0 : (int) ratio;
if (formattedRatio != null){
updateObj.setAnnotateProgress(formattedRatio);
}