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

View File

@ -157,7 +157,7 @@ public class DatasetController extends BaseController {
* @return 操作结果 * @return 操作结果
*/ */
@RequiresPermissions("dataCenter:dataSet:public") @RequiresPermissions("dataCenter:dataSet:public")
@PostMapping("/setPublic") @PostMapping("/set-public")
public AjaxResult setDatasetPublicStatus(@RequestParam String datasetId, @RequestParam String isPublic){ public AjaxResult setDatasetPublicStatus(@RequestParam String datasetId, @RequestParam String isPublic){
datasetService.setPublicStatus(datasetId, isPublic); datasetService.setPublicStatus(datasetId, isPublic);
return AjaxResult.success(); 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 @Override
public List<AnnotationTaskEntity> getAllTaskList() { public List<AnnotationTaskEntity> getAllTaskList(AnnotationTaskEntity taskEntity) {
try { try {
AnnotationTaskEntity taskEntity = new AnnotationTaskEntity();
String userId = SecurityUtils.getUserId().toString(); String userId = SecurityUtils.getUserId().toString();
taskEntity.setCreateBy(userId); taskEntity.setCreateBy(userId);
taskEntity.setAnnotatorId(userId); taskEntity.setAnnotatorId(userId);
@ -116,9 +115,8 @@ public class AnnotationTaskServiceImpl implements AnnotationTaskService {
} }
@Override @Override
public List<AnnotationTaskEntity> getMyCreationTaskList() { public List<AnnotationTaskEntity> getMyCreationTaskList(AnnotationTaskEntity taskEntity) {
try { try {
AnnotationTaskEntity taskEntity = new AnnotationTaskEntity();
String userId = SecurityUtils.getUserId().toString(); String userId = SecurityUtils.getUserId().toString();
taskEntity.setCreateBy(userId); taskEntity.setCreateBy(userId);
return annotationTaskMapper.selectMyAnnotationTaskList(taskEntity); return annotationTaskMapper.selectMyAnnotationTaskList(taskEntity);
@ -130,9 +128,8 @@ public class AnnotationTaskServiceImpl implements AnnotationTaskService {
/**根据类型获取标注任务列表*/ /**根据类型获取标注任务列表*/
@Override @Override
public List<AnnotationTaskEntity> getMyParticipantTaskList(){ public List<AnnotationTaskEntity> getMyParticipantTaskList(AnnotationTaskEntity taskEntity){
try { try {
AnnotationTaskEntity taskEntity = new AnnotationTaskEntity();
String userId = SecurityUtils.getUserId().toString(); String userId = SecurityUtils.getUserId().toString();
taskEntity.setAnnotatorId(userId); taskEntity.setAnnotatorId(userId);
taskEntity.setReviewerId(userId); taskEntity.setReviewerId(userId);

View File

@ -131,7 +131,15 @@ public class DatasetServiceImpl implements DatasetService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean setPublicStatus(String datasetId, String isPublic) { public boolean setPublicStatus(String datasetId, String isPublic) {
try { 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; return true;
} catch (Exception e) { } catch (Exception e) {
log.error("设置数据集公共状态失败", e); log.error("设置数据集公共状态失败", e);

View File

@ -33,13 +33,13 @@ public interface AnnotationTaskService {
// List<AnnotationTaskEntity> getTaskList(AnnotationTaskEntity task); // 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); boolean checkTaskNameUnique(AnnotationTaskEntity task);

View File

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