提交代码
This commit is contained in:
parent
ec8c285f3b
commit
2f00203f58
|
|
@ -1,85 +0,0 @@
|
|||
package com.bonus.ai.controller;
|
||||
|
||||
import com.bonus.ai.domain.AiDataSet;
|
||||
import com.bonus.ai.domain.AnnotationFile;
|
||||
import com.bonus.ai.domain.AnnotationTask;
|
||||
import com.bonus.ai.domain.ReleaseVersion;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/task")
|
||||
public class AnnotationTaskController {
|
||||
|
||||
/**
|
||||
* 查看由我创建的任务列表和我参与的或全部任务列表
|
||||
* 统一获取文件列表
|
||||
* @param type 参数类型:myCreated - 由我创建的任务列表, myParticipated - 由我参与的任务列表, all - 用户创建和公共文件
|
||||
* @return 返回满足条件的任务列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(@RequestParam String type) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务编号获取任务详情,如果是标注人员获取分配的文件列表,如果是审核人员获取所有分配的文件列表,如果是管理员获取所有文件列表
|
||||
* @param taskId 任务编号
|
||||
* @return 返回任务详情
|
||||
*/
|
||||
@GetMapping(value = "/{taskId}")
|
||||
public AjaxResult getInfo(@PathVariable Long taskId) {
|
||||
return AjaxResult.success(new AnnotationTask());
|
||||
}
|
||||
|
||||
|
||||
/**标注或审核
|
||||
* @param subTask 标注文件的信息
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@PostMapping("/annotate")
|
||||
public AjaxResult release(@Validated @RequestBody AnnotationFile subTask) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**发布任务
|
||||
* @param version 发布任务的版本信息
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@PostMapping("/release")
|
||||
public AjaxResult release(@Validated @RequestBody ReleaseVersion version) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**创建标注任务
|
||||
* @param task 新增的数据集信息
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody AnnotationTask task) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**修改任务
|
||||
* @param task 修改的任务
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody AnnotationTask task) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除的任务
|
||||
* @param taskId 修改的任务
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@DeleteMapping("/{taskId}")
|
||||
public AjaxResult remove(@PathVariable Long taskId) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
package com.bonus.ai.controller;
|
||||
|
||||
import com.bonus.ai.domain.AiDataSet;
|
||||
import com.bonus.ai.domain.AnnotationTeam;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 标注人员管理控制层
|
||||
* @author wangvivi
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/team")
|
||||
@Slf4j
|
||||
public class AnnotationTeamController {
|
||||
|
||||
/**
|
||||
* 获取所有标注人员和审核人员
|
||||
* @return 返回满足条件的数据集列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list() {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**新增标注人员或审核人员
|
||||
* @param team 新增的人员id和角色信息
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody AnnotationTeam team) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**修改标注人员或审核人员
|
||||
* @param team 修改的数据信息
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody AnnotationTeam team) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除的team标注人员或审核人员
|
||||
* @param team 删除的信息
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@DeleteMapping
|
||||
public AjaxResult remove(@Validated @RequestBody AnnotationTeam team) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,117 +0,0 @@
|
|||
package com.bonus.ai.controller;
|
||||
|
||||
import com.bonus.ai.domain.AiDataSet;
|
||||
import com.bonus.ai.domain.BasicFile;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 基础文件管理控制层,获取指定存储方式的文件列表等
|
||||
* @author wangvivi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/basicfile")
|
||||
@Slf4j
|
||||
public class BasicFileController {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 统一获取文件列表
|
||||
* @param type 参数类型:my - 当前用户创建的文件, public - 公共文件, all - 用户创建和公共文件
|
||||
* @return 符合条件的文件列表
|
||||
*/
|
||||
@GetMapping("/list/")
|
||||
public AjaxResult getFilesList(@RequestParam String type) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
/**
|
||||
* 统一获取文件列表树
|
||||
* @param type 文件类型:my - 当前用户创建的文件, public - 公共文件, all - 用户创建和公共文件
|
||||
* @return 返回所有的文件树
|
||||
*/
|
||||
@GetMapping("/tree/")
|
||||
public AjaxResult tree(@RequestParam String type) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件编号获取文件详情
|
||||
* @param fileId 文件编号
|
||||
* @return 返回文件详情
|
||||
*/
|
||||
@GetMapping(value = "/{fileId}")
|
||||
public AjaxResult getInfo(@PathVariable Long fileId) {
|
||||
return AjaxResult.success(new BasicFile());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置或取消文件的公共状态,如果是文件夹则同时设置整个文件夹里所有文件夹的属性
|
||||
* @param fileId 文件的ID
|
||||
* @param isPublic 是否设置为公共文件:true - 设置为公共文件, false - 取消公共状态
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/set-public")
|
||||
public AjaxResult setFilePublicStatus(@RequestParam Long fileId, @RequestParam Boolean isPublic){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建文件夹
|
||||
* @param folderName 单个文件
|
||||
* @return 文件夹网络路径
|
||||
*/
|
||||
@PostMapping("/createFolder")
|
||||
public AjaxResult createFolder(@RequestParam("folderName") String folderName)
|
||||
{
|
||||
return AjaxResult.success("创建文件夹");
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件夹删除
|
||||
* 从各个存储平台删除文件
|
||||
* @param folderName 文件夹名,默认为根目录
|
||||
* @return 文件夹网络路径
|
||||
*/
|
||||
@DeleteMapping("/deleteFolder")
|
||||
public AjaxResult deleteFolder(@RequestParam("folderName") String folderName) {
|
||||
return AjaxResult.success("文件夹删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 单文件上传到指定文件夹
|
||||
* @param file 单个文件
|
||||
* @return 文件信息,包括文件名和文件路径
|
||||
*/
|
||||
@PostMapping("upload")
|
||||
public AjaxResult upload(MultipartFile file, String folderName){
|
||||
return AjaxResult.success("文件上传成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 多文件上传到指定文件夹
|
||||
* @param files 多个文件流
|
||||
* @return 文件信息
|
||||
*/
|
||||
@PostMapping("/uploadFiles")
|
||||
public AjaxResult uploadFile(MultipartFile[] files, String folderName) {
|
||||
return AjaxResult.success("文件上传成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 多文件下载
|
||||
* @param response 请求响应,按照文件目录结构打包下载,如果是文件夹则打包下载文件夹下的所有文件
|
||||
* @param objectKeys,除mongodb 存fileid之外,其他均存上传文件的网络路径
|
||||
*/
|
||||
@GetMapping("/downloadFiles")
|
||||
public void downloadFile(HttpServletResponse response, @RequestParam List<Long> objectKeys) throws IOException {}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
package com.bonus.ai.controller;
|
||||
|
||||
import com.bonus.ai.domain.DataSetSampleEntity;
|
||||
import com.bonus.ai.service.DataSetSampleService;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Controller
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2024-11-01
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sample")
|
||||
public class DataSetSampleController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private DataSetSampleService sampleService;
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@RequiresPermissions("dataCenter:sample:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DataSetSampleEntity entity)
|
||||
{
|
||||
try {
|
||||
startPage();
|
||||
List<DataSetSampleEntity> list = sampleService.selectSampleList(entity);
|
||||
return getDataTable(list);
|
||||
}catch (Exception e) {
|
||||
return getDataTable(new ArrayList<>());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出列表
|
||||
*/
|
||||
@RequiresPermissions("dataCenter:sample:export")
|
||||
@PostMapping("/export")
|
||||
@SysLog(title = "样本类型管理", businessType = OperaType.EXPORT,logType = 0,module = "样本类型管理",details = "导出列表")
|
||||
public void export(HttpServletResponse response, DataSetSampleEntity entity)
|
||||
{
|
||||
List<DataSetSampleEntity> list = sampleService.selectSampleList(entity);
|
||||
ExcelUtil<DataSetSampleEntity> util = new ExcelUtil<DataSetSampleEntity>(DataSetSampleEntity.class);
|
||||
util.exportExcel(response, list, "样本类型管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详细信息
|
||||
*/
|
||||
@RequiresPermissions("dataCenter:sample:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return sampleService.selectSampleById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@RequiresPermissions("dataCenter:sample:add")
|
||||
@PostMapping
|
||||
@SysLog(title = "样本类型管理", businessType = OperaType.INSERT,logType = 0,module = "样本类型管理",details = "新增数据")
|
||||
public AjaxResult add(@RequestBody DataSetSampleEntity entity)
|
||||
{
|
||||
return sampleService.insertSample(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequiresPermissions("dataCenter:sample:edit")
|
||||
@PutMapping
|
||||
@SysLog(title = "样本类型管理", businessType = OperaType.UPDATE,logType = 0,module = "样本类型管理",details = "修改数据")
|
||||
public AjaxResult edit(@RequestBody DataSetSampleEntity entity)
|
||||
{
|
||||
return sampleService.updateSample(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequiresPermissions("dataCenter:sample:remove")
|
||||
@DeleteMapping("/{ids}")
|
||||
@SysLog(title = "样本类型管理", businessType = OperaType.DELETE,logType = 0,module = "样本类型管理",details = "删除数据")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return sampleService.deleteSampleByIds(ids);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
package com.bonus.ai.controller;
|
||||
|
||||
import com.bonus.ai.domain.DataSetTeamMemberEntity;
|
||||
import com.bonus.ai.service.DataSetTeamMemberService;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/teamMember")
|
||||
public class DataSetTeamMemberController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private DataSetTeamMemberService dataSetTeamMemberService;
|
||||
|
||||
/**
|
||||
* 查询标注人员列表
|
||||
*/
|
||||
@RequiresPermissions("dataCenter:member:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DataSetTeamMemberEntity entity)
|
||||
{
|
||||
try {
|
||||
startPage();
|
||||
List<DataSetTeamMemberEntity> list = dataSetTeamMemberService.selectTeamMemberList(entity);
|
||||
return getDataTable(list);
|
||||
}catch (Exception e){
|
||||
return getDataTable(new ArrayList<>());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出标注人员列表
|
||||
*/
|
||||
@RequiresPermissions("dataCenter:member:export")
|
||||
@PostMapping("/export")
|
||||
@SysLog(title = "标注人员管理", businessType = OperaType.EXPORT,logType = 0,module = "标注人员",details = "导出标注人员列表")
|
||||
public void export(HttpServletResponse response, DataSetTeamMemberEntity entity)
|
||||
{
|
||||
List<DataSetTeamMemberEntity> list = dataSetTeamMemberService.selectTeamMemberList(entity);
|
||||
ExcelUtil<DataSetTeamMemberEntity> util = new ExcelUtil<DataSetTeamMemberEntity>(DataSetTeamMemberEntity.class);
|
||||
util.exportExcel(response, list, "标注人员数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取标注人员详细信息
|
||||
*/
|
||||
@RequiresPermissions("dataCenter:member:query")
|
||||
@GetMapping(value = "/{memberId}")
|
||||
public AjaxResult getInfo(@PathVariable("memberId") Long memberId)
|
||||
{
|
||||
return dataSetTeamMemberService.selectTeamMemberByMemberId(memberId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增标注人员
|
||||
*/
|
||||
@RequiresPermissions("dataCenter:member:add")
|
||||
@PostMapping
|
||||
@SysLog(title = "标注人员管理", businessType = OperaType.INSERT,logType = 0,module = "标注人员",details = "插入标注人员列表")
|
||||
public AjaxResult add(@RequestBody DataSetTeamMemberEntity entity)
|
||||
{
|
||||
return dataSetTeamMemberService.insertTeamMember(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改标注人员
|
||||
*/
|
||||
@RequiresPermissions("dataCenter:member:edit")
|
||||
@PutMapping
|
||||
@SysLog(title = "标注人员管理", businessType = OperaType.UPDATE,logType = 0,module = "标注人员",details = "导出标注人员列表")
|
||||
public AjaxResult edit(@RequestBody DataSetTeamMemberEntity entity)
|
||||
{
|
||||
return dataSetTeamMemberService.updateTeamMember(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除标注人员
|
||||
*/
|
||||
@RequiresPermissions("dataCenter:member:remove")
|
||||
@DeleteMapping("/{memberIds}")
|
||||
@SysLog(title = "标注人员管理", businessType = OperaType.DELETE,logType = 0,module = "标注人员",details = "删除标注人员列表")
|
||||
public AjaxResult remove(@PathVariable Long[] memberIds)
|
||||
{
|
||||
return dataSetTeamMemberService.deleteTeamMemberByMemberIds(memberIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门树
|
||||
* @return 树
|
||||
*/
|
||||
@PostMapping("/buildDeptTreeWithUsers")
|
||||
@SysLog(title = "标注人员管理", businessType = OperaType.DELETE,logType = 0,module = "标注人员",details = "删除标注人员列表")
|
||||
public AjaxResult buildDeptTreeWithUsers(){
|
||||
return dataSetTeamMemberService.buildDeptTreeWithUsers();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
package com.bonus.ai.controller;
|
||||
|
||||
import com.bonus.ai.domain.AiDataSet;
|
||||
import com.bonus.ai.domain.ReleaseVersion;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 数据集管理控制层,标注任务创建等
|
||||
* @author wangvivi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dataset")
|
||||
@Slf4j
|
||||
public class DatasetController {
|
||||
/**
|
||||
* 查看由我创建的数据集和公共数据集
|
||||
* 统一获取文件列表
|
||||
* @param type 参数类型:my - 当前用户创建的文件, public - 公共文件, all - 用户创建和公共文件
|
||||
* @return 返回满足条件的数据集列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(@RequestParam String type) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据数据集编号获取数据集详情
|
||||
* @param datasetId 数据集编号
|
||||
* @return 返回数据集详情
|
||||
*/
|
||||
@GetMapping(value = "/{datasetId}")
|
||||
public AjaxResult getInfo(@PathVariable Long datasetId) {
|
||||
return AjaxResult.success(new AiDataSet());
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置或取消数据集的公共状态
|
||||
* @param datasetId 数据集的ID
|
||||
* @param isPublic 是否设置为公共文件:true - 设置为公共文件, false - 取消公共状态
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/set-public")
|
||||
public AjaxResult setDatasetPublicStatus(@RequestParam Long datasetId, @RequestParam Boolean isPublic){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**发布数据集
|
||||
* @param version 发布数据集的版本信息
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@PostMapping("/release")
|
||||
public AjaxResult release(@Validated @RequestBody ReleaseVersion version) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**导出发布版本的数据集
|
||||
* @param versionId 发布数据集的版本id
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@GetMapping(value = "/export/{versionId}")
|
||||
public AjaxResult export(@PathVariable Long versionId) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**新增数据集
|
||||
* @param dataSet 新增的数据集信息,并且建立和文件的关联关系
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody AiDataSet dataSet) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**修改数据集
|
||||
* @param dataSet 修改的数据集信息
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody AiDataSet dataSet) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除的数据集
|
||||
* @param dataSetId 修改的数据集信息
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@DeleteMapping("/{dataSetId}")
|
||||
public AjaxResult remove(@PathVariable Long dataSetId) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
package com.bonus.ai.controller;
|
||||
|
||||
import com.bonus.ai.domain.AiDataSet;
|
||||
import com.bonus.ai.domain.Label;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 标签管理控制层
|
||||
* @author wangvivi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/label")
|
||||
@Slf4j
|
||||
public class LabelController {
|
||||
/**
|
||||
* 获取所有标签列表
|
||||
* @return 返回所有的标签
|
||||
*/
|
||||
@GetMapping("/list/")
|
||||
public AjaxResult list() {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有标签列表树
|
||||
* @return 返回所有的标签树
|
||||
*/
|
||||
@GetMapping("/tree")
|
||||
public AjaxResult tree() {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据标签编号获取标签详情
|
||||
* @param labelId 标签编号
|
||||
* @return 返回标签详情
|
||||
*/
|
||||
@GetMapping(value = "/{labelId}")
|
||||
public AjaxResult getInfo(@PathVariable Long labelId) {
|
||||
return AjaxResult.success(new Label());
|
||||
}
|
||||
|
||||
/**新增标签
|
||||
* @param label 新增的标签信息
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody Label label) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**修改标签
|
||||
* @param label 修改的标签信息
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody Label label) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除的标签
|
||||
* @param labelId 修改的标签信息
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@DeleteMapping("/{labelId}")
|
||||
public AjaxResult remove(@PathVariable Long labelId) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,116 +0,0 @@
|
|||
package com.bonus.ai.domain;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据集类
|
||||
* @author wangvivi
|
||||
*/
|
||||
public class AiDataSet extends BaseEntity {
|
||||
|
||||
/**数据集ID*/
|
||||
private Long datasetId;
|
||||
/**数据集UUID*/
|
||||
private String datasetUuid;
|
||||
/**数据集名称*/
|
||||
private String datasetName;
|
||||
/**数据集描述*/
|
||||
private String datasetDesc;
|
||||
/** 数据类型:0图片,1视频 ,2音频,3自由格式*/
|
||||
private String dataType;
|
||||
private String inputPath;
|
||||
private String outputPath;
|
||||
|
||||
/** 是否公开(0代表未标注 1代表已标注)*/
|
||||
private String annotationStatus;
|
||||
|
||||
/** 是否公开(0代表不公开 1代表公开)*/
|
||||
private String isPublic;
|
||||
/**删除标志(0代表存在 1代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
private List<BasicFile> files;
|
||||
|
||||
public Long getDatasetId() {
|
||||
return datasetId;
|
||||
}
|
||||
|
||||
public void setDatasetId(Long datasetId) {
|
||||
this.datasetId = datasetId;
|
||||
}
|
||||
|
||||
public String getDatasetName() {
|
||||
return datasetName;
|
||||
}
|
||||
|
||||
public void setDatasetName(String datasetName) {
|
||||
this.datasetName = datasetName;
|
||||
}
|
||||
|
||||
public String getDatasetDesc() {
|
||||
return datasetDesc;
|
||||
}
|
||||
|
||||
public void setDatasetDesc(String datasetDesc) {
|
||||
this.datasetDesc = datasetDesc;
|
||||
}
|
||||
|
||||
public String getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public void setDataType(String dataType) {
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public String getInputPath() {
|
||||
return inputPath;
|
||||
}
|
||||
|
||||
public void setInputPath(String inputPath) {
|
||||
this.inputPath = inputPath;
|
||||
}
|
||||
|
||||
public String getOutputPath() {
|
||||
return outputPath;
|
||||
}
|
||||
|
||||
public void setOutputPath(String outputPath) {
|
||||
this.outputPath = outputPath;
|
||||
}
|
||||
|
||||
public String getIsPublic() {
|
||||
return isPublic;
|
||||
}
|
||||
|
||||
public void setIsPublic(String isPublic) {
|
||||
this.isPublic = isPublic;
|
||||
}
|
||||
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public List<BasicFile> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<BasicFile> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
public String getAnnotationStatus() {
|
||||
return annotationStatus;
|
||||
}
|
||||
|
||||
public void setAnnotationStatus(String annotationStatus) {
|
||||
this.annotationStatus = annotationStatus;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
package com.bonus.ai.domain;
|
||||
|
||||
import com.bonus.ai.domain.enums.AnnotationFileStatus;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class AnnotationFile {
|
||||
AnnotationFile(Long taskId, Long datasetId, Long annotatorId, Long reviewerId, Long fileId){
|
||||
this.taskId = taskId;
|
||||
this.datasetId = datasetId;
|
||||
this.annotatorId = annotatorId;
|
||||
this.reviewerId = reviewerId;
|
||||
this.fileId = fileId;
|
||||
}
|
||||
/**任务名称*/
|
||||
private Long taskId;
|
||||
/**数据集id*/
|
||||
private Long datasetId;
|
||||
/**标注人员id*/
|
||||
private Long annotatorId;
|
||||
/**审核人员id*/
|
||||
private Long reviewerId;
|
||||
/**文件id*/
|
||||
private Long fileId;
|
||||
|
||||
/**文件标注状态*/
|
||||
private AnnotationFileStatus annotateFileStatus;
|
||||
/**标注结果*/
|
||||
private String annotationResult;
|
||||
/**标注来源,0人工标注,1智能标注*/
|
||||
private String annotationSource;
|
||||
|
||||
/**审核驳回原因*/
|
||||
private String auditFailedReason;
|
||||
|
||||
/**标注时间*/
|
||||
private java.util.Date annotationTime;
|
||||
/**审核时间*/
|
||||
private java.util.Date reviewTime;;
|
||||
|
||||
public AnnotationFileStatus getAnnotateFileStatus() {
|
||||
return annotateFileStatus;
|
||||
}
|
||||
|
||||
public void setAnnotateFileStatus(AnnotationFileStatus annotateFileStatus) {
|
||||
this.annotateFileStatus = annotateFileStatus;
|
||||
}
|
||||
|
||||
public String getAnnotationResult() {
|
||||
return annotationResult;
|
||||
}
|
||||
|
||||
public void setAnnotationResult(String annotationResult) {
|
||||
this.annotationResult = annotationResult;
|
||||
}
|
||||
|
||||
public String getAnnotationSource() {
|
||||
return annotationSource;
|
||||
}
|
||||
|
||||
public void setAnnotationSource(String annotationSource) {
|
||||
this.annotationSource = annotationSource;
|
||||
}
|
||||
|
||||
public Date getAnnotationTime() {
|
||||
return annotationTime;
|
||||
}
|
||||
|
||||
public void setAnnotationTime(Date annotationTime) {
|
||||
this.annotationTime = annotationTime;
|
||||
}
|
||||
|
||||
public Date getReviewTime() {
|
||||
return reviewTime;
|
||||
}
|
||||
|
||||
public void setReviewTime(Date reviewTime) {
|
||||
this.reviewTime = reviewTime;
|
||||
}
|
||||
|
||||
public Long getAnnotatorId() {
|
||||
return annotatorId;
|
||||
}
|
||||
|
||||
public void setAnnotatorId(Long annotatorId) {
|
||||
this.annotatorId = annotatorId;
|
||||
}
|
||||
|
||||
public Long getReviewerId() {
|
||||
return reviewerId;
|
||||
}
|
||||
|
||||
public void setReviewerId(Long reviewerId) {
|
||||
this.reviewerId = reviewerId;
|
||||
}
|
||||
|
||||
public Long getFileId() {
|
||||
return fileId;
|
||||
}
|
||||
|
||||
public void setFileId(Long fileId) {
|
||||
this.fileId = fileId;
|
||||
}
|
||||
|
||||
public Long getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public void setTaskId(Long taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public Long getDatasetId() {
|
||||
return datasetId;
|
||||
}
|
||||
|
||||
public void setDatasetId(Long datasetId) {
|
||||
this.datasetId = datasetId;
|
||||
}
|
||||
|
||||
public String getAuditFailedReason() {
|
||||
return auditFailedReason;
|
||||
}
|
||||
|
||||
public void setAuditFailedReason(String auditFailedReason) {
|
||||
this.auditFailedReason = auditFailedReason;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,213 +0,0 @@
|
|||
package com.bonus.ai.domain;
|
||||
|
||||
import com.bonus.ai.domain.enums.AnnotationFileStatus;
|
||||
import com.bonus.ai.domain.enums.AnnotationTaskStatus;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AnnotationTask extends BaseEntity {
|
||||
|
||||
/**任务名称*/
|
||||
private Long taskId;
|
||||
/**数据集id*/
|
||||
private Long datasetId;
|
||||
/**任务uuid*/
|
||||
private String taskUuid ;
|
||||
/**标注团队id,为0表示未启用标注团队,否则启用标注团队的关联id*/
|
||||
private Long annotationTeamId;
|
||||
/**任务名称*/
|
||||
private String taskName;
|
||||
/**任务描述*/
|
||||
private String taskDesc;
|
||||
/**标注场景 数据类型:0图片,1视频 ,2音频,3自由格式*/
|
||||
private String annotateScene;
|
||||
/**标注类型:图像分类,物体检测等*/
|
||||
private String annotateType;
|
||||
/**标签集合,标签之间用逗号分隔*/
|
||||
private String labels;
|
||||
|
||||
AnnotationTaskStatus annotateTaskStatus;
|
||||
|
||||
/**删除标志(0代表存在 1代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/**分配前标注人员列表和每人分配的文件数*/
|
||||
private Map<Long, Integer> annotators;
|
||||
|
||||
/**分配前审核人员列表和每人分配的文件数*/
|
||||
private Map<Long, Integer> reviewers;
|
||||
/**分配后子任务*/
|
||||
private List<AnnotationFile> subAnnotationTasks;
|
||||
|
||||
public AnnotationTaskStatus getAnnotationTaskStatus() {
|
||||
return annotateTaskStatus;
|
||||
}
|
||||
|
||||
public void setAnnotationTaskStatus(AnnotationTaskStatus annotateTaskStatus) {
|
||||
this.annotateTaskStatus = annotateTaskStatus;
|
||||
}
|
||||
|
||||
public List<AnnotationFile> getSubAnnotationTasks() {
|
||||
return subAnnotationTasks;
|
||||
}
|
||||
|
||||
public void setSubAnnotationTasks(List<AnnotationFile> subAnnotationTasks) {
|
||||
this.subAnnotationTasks = subAnnotationTasks;
|
||||
}
|
||||
|
||||
|
||||
public Long getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public void setTaskId(Long taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public Long getDatasetId() {
|
||||
return datasetId;
|
||||
}
|
||||
|
||||
public void setDatasetId(Long datasetId) {
|
||||
this.datasetId = datasetId;
|
||||
}
|
||||
|
||||
public Long getAnnotationTeamId() {
|
||||
return annotationTeamId;
|
||||
}
|
||||
|
||||
public void setAnnotationTeamId(Long annotationTeamId) {
|
||||
this.annotationTeamId = annotationTeamId;
|
||||
}
|
||||
|
||||
public String getTaskName() {
|
||||
return taskName;
|
||||
}
|
||||
|
||||
public void setTaskName(String taskName) {
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
public String getTaskDesc() {
|
||||
return taskDesc;
|
||||
}
|
||||
|
||||
public void setTaskDesc(String taskDesc) {
|
||||
this.taskDesc = taskDesc;
|
||||
}
|
||||
|
||||
public String getAnnotateScene() {
|
||||
return annotateScene;
|
||||
}
|
||||
|
||||
public void setAnnotateScene(String annotateScene) {
|
||||
this.annotateScene = annotateScene;
|
||||
}
|
||||
|
||||
public String getAnnotateType() {
|
||||
return annotateType;
|
||||
}
|
||||
|
||||
public void setAnnotateType(String annotateType) {
|
||||
this.annotateType = annotateType;
|
||||
}
|
||||
|
||||
public String getLabels() {
|
||||
return labels;
|
||||
}
|
||||
|
||||
public void setLabels(String labels) {
|
||||
this.labels = labels;
|
||||
}
|
||||
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
// /**自动分配任务*/
|
||||
// public void assignFilesToSubTasks(List<Long> fileIds){
|
||||
// int annotatorSize = annotators.size();
|
||||
// int reviewerSize = reviewers.size();
|
||||
//
|
||||
// for (int i = 0; i < fileIds.size(); i++) {
|
||||
// Long fileId = fileIds.get(i);
|
||||
//
|
||||
// // 通过轮询分配标注人和审核人
|
||||
// Long annotatorId = annotators.get(i % annotatorSize);
|
||||
// Long reviewerId = reviewers.get(i % reviewerSize);
|
||||
//
|
||||
// // 创建子任务
|
||||
// AnnotationFile subTask = new AnnotationFile(taskId,datasetId, annotatorId, reviewerId, fileId);
|
||||
// subAnnotationTasks.add(subTask);
|
||||
// }
|
||||
// }
|
||||
|
||||
public void assignFilesToSubTasks(List<Long> fileIds){
|
||||
int annotatorSize = annotators.size();
|
||||
int reviewerSize = reviewers.size();
|
||||
|
||||
for (int i = 0; i < fileIds.size(); i++) {
|
||||
Long fileId = fileIds.get(i);
|
||||
|
||||
// 通过轮询分配标注人和审核人
|
||||
Long annotatorId = Long.valueOf(annotators.get(i % annotatorSize));
|
||||
Long reviewerId = Long.valueOf(reviewers.get(i % reviewerSize));
|
||||
|
||||
// 创建子任务
|
||||
AnnotationFile subTask = new AnnotationFile(taskId,datasetId, annotatorId, reviewerId, fileId);
|
||||
subAnnotationTasks.add(subTask);
|
||||
}
|
||||
}
|
||||
|
||||
/**添加标注人*/
|
||||
public void addAnnotator(Long userId, Integer fileCount){
|
||||
annotators.put(userId, fileCount);
|
||||
}
|
||||
|
||||
/**添加审核人*/
|
||||
public void addReviewer(Long userId, Integer fileCount){
|
||||
reviewers.put(userId, fileCount);
|
||||
}
|
||||
|
||||
/**删除标注人*/
|
||||
public void removeAnnotator(Long userId){
|
||||
annotators.remove(userId);
|
||||
}
|
||||
|
||||
/**删除审核人*/
|
||||
public void removeReviewer(Long userId){
|
||||
reviewers.remove(userId);
|
||||
}
|
||||
|
||||
public String getTaskUuid() {
|
||||
return taskUuid;
|
||||
}
|
||||
|
||||
public void setTaskUuid(String taskUuid) {
|
||||
this.taskUuid = taskUuid;
|
||||
}
|
||||
|
||||
public void setAnnotators(Map<Long, Integer> annotators) {
|
||||
this.annotators = annotators;
|
||||
}
|
||||
|
||||
public Map<Long, Integer> getAnnotators() {
|
||||
return this.annotators;
|
||||
}
|
||||
|
||||
public void setReviewers(Map<Long, Integer> reviewers) {
|
||||
this.reviewers = reviewers;
|
||||
}
|
||||
|
||||
|
||||
public Map<Long, Integer> getReviewers() {
|
||||
return this.reviewers;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package com.bonus.ai.domain;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangvivi
|
||||
*/
|
||||
public class AnnotationTeam extends BaseEntity{
|
||||
|
||||
private Long userId;
|
||||
/**0标注,1审核*/
|
||||
private String roleId;
|
||||
}
|
||||
|
|
@ -1,112 +0,0 @@
|
|||
package com.bonus.ai.domain;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class BasicFile extends BaseEntity {
|
||||
private Long fileId;
|
||||
private String fileName;
|
||||
private String filePath;
|
||||
private Long fileSize;
|
||||
/**文件最后修改时间*/
|
||||
private java.util.Date lastModifyTime;
|
||||
/**上传时间*/
|
||||
private java.util.Date uploadTime;;
|
||||
/** 是否公开(0代表不公开 1代表公开)*/
|
||||
private String isPublic;
|
||||
|
||||
/**文件的标签集合 */
|
||||
private List <String> labels;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 父节点名称 */
|
||||
private String parentName;
|
||||
|
||||
/** 子部门 */
|
||||
private List<BasicFile> children = new ArrayList<BasicFile>();
|
||||
|
||||
public Long getFileId() {
|
||||
return fileId;
|
||||
}
|
||||
|
||||
public void setFileId(Long fileId) {
|
||||
this.fileId = fileId;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
public Long getFileSize() {
|
||||
return fileSize;
|
||||
}
|
||||
|
||||
public void setFileSize(Long fileSize) {
|
||||
this.fileSize = fileSize;
|
||||
}
|
||||
|
||||
public Date getLastModifyTime() {
|
||||
return lastModifyTime;
|
||||
}
|
||||
|
||||
public void setLastModifyTime(Date lastModifyTime) {
|
||||
this.lastModifyTime = lastModifyTime;
|
||||
}
|
||||
|
||||
public Date getUploadTime() {
|
||||
return uploadTime;
|
||||
}
|
||||
|
||||
public void setUploadTime(Date uploadTime) {
|
||||
this.uploadTime = uploadTime;
|
||||
}
|
||||
|
||||
public String getIsPublic() {
|
||||
return isPublic;
|
||||
}
|
||||
|
||||
public void setIsPublic(String isPublic) {
|
||||
this.isPublic = isPublic;
|
||||
}
|
||||
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getParentName() {
|
||||
return parentName;
|
||||
}
|
||||
|
||||
public void setParentName(String parentName) {
|
||||
this.parentName = parentName;
|
||||
}
|
||||
|
||||
public List<BasicFile> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<BasicFile> children) {
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.bonus.ai.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class DataSetSampleEntity extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 样本类型名称 */
|
||||
@Excel(name = "样本类型名称")
|
||||
private String sampleName;
|
||||
|
||||
/** 样本格式 */
|
||||
@Excel(name = "样本格式")
|
||||
private String sampleFormat;
|
||||
|
||||
/** 是否删除(0代表存在,1代表删除) */
|
||||
private String delFlag;
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.bonus.ai.domain;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class DataSetTeamMemberEntity extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 成员id */
|
||||
private Long memberId;
|
||||
|
||||
/** 角色标志(0 标注,1审核,2管理) */
|
||||
private String roleId;
|
||||
|
||||
/** 是否删除(0代表存在,1代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
private String[] selectedData;
|
||||
|
||||
private String userName;
|
||||
|
||||
private String sex;
|
||||
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
package com.bonus.ai.domain;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 标签类
|
||||
* @author wangvivi
|
||||
*/
|
||||
public class Label extends BaseEntity {
|
||||
private Long labelId;
|
||||
private String labelName;
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 父节点名称 */
|
||||
private String parentName;
|
||||
|
||||
/** 子部门 */
|
||||
private List<Label> children = new ArrayList<Label>();
|
||||
|
||||
public Long getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public void setLabelId(Long labelId) {
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public String getLabelName() {
|
||||
return labelName;
|
||||
}
|
||||
|
||||
public void setLabelName(String labelName) {
|
||||
this.labelName = labelName;
|
||||
}
|
||||
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getParentName() {
|
||||
return parentName;
|
||||
}
|
||||
|
||||
public void setParentName(String parentName) {
|
||||
this.parentName = parentName;
|
||||
}
|
||||
|
||||
public List<Label> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<Label> children) {
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
package com.bonus.ai.domain;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 版本类
|
||||
* @author wangvivi
|
||||
*/
|
||||
public class ReleaseVersion extends BaseEntity {
|
||||
/**版本ID*/
|
||||
private Long versionId;
|
||||
/**版本名称*/
|
||||
private String versionName;
|
||||
/**版本描述*/
|
||||
private String versionDesc;
|
||||
/**版本关联的数据集id*/
|
||||
private Long datasetId;
|
||||
/**版本关联的任务id*/
|
||||
private Long taskId;
|
||||
|
||||
/**版本关联的文件标注结果和原始文件信息*/
|
||||
private List<AnnotationResult> fileAnnotationResultList;
|
||||
|
||||
public Long getVersionId() {
|
||||
return versionId;
|
||||
}
|
||||
|
||||
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*/
|
||||
private Long fileId;
|
||||
/**标注结果*/
|
||||
private String annotationResult;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.bonus.ai.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
*/
|
||||
@Data
|
||||
public class TreeNode {
|
||||
public Long id;
|
||||
public String label;
|
||||
public Long parentId;
|
||||
public String type;
|
||||
public List<TreeNode> children = new ArrayList<TreeNode>();
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.bonus.ai.domain.builder;
|
||||
|
||||
import com.bonus.ai.domain.TreeNode;
|
||||
import com.bonus.system.api.domain.SysDept;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
*/
|
||||
public class DeptTreeBuilder {
|
||||
/**
|
||||
* 构建包含用户信息的部门树
|
||||
* @param depts 部门列表
|
||||
* @param users 用户列表
|
||||
* @return 树的根节点
|
||||
*/
|
||||
public static TreeNode buildDeptTreeWithUsers(List<SysDept> depts, List<SysUser> users) {
|
||||
Map<Long, TreeNode> treeNodeMap = new HashMap<>();
|
||||
TreeNode rootNode = new TreeNode();
|
||||
for (SysDept dept : depts) {
|
||||
TreeNode treeNode = new TreeNode();
|
||||
treeNode.setId(dept.getDeptId());
|
||||
treeNode.setParentId(dept.getParentId());
|
||||
treeNode.setLabel(dept.getDeptName());
|
||||
treeNode.setType("dept");
|
||||
treeNodeMap.put(dept.getDeptId(), treeNode);
|
||||
}
|
||||
// 遍历用户列表,将每个用户分配到相应的部门
|
||||
for (SysUser user : users) {
|
||||
TreeNode dept = treeNodeMap.get(user.getDeptId());
|
||||
if (dept != null) {
|
||||
// 将用户添加到对应部门的用户列表
|
||||
TreeNode treeNode = new TreeNode();
|
||||
treeNode.setId(user.getUserId());
|
||||
treeNode.setParentId(user.getDeptId());
|
||||
treeNode.setLabel(user.getNickName());
|
||||
treeNode.setType("user");
|
||||
dept.children.add(treeNode);
|
||||
}
|
||||
}
|
||||
|
||||
// 遍历所有部门,组织树形结构
|
||||
for (Map.Entry<Long, TreeNode> entry : treeNodeMap.entrySet()) {
|
||||
TreeNode dept = entry.getValue();
|
||||
if (dept.getParentId() == 0) {
|
||||
rootNode.children.add(dept);
|
||||
}else {
|
||||
// 否则,将当前部门加入到其父部门的 children 列表中
|
||||
TreeNode parent = treeNodeMap.get(entry.getValue().getParentId());
|
||||
if (parent != null) {
|
||||
parent.children.add(dept);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// 返回构建完成的部门树根节点
|
||||
return rootNode;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.bonus.ai.mapper;
|
||||
|
||||
import com.bonus.ai.domain.DataSetSampleEntity;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
*/
|
||||
|
||||
public interface DataSetSampleMapper {
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实体
|
||||
*/
|
||||
public DataSetSampleEntity selectSampleById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 集合
|
||||
*/
|
||||
public List<DataSetSampleEntity> selectSampleList(DataSetSampleEntity entity);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSample(DataSetSampleEntity entity);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSample(DataSetSampleEntity entity);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSampleByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 查询格式唯一
|
||||
* @param id 主键
|
||||
* @param format 格式
|
||||
* @return 条数
|
||||
*/
|
||||
public int selectSampleByFormat(@Param("id") Long id,@Param("format") String format);
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.bonus.ai.mapper;
|
||||
|
||||
import com.bonus.ai.domain.DataSetTeamMemberEntity;
|
||||
import com.bonus.system.api.domain.SysDept;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
*/
|
||||
public interface DataSetTeamMemberMapper {
|
||||
|
||||
/**
|
||||
* 查询标注人员和角色关联
|
||||
*
|
||||
* @param memberId 标注人员和角色关联主键
|
||||
* @return 标注人员和角色关联
|
||||
*/
|
||||
public DataSetTeamMemberEntity selectTeamMemberByMemberId(Long memberId);
|
||||
|
||||
/**
|
||||
* 查询标注人员和角色关联列表
|
||||
*
|
||||
* @param entity 标注人员和角色关联
|
||||
* @return 标注人员和角色关联集合
|
||||
*/
|
||||
public List<DataSetTeamMemberEntity> selectTeamMemberList(DataSetTeamMemberEntity entity);
|
||||
|
||||
/**
|
||||
* 新增标注人员和角色关联
|
||||
*
|
||||
* @param entity 标注人员和角色关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTeamMember(DataSetTeamMemberEntity entity);
|
||||
|
||||
/**
|
||||
* 修改标注人员和角色关联
|
||||
*
|
||||
* @param entity 标注人员和角色关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTeamMember(DataSetTeamMemberEntity entity);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除标注人员和角色关联
|
||||
*
|
||||
* @param memberIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTeamMemberByMemberIds(Long[] memberIds);
|
||||
|
||||
/**
|
||||
* 获取全部部门
|
||||
* @return 集合
|
||||
*/
|
||||
public List<SysDept> selectDeptList();
|
||||
|
||||
public List<SysUser> selectUserList();
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.bonus.ai.service;
|
||||
|
||||
import com.bonus.ai.domain.DataSetSampleEntity;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
*/
|
||||
public interface DataSetSampleService {
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
public AjaxResult selectSampleById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 集合
|
||||
*/
|
||||
public List<DataSetSampleEntity> selectSampleList(DataSetSampleEntity entity);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
public AjaxResult insertSample(DataSetSampleEntity entity);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
public AjaxResult updateSample(DataSetSampleEntity entity);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids 需要删除的主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public AjaxResult deleteSampleByIds(Long[] ids);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.bonus.ai.service;
|
||||
|
||||
import com.bonus.ai.domain.DataSetTeamMemberEntity;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
*/
|
||||
public interface DataSetTeamMemberService {
|
||||
|
||||
/**
|
||||
* 查询标注人员和角色关联
|
||||
*
|
||||
* @param memberId 标注人员和角色关联主键
|
||||
* @return 标注人员和角色关联
|
||||
*/
|
||||
public AjaxResult selectTeamMemberByMemberId(Long memberId);
|
||||
|
||||
/**
|
||||
* 查询标注人员和角色关联列表
|
||||
*
|
||||
* @param entity 标注人员和角色关联
|
||||
* @return 标注人员和角色关联集合
|
||||
*/
|
||||
public List<DataSetTeamMemberEntity> selectTeamMemberList(DataSetTeamMemberEntity entity);
|
||||
|
||||
/**
|
||||
* 新增标注人员和角色关联
|
||||
*
|
||||
* @param entity 标注人员和角色关联
|
||||
* @return 结果
|
||||
*/
|
||||
public AjaxResult insertTeamMember(DataSetTeamMemberEntity entity);
|
||||
|
||||
/**
|
||||
* 修改标注人员和角色关联
|
||||
*
|
||||
* @param entity 标注人员和角色关联
|
||||
* @return 结果
|
||||
*/
|
||||
public AjaxResult updateTeamMember(DataSetTeamMemberEntity entity);
|
||||
|
||||
/**
|
||||
* 批量删除标注人员和角色关联
|
||||
*
|
||||
* @param memberIds 需要删除的标注人员和角色关联主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public AjaxResult deleteTeamMemberByMemberIds(Long[] memberIds);
|
||||
|
||||
/**
|
||||
* 获取部门树
|
||||
* @return 树集合
|
||||
*/
|
||||
public AjaxResult buildDeptTreeWithUsers();
|
||||
}
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
package com.bonus.ai.service.Impl;
|
||||
|
||||
import com.bonus.ai.domain.DataSetSampleEntity;
|
||||
import com.bonus.ai.mapper.DataSetSampleMapper;
|
||||
import com.bonus.ai.service.DataSetSampleService;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
*/
|
||||
@Service
|
||||
public class DataSetSampleServiceImpl implements DataSetSampleService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DataSetSampleServiceImpl.class);
|
||||
@Resource
|
||||
private DataSetSampleMapper dataSetSampleMapper;
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实体
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult selectSampleById(Long id)
|
||||
{
|
||||
try {
|
||||
DataSetSampleEntity dataSetSampleEntity = dataSetSampleMapper.selectSampleById(id);
|
||||
if (ObjectUtils.isEmpty(dataSetSampleEntity)){
|
||||
return AjaxResult.error("查询失败");
|
||||
}else {
|
||||
return AjaxResult.success(dataSetSampleEntity);
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.error("样本类型根据id查询", e);
|
||||
return AjaxResult.error("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 集合
|
||||
*/
|
||||
@Override
|
||||
public List<DataSetSampleEntity> selectSampleList(DataSetSampleEntity entity)
|
||||
{
|
||||
return dataSetSampleMapper.selectSampleList(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult insertSample(DataSetSampleEntity entity)
|
||||
{
|
||||
try {
|
||||
entity.setCreateTime(DateUtils.getNowDate());
|
||||
entity.setCreateBy(SecurityUtils.getUsername());
|
||||
int i = dataSetSampleMapper.selectSampleByFormat(entity.getId(), entity.getSampleFormat());
|
||||
if (i>0){
|
||||
return AjaxResult.error("样本格式已纯在");
|
||||
}
|
||||
i = dataSetSampleMapper.insertSample(entity);
|
||||
if (i>0){
|
||||
return AjaxResult.success();
|
||||
}else {
|
||||
return AjaxResult.error("新增失败");
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.error("样本类型新增", e);
|
||||
return AjaxResult.error("新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateSample(DataSetSampleEntity entity)
|
||||
{
|
||||
try {
|
||||
entity.setUpdateTime(DateUtils.getNowDate());
|
||||
entity.setUpdateBy(SecurityUtils.getUsername());
|
||||
int i = dataSetSampleMapper.selectSampleByFormat(entity.getId(), entity.getSampleFormat());
|
||||
if (i>0){
|
||||
return AjaxResult.error("样本格式已存在");
|
||||
}
|
||||
i = dataSetSampleMapper.updateSample(entity);
|
||||
if (i>0){
|
||||
return AjaxResult.success();
|
||||
}else {
|
||||
return AjaxResult.error("修改失败");
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.error("样本类型修改", e);
|
||||
return AjaxResult.error("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids 需要删除的主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult deleteSampleByIds(Long[] ids)
|
||||
{
|
||||
try {
|
||||
int i = dataSetSampleMapper.deleteSampleByIds(ids);
|
||||
if (i>0){
|
||||
return AjaxResult.success();
|
||||
}else {
|
||||
return AjaxResult.error("删除失败");
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
logger.error("样本类型删除",e);
|
||||
return AjaxResult.error("删除失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
package com.bonus.ai.service.Impl;
|
||||
|
||||
import com.bonus.ai.domain.DataSetTeamMemberEntity;
|
||||
import com.bonus.ai.mapper.DataSetTeamMemberMapper;
|
||||
import com.bonus.ai.service.DataSetTeamMemberService;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.RemoteDeptService;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
*/
|
||||
@Service
|
||||
public class DataSetTeamMemberServiceImpl implements DataSetTeamMemberService {
|
||||
|
||||
@Resource
|
||||
private DataSetTeamMemberMapper dataSetTeamMemberMapper;
|
||||
|
||||
@Resource
|
||||
private RemoteDeptService remoteDeptService;
|
||||
/**
|
||||
* 查询标注人员和角色关联
|
||||
*
|
||||
* @param memberId 标注人员和角色关联主键
|
||||
* @return 标注人员和角色关联
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult selectTeamMemberByMemberId(Long memberId)
|
||||
{
|
||||
try {
|
||||
DataSetTeamMemberEntity entity =dataSetTeamMemberMapper.selectTeamMemberByMemberId(memberId);
|
||||
return ObjectUtils.isNotEmpty(entity)?AjaxResult.success(entity):AjaxResult.error("查询失败");
|
||||
}catch (Exception e){
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询标注人员和角色关联列表
|
||||
*
|
||||
* @param aiAnnotationTeamMember 标注人员和角色关联
|
||||
* @return 标注人员和角色关联
|
||||
*/
|
||||
@Override
|
||||
public List<DataSetTeamMemberEntity> selectTeamMemberList(DataSetTeamMemberEntity aiAnnotationTeamMember)
|
||||
{
|
||||
return dataSetTeamMemberMapper.selectTeamMemberList(aiAnnotationTeamMember);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增标注人员和角色关联
|
||||
*
|
||||
* @param dataSetTeamMemberEntity 标注人员和角色关联
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult insertTeamMember(DataSetTeamMemberEntity dataSetTeamMemberEntity)
|
||||
{
|
||||
dataSetTeamMemberEntity.setCreateTime(DateUtils.getNowDate());
|
||||
dataSetTeamMemberEntity.setCreateBy(SecurityUtils.getUsername());
|
||||
try{
|
||||
int rows = dataSetTeamMemberMapper.insertTeamMember(dataSetTeamMemberEntity);
|
||||
return rows>0?AjaxResult.success("新增成功"):AjaxResult.error("新增失败");
|
||||
}catch (Exception e){
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改标注人员和角色关联
|
||||
*
|
||||
* @param aiAnnotationTeamMember 标注人员和角色关联
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateTeamMember(DataSetTeamMemberEntity aiAnnotationTeamMember)
|
||||
{
|
||||
aiAnnotationTeamMember.setUpdateTime(DateUtils.getNowDate());
|
||||
try{
|
||||
int rows = dataSetTeamMemberMapper.updateTeamMember(aiAnnotationTeamMember);
|
||||
return rows>0?AjaxResult.success("修改成功"):AjaxResult.error("修改失败");
|
||||
}catch (Exception e){
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除标注人员和角色关联
|
||||
*
|
||||
* @param memberIds 需要删除的标注人员和角色关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult deleteTeamMemberByMemberIds(Long[] memberIds)
|
||||
{
|
||||
try{
|
||||
int rows = dataSetTeamMemberMapper.deleteTeamMemberByMemberIds(memberIds);
|
||||
return rows>0?AjaxResult.success("删除成功"):AjaxResult.error("删除失败");
|
||||
}catch (Exception e){
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门树
|
||||
*
|
||||
* @return 树集合
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult buildDeptTreeWithUsers() {
|
||||
try {
|
||||
//List<SysDept> sysDepts = dataSetTeamMemberMapper.selectDeptList();
|
||||
List<SysUser> sysUsers = dataSetTeamMemberMapper.selectUserList();
|
||||
//TreeNode root = DeptTreeBuilder.buildDeptTreeWithUsers(sysDepts, sysUsers);
|
||||
return AjaxResult.success(sysUsers);
|
||||
}catch (Exception e){
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.ai.mapper.DataSetSampleMapper">
|
||||
<resultMap type="com.bonus.ai.domain.DataSetSampleEntity" id="SampleResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="sampleName" column="sample_name" />
|
||||
<result property="sampleFormat" column="sample_format" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSampleVo">
|
||||
select id, sample_name, sample_format, del_flag, create_by, create_time, update_by, update_time from ai_dataset_sample
|
||||
</sql>
|
||||
|
||||
<select id="selectSampleList" parameterType="com.bonus.ai.domain.DataSetSampleEntity" resultMap="SampleResult">
|
||||
<include refid="selectSampleVo"/>
|
||||
<where>
|
||||
<if test="sampleName != null and sampleName != ''"> and sample_name like concat('%', #{sampleName}, '%')</if>
|
||||
<if test="sampleFormat != null and sampleFormat != ''"> and sample_format = #{sampleFormat}</if>
|
||||
and del_flag = '0'
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectSampleById" parameterType="Long" resultMap="SampleResult">
|
||||
<include refid="selectSampleVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectSampleByFormat" resultType="java.lang.Integer">
|
||||
SELECT COUNT(1) FROM ai_dataset_sample
|
||||
<where>
|
||||
<if test="id != null and id != ''"> and id not in (#{id})</if>
|
||||
and sample_format = #{format} AND del_flag = '0'
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertSample" parameterType="com.bonus.ai.domain.DataSetSampleEntity" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ai_dataset_sample
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="sampleName != null">sample_name,</if>
|
||||
<if test="sampleFormat != null">sample_format,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sampleName != null">#{sampleName},</if>
|
||||
<if test="sampleFormat != null">#{sampleFormat},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSample" parameterType="com.bonus.ai.domain.DataSetSampleEntity">
|
||||
update ai_dataset_sample
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="sampleName != null">sample_name = #{sampleName},</if>
|
||||
<if test="sampleFormat != null">sample_format = #{sampleFormat},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteSampleByIds" parameterType="String">
|
||||
update ai_dataset_sample set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.ai.mapper.DataSetTeamMemberMapper">
|
||||
<resultMap type="com.bonus.ai.domain.DataSetTeamMemberEntity" id="TeamMemberResult">
|
||||
<result property="memberId" column="member_id" />
|
||||
<result property="roleId" column="role_id" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTeamMemberVo">
|
||||
SELECT AT.member_id AS memberId,
|
||||
su.nick_name AS userName,
|
||||
su.sex AS sex,
|
||||
AT.role_id AS roleId
|
||||
FROM
|
||||
ai_annotation_team_member AT
|
||||
LEFT JOIN sys_user su ON AT.member_id = su.user_id AND su.del_flag='0' AND at.del_flag='0'
|
||||
</sql>
|
||||
<select id="selectTeamMemberList" parameterType="com.bonus.ai.domain.DataSetTeamMemberEntity" resultType="com.bonus.ai.domain.DataSetTeamMemberEntity">
|
||||
<include refid="selectTeamMemberVo"/>
|
||||
<where>
|
||||
at.del_flag='0'
|
||||
<if test="userName != null and userName != ''"> and su.nick_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="roleId != null and roleId != ''"> and AT.role_id = #{roleId}</if>
|
||||
<if test="sex != null and sex != ''"> and su.sex = #{sex}</if>
|
||||
</where>
|
||||
ORDER BY at.create_time DESC
|
||||
</select>
|
||||
<select id="selectTeamMemberByMemberId" parameterType="Long" resultType="com.bonus.ai.domain.DataSetTeamMemberEntity">
|
||||
<include refid="selectTeamMemberVo"/>
|
||||
where member_id = #{memberId} AND at.del_flag='0'
|
||||
</select>
|
||||
|
||||
<select id="selectDeptList" resultType="com.bonus.system.api.domain.SysDept">
|
||||
select dept_id AS deptId, parent_id AS parentId, dept_name AS deptName
|
||||
from sys_dept
|
||||
where del_flag = '0'
|
||||
order by parent_id, order_num
|
||||
</select>
|
||||
|
||||
<select id="selectUserList" resultType="com.bonus.system.api.domain.SysUser">
|
||||
select user_id AS userId, dept_id AS deptId, nick_name AS nickName
|
||||
from sys_user
|
||||
where del_flag = '0'
|
||||
and user_id NOT IN (SELECT member_id FROM ai_annotation_team_member WHERE del_flag ='0');
|
||||
</select>
|
||||
|
||||
<insert id="insertTeamMember" parameterType="com.bonus.ai.domain.DataSetTeamMemberEntity">
|
||||
INSERT INTO ai_annotation_team_member
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
member_id,
|
||||
<if test="roleId != null">role_id,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
VALUES
|
||||
<foreach collection="selectedData" item="memberId" separator=",">
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{memberId},
|
||||
<if test="roleId != null">#{roleId},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateTeamMember" parameterType="com.bonus.ai.domain.DataSetTeamMemberEntity">
|
||||
update ai_annotation_team_member
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="roleId != null">role_id = #{roleId},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where member_id = #{memberId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTeamMemberByMemberIds" parameterType="String">
|
||||
delete from ai_annotation_team_member where member_id in
|
||||
<foreach item="memberId" collection="array" open="(" separator="," close=")">
|
||||
#{memberId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue