This commit is contained in:
weiweiw 2024-11-27 09:45:03 +08:00
parent cac6d13111
commit 3f26e815eb
8 changed files with 44 additions and 45 deletions

View File

@ -72,9 +72,9 @@ public class AnnotationTaskController extends BaseController {
*/
@RequiresPermissions("dataCenter:task:list:all")
@GetMapping("/list/all")
public TableDataInfo list() {
public TableDataInfo list(AnnotationTaskEntity taskEntity) {
startPage();
List<AnnotationTaskEntity> taskList = annotationTaskService.getAllTaskList();
List<AnnotationTaskEntity> taskList = annotationTaskService.getAllTaskList(taskEntity);
return getDataTable(taskList);
}
@ -85,9 +85,9 @@ public class AnnotationTaskController extends BaseController {
*/
@RequiresPermissions("dataCenter:task:list:creation")
@GetMapping("/list/creation")
public TableDataInfo listMyCreation() {
public TableDataInfo listMyCreation(AnnotationTaskEntity taskEntity) {
startPage();
List<AnnotationTaskEntity> taskList = annotationTaskService.getMyCreationTaskList();
List<AnnotationTaskEntity> taskList = annotationTaskService.getMyCreationTaskList(taskEntity);
return getDataTable(taskList);
}
/**
@ -98,9 +98,9 @@ public class AnnotationTaskController extends BaseController {
@RequiresPermissions("dataCenter:task:list:participant")
@GetMapping("/list/participant")
public TableDataInfo listMyParticipant() {
public TableDataInfo listMyParticipant(AnnotationTaskEntity taskEntity) {
startPage();
List<AnnotationTaskEntity> taskList = annotationTaskService.getMyParticipantTaskList();
List<AnnotationTaskEntity> taskList = annotationTaskService.getMyParticipantTaskList(taskEntity);
return getDataTable(taskList);
}

View File

@ -157,7 +157,7 @@ public class DatasetController extends BaseController {
* @return 操作结果
*/
@RequiresPermissions("dataCenter:dataSet:public")
@PostMapping("/setPublic")
@PostMapping("/set-public")
public AjaxResult setDatasetPublicStatus(@RequestParam String datasetId, @RequestParam String isPublic){
datasetService.setPublicStatus(datasetId, isPublic);
return AjaxResult.success();

View File

@ -50,12 +50,11 @@ public interface DatasetMapper {
/**
* 更新数据集公开状态
*/
int updatePublicStatus(@Param("datasetId") String datasetId, @Param("isPublic") String isPublic);
/**
* 更新数据集标注状态
*/
int updateAnnotationStatus(@Param("datasetId") Long datasetId, @Param("annotationStatus") String annotationStatus);
// /**
// * 更新数据集标注状态
// */
// int updateAnnotationStatus(@Param("datasetId") Long datasetId, @Param("annotationStatus") String annotationStatus);
/**
* 校验数据集名称是否唯一

View File

@ -101,9 +101,8 @@ public class AnnotationTaskServiceImpl implements AnnotationTaskService {
@Override
public List<AnnotationTaskEntity> getAllTaskList() {
public List<AnnotationTaskEntity> getAllTaskList(AnnotationTaskEntity taskEntity) {
try {
AnnotationTaskEntity taskEntity = new AnnotationTaskEntity();
String userId = SecurityUtils.getUserId().toString();
taskEntity.setCreateBy(userId);
taskEntity.setAnnotatorId(userId);
@ -116,9 +115,8 @@ public class AnnotationTaskServiceImpl implements AnnotationTaskService {
}
@Override
public List<AnnotationTaskEntity> getMyCreationTaskList() {
public List<AnnotationTaskEntity> getMyCreationTaskList(AnnotationTaskEntity taskEntity) {
try {
AnnotationTaskEntity taskEntity = new AnnotationTaskEntity();
String userId = SecurityUtils.getUserId().toString();
taskEntity.setCreateBy(userId);
return annotationTaskMapper.selectMyAnnotationTaskList(taskEntity);
@ -130,9 +128,8 @@ public class AnnotationTaskServiceImpl implements AnnotationTaskService {
/**根据类型获取标注任务列表*/
@Override
public List<AnnotationTaskEntity> getMyParticipantTaskList(){
public List<AnnotationTaskEntity> getMyParticipantTaskList(AnnotationTaskEntity taskEntity){
try {
AnnotationTaskEntity taskEntity = new AnnotationTaskEntity();
String userId = SecurityUtils.getUserId().toString();
taskEntity.setAnnotatorId(userId);
taskEntity.setReviewerId(userId);

View File

@ -131,7 +131,15 @@ public class DatasetServiceImpl implements DatasetService {
@Transactional(rollbackFor = Exception.class)
public boolean setPublicStatus(String datasetId, String isPublic) {
try {
datasetMapper.updatePublicStatus(datasetId, isPublic);
DataSetEntity dataSetEntity = new DataSetEntity();
dataSetEntity.setUpdateBy(SecurityUtils.getUserId().toString());
dataSetEntity.setDatasetId(Long.valueOf(datasetId));
if ("1".equals(isPublic) || "0".equals(isPublic)) {
dataSetEntity.setIsPublic(isPublic);
}else {
dataSetEntity.setIsPublic("0");
}
datasetMapper.update(dataSetEntity);
return true;
} catch (Exception e) {
log.error("设置数据集公共状态失败", e);

View File

@ -33,13 +33,13 @@ public interface AnnotationTaskService {
// List<AnnotationTaskEntity> getTaskList(AnnotationTaskEntity task);
/**根据类型获取标注任务列表*/
List<AnnotationTaskEntity> getAllTaskList();
List<AnnotationTaskEntity> getAllTaskList(AnnotationTaskEntity taskEntity);
/**根据类型获取标注任务列表*/
List<AnnotationTaskEntity> getMyCreationTaskList();
List<AnnotationTaskEntity> getMyCreationTaskList(AnnotationTaskEntity taskEntity);
/**根据类型获取标注任务列表*/
List<AnnotationTaskEntity> getMyParticipantTaskList();
List<AnnotationTaskEntity> getMyParticipantTaskList(AnnotationTaskEntity taskEntity);
/**检查标注任务名唯一性*/
boolean checkTaskNameUnique(AnnotationTaskEntity task);

View File

@ -89,6 +89,9 @@
LEFT join ai_dataset ad on ad.dataset_id = at.dataset_id
LEFT join sys_user su on su.user_id = at.create_by
WHERE at.del_flag = '0' and ap.annotation_status IN ('0', '1', '2','3')
<if test="taskName != null and taskName != ''">
AND at.task_name LIKE CONCAT('%', #{taskName}, '%')
</if>
<choose>
<when test="annotatorId != null and annotatorId != '' and reviewerId != null and reviewerId != '' and createBy != null and createBy != ''">
AND (ap.annotator_id = #{annotatorId} or ap.reviewer_id = #{reviewerId} or at.create_by = #{createBy})

View File

@ -65,17 +65,16 @@
<update id="update" parameterType="com.bonus.ai.domain.dataset.DataSetEntity">
update ai_dataset
<set>
<if test="datasetName != null">dataset_name = #{datasetName},</if>
<if test="datasetDesc != null">description = #{datasetDesc},</if>
<if test="dataType != null">data_type = #{dataType},</if>
<if test="dataSource != null">data_source = #{dataSource},</if>
<if test="datasetName != null and datasetName != ''" >dataset_name = #{datasetName},</if>
<if test="datasetDesc != null and datasetDesc != ''">description = #{datasetDesc},</if>
<if test="dataType != null and dataType != ''">data_type = #{dataType},</if>
<if test="dataSource != null and dataSource != ''">data_source = #{dataSource},</if>
<if test="inputPath != null">input_path = #{inputPath},</if>
<if test="outputPath != null">output_path = #{outputPath},</if>
<if test="annotationStatus != null">annotation_status = #{annotationStatus},</if>
<if test="isPublic != null">is_public = #{isPublic},</if>
<if test="isAnnotated != null">is_annotated = #{isAnnotated},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="annotationStatus != null and annotationStatus != ''">annotation_status = #{annotationStatus},</if>
<if test="isPublic != null and isPublic != ''">is_public = #{isPublic},</if>
<if test="isAnnotated != null and isAnnotated != ''">is_annotated = #{isAnnotated},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
</set>
where dataset_id = #{datasetId}
</update>
@ -92,6 +91,7 @@
#{datasetId}
</foreach>
</delete>
<delete id="removeDataSetBasicFile">
delete from ai_dataset_file_map
where dataset_id = #{datasetId} AND file_id in
@ -140,19 +140,13 @@
order by create_time desc
</select>
<update id="updatePublicStatus">
update ai_dataset
set is_public = #{isPublic},
update_time = sysdate()
where dataset_id = #{datasetId}
</update>
<update id="updateAnnotationStatus">
update ai_dataset
set annotation_status = #{annotationStatus},
update_time = sysdate()
where dataset_id = #{datasetId}
</update>
<!-- <update id="updateAnnotationStatus">-->
<!-- update ai_dataset-->
<!-- set annotation_status = #{annotationStatus},-->
<!-- update_time = sysdate()-->
<!-- where dataset_id = #{datasetId}-->
<!-- </update>-->
<select id="checkDatasetNameUnique" parameterType="String" resultMap="DatasetResult">
select dataset_id, dataset_name
@ -160,9 +154,7 @@
where dataset_name = #{datasetName}
and del_flag = '0' limit 1
</select>
<select id="selectAllList" resultMap="DatasetResult">
</select>
<select id="getDataSetBasicFile" parameterType="com.bonus.ai.domain.DataSetBasicFileEntity" resultType="com.bonus.ai.domain.DataSetBasicFileEntity">
SELECT
adfm.file_id AS fileId,