enhance
This commit is contained in:
parent
3f26e815eb
commit
f331fe1dc6
|
|
@ -180,8 +180,12 @@ public class AnnotationTaskController extends BaseController {
|
|||
@RequiresPermissions("dataCenter:task:manual_annotate")
|
||||
@PostMapping("/manualAnnotate")
|
||||
public AjaxResult manualAnnotate(@Validated @RequestBody AnnotationTaskAnnotatorEntity subTask) {
|
||||
annotationTaskService.manualAnnotate(subTask);
|
||||
return AjaxResult.success("手工标注保存成功");
|
||||
int result = annotationTaskService.manualAnnotate(subTask);
|
||||
if (result >0) {
|
||||
return AjaxResult.success("手工标注保存成功");
|
||||
}else {
|
||||
return AjaxResult.error("手工标注保存失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**智能标注,预留接口
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ public class ReleaseVersionController extends BaseController {
|
|||
@GetMapping("/list")
|
||||
public TableDataInfo list(ReleaseVersionEntity version) {
|
||||
try {
|
||||
startPage();
|
||||
List<ReleaseVersionEntity> allReleaseVersions = releaseVersionService.getAllReleaseVersions(version);
|
||||
return getDataTable(allReleaseVersions);
|
||||
}catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
package com.bonus.ai.domain.dataset;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -12,6 +13,7 @@ import java.util.List;
|
|||
* 版本类
|
||||
* @author wangvivi
|
||||
*/
|
||||
@Data
|
||||
public class ReleaseVersionEntity extends BaseEntity {
|
||||
/**版本ID*/
|
||||
private Long versionId;
|
||||
|
|
@ -27,53 +29,14 @@ public class ReleaseVersionEntity extends BaseEntity {
|
|||
/**版本关联的文件标注结果和原始文件信息*/
|
||||
private List<AnnotationResult> fileAnnotationResultList;
|
||||
|
||||
public Long getVersionId() {
|
||||
return versionId;
|
||||
}
|
||||
/**查询目的,用于返回版本相关的任务名称,数据集名称,任务关联的文件的标注情况*/
|
||||
String taskName;
|
||||
String datasetName;
|
||||
//标注类型
|
||||
String annotationType;
|
||||
Long auditedCount;
|
||||
Long totalCount;
|
||||
|
||||
public void setVersionId(Long versionId) {
|
||||
this.versionId = versionId;
|
||||
}
|
||||
|
||||
public String getVersionName() {
|
||||
return versionName;
|
||||
}
|
||||
|
||||
public void setVersionName(String versionName) {
|
||||
this.versionName = versionName;
|
||||
}
|
||||
|
||||
public String getVersionDesc() {
|
||||
return versionDesc;
|
||||
}
|
||||
|
||||
public void setVersionDesc(String versionDesc) {
|
||||
this.versionDesc = versionDesc;
|
||||
}
|
||||
|
||||
public Long getDatasetId() {
|
||||
return datasetId;
|
||||
}
|
||||
|
||||
public void setDatasetId(Long datasetId) {
|
||||
this.datasetId = datasetId;
|
||||
}
|
||||
|
||||
public Long getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public void setTaskId(Long taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public List<AnnotationResult> getFileAnnotationResultList() {
|
||||
return fileAnnotationResultList;
|
||||
}
|
||||
|
||||
public void setFileAnnotationResultList(List<AnnotationResult> fileAnnotationResultList) {
|
||||
this.fileAnnotationResultList = fileAnnotationResultList;
|
||||
}
|
||||
|
||||
public static class AnnotationResult{
|
||||
/**文件id*/
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ public interface AnnotationTaskMapper
|
|||
|
||||
List<DataSetBasicFileEntity>getTaskBasicFile(AnnotationTaskEntity annotationTask);
|
||||
String getAuditFailReasonByFileId(Long taskId, Long fileId);
|
||||
|
||||
int updateAnnotationInfo(AnnotationTaskAnnotatorEntity entity);
|
||||
//这个接口不需要,可以扩展selectAnnotationTaskList
|
||||
// AnnotationTaskEntity selectAnnotationTaskListUUID(Long taskId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -269,7 +269,13 @@ public class AnnotationTaskServiceImpl implements AnnotationTaskService {
|
|||
* 手工标注
|
||||
*/
|
||||
@Override
|
||||
public void manualAnnotate(AnnotationTaskAnnotatorEntity subTask) {
|
||||
public int manualAnnotate(AnnotationTaskAnnotatorEntity subTask) {
|
||||
try {
|
||||
return annotationTaskMapper.updateAnnotationInfo(subTask);
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -277,8 +283,8 @@ public class AnnotationTaskServiceImpl implements AnnotationTaskService {
|
|||
* AI标注
|
||||
*/
|
||||
@Override
|
||||
public void aiAnnotate(AnnotationTaskAnnotatorEntity subTask) {
|
||||
|
||||
public int aiAnnotate(AnnotationTaskAnnotatorEntity subTask) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.bonus.ai.domain.dataset.ReleaseVersionEntity;
|
|||
import com.bonus.ai.mapper.ReleaseVersionMapper;
|
||||
import com.bonus.ai.service.dataset.ReleaseVersionService;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
@ -37,6 +38,7 @@ public class ReleaseVersionServiceImpl implements ReleaseVersionService {
|
|||
@Override
|
||||
public AjaxResult release(ReleaseVersionEntity version) {
|
||||
try {
|
||||
version.setCreateBy(SecurityUtils.getUserId().toString());
|
||||
int num = mapper.release(version);
|
||||
return num>0?AjaxResult.success():AjaxResult.error();
|
||||
}catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@ public interface AnnotationTaskService {
|
|||
AnnotationTaskEntity getTaskInfo(Long taskId);
|
||||
|
||||
/**手工标注*/
|
||||
void manualAnnotate(AnnotationTaskAnnotatorEntity subTask);
|
||||
int manualAnnotate(AnnotationTaskAnnotatorEntity subTask);
|
||||
|
||||
/**AI自动标注*/
|
||||
void aiAnnotate(AnnotationTaskAnnotatorEntity subTask);
|
||||
int aiAnnotate(AnnotationTaskAnnotatorEntity subTask);
|
||||
|
||||
// /**根据类型获取标注任务列表*/
|
||||
// List<AnnotationTaskEntity> getTaskList(AnnotationTaskEntity task);
|
||||
|
|
|
|||
|
|
@ -112,34 +112,6 @@
|
|||
GROUP BY ap.task_id
|
||||
</select>
|
||||
|
||||
|
||||
<!-- <select id="getDatasetList" parameterType="com.bonus.ai.domain.dataset.DataSetEntity" resultMap="DatasetResult">-->
|
||||
<!-- <include refid="selectDatasetVo"/>-->
|
||||
<!-- <where>-->
|
||||
<!-- and ad.del_flag = '0'-->
|
||||
<!-- <if test="datasetName != null and datasetName != ''">-->
|
||||
<!-- AND ad.dataset_name like concat('%', #{datasetName}, '%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="dataType != null and dataType != ''">-->
|
||||
<!-- AND ad.data_type = #{dataType}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="annotationStatus != null and annotationStatus != ''">-->
|
||||
<!-- AND ad.annotation_status = #{annotationStatus}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="isPublic != null and isPublic != ''">-->
|
||||
<!-- AND ad.is_public = #{isPublic}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="createBy != null and createBy != ''">-->
|
||||
<!-- AND ad.create_by = #{createBy}-->
|
||||
<!-- </if>-->
|
||||
<!-- </where>-->
|
||||
<!-- order by create_time desc-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <select id="selectAnnotationTaskListUUID" resultType="com.bonus.ai.domain.dataset.AnnotationTaskEntity">-->
|
||||
<!-- SELECT label_studio_project_id, task_id, task_uuid FROM ai_annotation_task where del_flag = 0-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- 插入标注任务 -->
|
||||
<insert id="insertAnnotationTask" parameterType="com.bonus.ai.domain.dataset.AnnotationTaskEntity" useGeneratedKeys="true" keyProperty="taskId">
|
||||
INSERT INTO ai_annotation_task
|
||||
|
|
@ -319,22 +291,15 @@
|
|||
<update id="updateAnnotationInfo" parameterType="com.bonus.ai.domain.dataset.AnnotationTaskAnnotatorEntity">
|
||||
UPDATE ai_annotation_task_annotator_map
|
||||
<set>
|
||||
<if test="annotation_result != null">annotation_result = #{annotationResult},</if>
|
||||
<if test="taskName != null">task_name = #{taskName},</if>
|
||||
<if test="taskUuid != null">task_uuid = #{taskUuid},</if>
|
||||
<if test="taskDesc != null">description = #{taskDesc},</if>
|
||||
<if test="annotateScene != null">annotation_scene = #{annotateScene},</if>
|
||||
<if test="annotateType != null">annotation_type = #{annotateType},</if>
|
||||
<if test="labels != null">labels = #{labels},</if>
|
||||
<if test="isStartTeam != null">is_annotation_team = #{isStartTeam},</if>
|
||||
<if test="annotateTaskStatus != null">annotation_status = #{annotateTaskStatus},</if>
|
||||
<if test="annotationResult != null and annotationResult != ''">annotation_result = #{annotationResult},</if>
|
||||
<if test="annotationResource != null and annotationResource != ''">annotation_resource = #{annotationResource},</if>
|
||||
<if test="annotateTaskStatus != null and annotateTaskStatus != ''">annotation_status = #{annotateTaskStatus},</if>
|
||||
<if test="labelStudioProjectId != null">label_studio_project_id = #{labelStudioProjectId},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
</set>
|
||||
WHERE task_id = #{taskId}
|
||||
</update>
|
||||
<!-- resultMap="statusCountResultMap"-->
|
||||
|
||||
<select id="countStatusByTaskId" resultType="com.bonus.ai.domain.dataset.AnnotationFileStatusCount">
|
||||
SELECT annotation_status, COUNT(*) AS record_count
|
||||
FROM ai_annotation_task_annotator_map
|
||||
|
|
|
|||
|
|
@ -48,9 +48,18 @@
|
|||
WHERE adfm.dataset_id = ad.dataset_id) AS annotatedCount,
|
||||
(SELECT COUNT(*)
|
||||
FROM ai_dataset_file_map adfm
|
||||
WHERE adfm.dataset_id = ad.dataset_id AND adfm.is_annotated = '0') AS notAnnotatedCount
|
||||
WHERE adfm.dataset_id = ad.dataset_id AND adfm.is_annotated = '0') AS notAnnotatedCount,
|
||||
adv.version_name AS latestVersionName
|
||||
FROM
|
||||
ai_dataset ad
|
||||
LEFT JOIN (
|
||||
SELECT task_id, dataset_id, version_name
|
||||
FROM ai_dataset_version
|
||||
WHERE (task_id, dataset_id, create_time) IN (
|
||||
SELECT task_id, dataset_id, MAX(create_time)
|
||||
FROM ai_dataset_version
|
||||
GROUP BY task_id, dataset_id
|
||||
)) adv on adv.dataset_id = ad.dataset_id
|
||||
</sql>
|
||||
|
||||
<insert id="insert" parameterType="com.bonus.ai.domain.dataset.DataSetEntity" useGeneratedKeys="true" keyProperty="datasetId">
|
||||
|
|
@ -137,7 +146,7 @@
|
|||
AND ad.create_by = #{createBy}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
order by ad.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,15 +14,27 @@
|
|||
</update>
|
||||
|
||||
<select id="getAllReleaseVersions" resultType="com.bonus.ai.domain.dataset.ReleaseVersionEntity">
|
||||
select version_id AS versionId,
|
||||
version_name AS versionName,
|
||||
version_description AS versionDesc,
|
||||
dataset_id AS datasetId,
|
||||
task_id AS taskId,
|
||||
create_by AS createBy,
|
||||
create_time AS createTime
|
||||
from ai_dataset_version
|
||||
where del_flag = '0'
|
||||
select atv.version_id AS versionId,
|
||||
atv.version_name AS versionName,
|
||||
atv.version_description AS versionDesc,
|
||||
atv.dataset_id AS datasetId,
|
||||
atv.task_id AS taskId,
|
||||
atv.create_by AS createBy,
|
||||
atv.create_time AS createTime,
|
||||
aat.task_name as taskName,
|
||||
ad.dataset_name as datasetName,
|
||||
aat.annotation_type as annotationType,
|
||||
SUM(CASE WHEN ap.annotation_status = '2' or ap.annotation_status = '3' THEN 1 ELSE 0 END) AS auditedCount,
|
||||
COUNT(*) AS totalCount
|
||||
from ai_dataset_version atv
|
||||
left join ai_annotation_task aat on aat.task_id = atv.task_id
|
||||
left join ai_dataset ad on ad.dataset_id = atv.dataset_id
|
||||
left join ai_annotation_task_annotator_map ap on atv.task_id = ap.task_id
|
||||
where atv.del_flag = '0' and ap.annotation_status IN ('0', '1', '2','3')
|
||||
<if test="versionName != null and versionName != ''">
|
||||
AND version_name LIKE CONCAT('%', #{versionName}, '%')
|
||||
</if>
|
||||
GROUP BY ap.task_id
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -9,10 +9,10 @@ create table ai_annotation_task
|
|||
task_name varchar(64) comment '任务名称',
|
||||
task_uuid varchar(64) comment '任务唯一标识id',
|
||||
description varchar(500) default '' comment '描述',
|
||||
annotation_scene char(1) comment '标注场景(对应数据集的数据类型)',
|
||||
annotation_type char(2) comment '标注类型(不同数据类型有不同的标注类型,如图片:图像分类,物体检测等)',
|
||||
annotation_scene char(1) default '0' comment '标注场景(对应数据集的数据类型)',
|
||||
annotation_type char(2) default '0' comment '标注类型(不同数据类型有不同的标注类型,如图片:图像分类,物体检测等)',
|
||||
labels varchar(200) comment '允许的标签集',
|
||||
is_annotation_team char(1) comment '标注团队id(0未启用,1启用团队)',
|
||||
is_annotation_team char(1) default '0' comment '标注团队id(0未启用,1启用团队)',
|
||||
annotation_status char(1) default '0' comment '0未标注,1正在标注,2已标注,3正在审核,4已审核',
|
||||
label_studio_project_id bigint(20) comment "label studio 对应的projectId"
|
||||
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
|
||||
|
|
@ -36,9 +36,9 @@ create table ai_annotation_task_annotator_map
|
|||
file_url varchar(200) default '' comment '文件网络路径',
|
||||
label_studio_task_id bigint(20) comment "label studio 对应的taskId"
|
||||
description varchar(500) default '' comment '描述',
|
||||
annotation_status char(1) comment '0未标注,1已标注,2已审核,3 审核驳回',
|
||||
annotation_status char(1) default '0' comment '0未标注,1已标注,2已审核,3 审核驳回',
|
||||
annotation_result text comment '标注结果(json串)',
|
||||
annotation_resource char(1) comment '0人工标注,1智能标注',
|
||||
annotation_resource char(1) default '0' comment '0人工标注,1智能标注',
|
||||
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
|
||||
annotation_time datetime default null comment '标注时间',
|
||||
review_time datetime default null comment '审核时间',
|
||||
|
|
@ -81,7 +81,7 @@ create table ai_basic_file
|
|||
file_size bigint comment '文件大小',
|
||||
file_last_modifytime datetime default null comment '文件最后修改时间',
|
||||
upload_time datetime default null comment '上传时间',
|
||||
is_directory char(1) comment '是否文件夹',
|
||||
is_directory char(1) default '0' comment '是否文件夹',
|
||||
is_public char(1) default '0' comment '0 no, 1 yes',
|
||||
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
|
|
@ -102,8 +102,8 @@ create table ai_dataset
|
|||
dataset_uuid varchar(64) comment '数据集唯一标识id',
|
||||
dataset_name varchar(200) comment '数据集名称',
|
||||
description varchar(500) default '' comment '描述',
|
||||
data_type char(1) comment '数据类型',
|
||||
data_source char(1) comment '数据来源(0:local,1:obs)',
|
||||
data_type char(1) default '0' comment '数据类型',
|
||||
data_source char(1) default '0' comment '数据来源(0:local,1:obs)',
|
||||
input_path varchar(200) comment '输入路径',
|
||||
output_path varchar(200) comment '输入路径',
|
||||
input_id bigint(20) comment '输入文件夹id',
|
||||
|
|
@ -151,7 +151,7 @@ create table ai_dataset_log
|
|||
operation_type varchar(64) comment '操作类型(0代表标注,1代表审核)',
|
||||
operation_by varchar(64) default '' comment '操作人',
|
||||
operation_time datetime default NULL comment '操作时间',
|
||||
operation_result char(1) comment '操作结果(如审核通过,审核不通过)',
|
||||
operation_result char(1) default '0' comment '操作结果(如审核通过,审核不通过)',
|
||||
operation_reason varchar(500) comment '操作原因(如不通过原因)',
|
||||
value_before text comment '操作之前的值',
|
||||
value_after text comment '操作之后的值',
|
||||
|
|
|
|||
Loading…
Reference in New Issue