feat: 项目管理、方案管理

This commit is contained in:
stream 2025-09-11 17:05:16 +08:00
parent 5a516b0b01
commit de4bb9b0b4
14 changed files with 502 additions and 14 deletions

View File

@ -40,10 +40,10 @@ public class ViCorpusController extends BaseController {
// ----------------------- 单次对话语料/唤醒语料 --------------------------
@ApiOperation("查询单次对话语料/唤醒语料列表")
@ApiOperation(value = "查询单次对话语料/唤醒语料列表")
@PreAuthorize("@ss.hasPermi('vi:corpus:list')")
@GetMapping("/single/list")
public TableDataInfo list(@Validated ViCorpusVO viCorpusVO) {
@PostMapping("/single/list")
public TableDataInfo list(@Validated @RequestBody ViCorpusVO viCorpusVO) {
startPage();
List<ViCorpus> list = viCorpusService.selectViCorpusList(viCorpusVO);
return getDataTable(list);
@ -81,10 +81,10 @@ public class ViCorpusController extends BaseController {
@ApiOperation("查询连续对话列表")
@PreAuthorize("@ss.hasPermi('vi:corpus:list')")
@GetMapping("/continuous/list")
public TableDataInfo continuousList(ViCorpus viCorpus) {
@PostMapping("/continuous/list")
public TableDataInfo continuousList(@Validated @RequestBody ViCorpusVO viCorpusVO) {
startPage();
List<ViContinuousCorpusVO> list = viCorpusService.selectContinuousList(viCorpus);
List<ViContinuousCorpusVO> list = viCorpusService.selectContinuousList(viCorpusVO);
return getDataTable(list);
}
@ -96,7 +96,7 @@ public class ViCorpusController extends BaseController {
}
@ApiOperation("修改连续对话")
@PreAuthorize("@ss.hasPermi('vi:corpus:add')")
@PreAuthorize("@ss.hasPermi('vi:corpus:edit')")
@PostMapping("/continuous/update")
public AjaxResult update(@RequestBody ViContinuousCorpusVO viContinuousCorpusVO) {
return toAjax(viCorpusService.updateContinuousViCorpus(viContinuousCorpusVO));

View File

@ -0,0 +1,67 @@
package com.cmvr.web.controller.vi;
import com.cmvr.common.core.controller.BaseController;
import com.cmvr.common.core.domain.AjaxResult;
import com.cmvr.common.core.page.TableDataInfo;
import com.cmvr.vi.model.domain.ViProject;
import com.cmvr.vi.service.IViProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(tags = "语音交互--项目管理")
@RestController
@RequestMapping("/vi/project")
@RequiredArgsConstructor
public class ViProjectController extends BaseController {
private final IViProjectService viProjectService;
@ApiOperation("获取项目列表")
@PreAuthorize("@ss.hasPermi('vi:project:list')")
@GetMapping("/list")
public TableDataInfo list(ViProject viProject) {
startPage();
List<ViProject> list = viProjectService.selectViProjectList(viProject);
return getDataTable(list);
}
@ApiOperation("根据id获取项目信息")
@PreAuthorize("@ss.hasPermi('vi:project:query')")
@GetMapping(value = "/{projectId}")
public AjaxResult getInfo(@PathVariable("projectId") Long projectId) {
return success(viProjectService.selectViProjectByProjectId(projectId));
}
@ApiOperation("添加项目")
@PreAuthorize("@ss.hasPermi('vi:project:add')")
@PostMapping
public AjaxResult add(@RequestBody ViProject viProject) {
return toAjax(viProjectService.insertViProject(viProject));
}
@ApiOperation("编辑项目")
@PreAuthorize("@ss.hasPermi('vi:project:edit')")
@PutMapping
public AjaxResult edit(@RequestBody ViProject viProject) {
return toAjax(viProjectService.updateViProject(viProject));
}
@ApiOperation("删除项目")
@PreAuthorize("@ss.hasPermi('vi:project:remove')")
@DeleteMapping("/{projectIds}")
public AjaxResult remove(@PathVariable Long[] projectIds) {
return toAjax(viProjectService.deleteViProjectByProjectIds(projectIds));
}
}

View File

@ -0,0 +1,66 @@
package com.cmvr.web.controller.vi;
import com.cmvr.common.core.controller.BaseController;
import com.cmvr.common.core.domain.AjaxResult;
import com.cmvr.common.core.page.TableDataInfo;
import com.cmvr.vi.model.domain.ViScheme;
import com.cmvr.vi.service.IViSchemeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(tags = "语音交互--方案")
@RestController
@RequestMapping("/vi/scheme")
@RequiredArgsConstructor
public class ViSchemeController extends BaseController {
private final IViSchemeService viSchemeService;
@ApiOperation("查询方案列表")
@PreAuthorize("@ss.hasPermi('vi:scheme:list')")
@GetMapping("/list")
public TableDataInfo list(ViScheme viScheme) {
startPage();
List<ViScheme> list = viSchemeService.selectViSchemeList(viScheme);
return getDataTable(list);
}
@ApiOperation("根据ID查询方案详细信息")
@PreAuthorize("@ss.hasPermi('vi:scheme:query')")
@GetMapping(value = "/{schemeId}")
public AjaxResult getInfo(@PathVariable("schemeId") Long schemeId) {
return success(viSchemeService.selectViSchemeBySchemeId(schemeId));
}
@ApiOperation("新增方案")
@PreAuthorize("@ss.hasPermi('vi:scheme:add')")
@PostMapping
public AjaxResult add(@RequestBody ViScheme viScheme) {
return toAjax(viSchemeService.insertViScheme(viScheme));
}
@ApiOperation("修改方案")
@PreAuthorize("@ss.hasPermi('vi:scheme:edit')")
@PutMapping
public AjaxResult edit(@RequestBody ViScheme viScheme) {
return toAjax(viSchemeService.updateViScheme(viScheme));
}
@ApiOperation("删除方案")
@PreAuthorize("@ss.hasPermi('vi:scheme:remove')")
@DeleteMapping("/{schemeIds}")
public AjaxResult remove(@PathVariable Long[] schemeIds) {
return toAjax(viSchemeService.deleteViSchemeBySchemeIds(schemeIds));
}
}

View File

@ -0,0 +1,12 @@
package com.cmvr.vi.mapper;
import com.cmvr.vi.model.domain.ViProject;
import com.github.yulichang.base.MPJBaseMapper;
/**
* 语音交互-项目Mapper接口
*
* @author cmvr-iot
*/
public interface ViProjectMapper extends MPJBaseMapper<ViProject> {
}

View File

@ -0,0 +1,12 @@
package com.cmvr.vi.mapper;
import com.cmvr.vi.model.domain.ViScheme;
import com.github.yulichang.base.MPJBaseMapper;
/**
* 语音交互-方案Mapper接口
*
* @author cmvr-iot
*/
public interface ViSchemeMapper extends MPJBaseMapper<ViScheme> {
}

View File

@ -0,0 +1,78 @@
package com.cmvr.vi.model.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.cmvr.common.annotation.Excel;
import com.cmvr.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel("语音交互--项目表")
public class ViProject extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("项目ID")
@TableId(type = IdType.AUTO)
private Long projectId;
@Excel(name = "项目名称")
@ApiModelProperty("项目名称")
private String projectName;
@Excel(name = "测试人员")
@ApiModelProperty("测试人员")
private String tester;
@Excel(name = "计划测试开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("计划测试开始时间")
private Date planStart;
@Excel(name = "计划测试结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("计划测试结束时间")
private Date planEnd;
@Excel(name = "项目描述")
@ApiModelProperty("项目描述")
private String description;
@Excel(name = "样品名称")
@ApiModelProperty("样品名称")
private String sampleName;
@Excel(name = "商标")
@ApiModelProperty("商标")
private String trademark;
@Excel(name = "型号规格")
@ApiModelProperty("型号规格")
private String modelSpec;
@Excel(name = "数量")
@ApiModelProperty("数量")
private Integer quantity;
@Excel(name = "委托单位")
@ApiModelProperty("委托单位")
private String entrustUnit;
@Excel(name = "生产单位")
@ApiModelProperty("生产单位")
private String productionUnit;
@Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("生产日期")
private Date productionDate;
@Excel(name = "送样日期", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("送样日期")
private Date sampleDate;
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
@ApiModelProperty(value = "状态", notes = "0=正常,1=停用")
private String status;
}

View File

@ -0,0 +1,42 @@
package com.cmvr.vi.model.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.cmvr.common.annotation.Excel;
import com.cmvr.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("语音交互--方案表")
public class ViScheme extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("方案ID")
@TableId(type = IdType.AUTO)
private Long schemeId;
@Excel(name = "所属项目ID")
@ApiModelProperty("所属项目ID")
private Long projectId;
@Excel(name = "方案名称")
@ApiModelProperty("方案名称")
private String schemeName;
@ApiModelProperty("场景类型 1:唤醒场景 2: 单次对话场景 3:连续对话场景")
private Integer sceneType;
@ApiModelProperty("唤醒语料parent_id")
private String wakeId;
@Excel(name = "语料ID列表")
@ApiModelProperty(value = "语料parent_id列表逗号分隔",notes = "单次和唤醒的parent_id和id一致连续语料的parent_id下有多条子语料")
private String corpusIds;
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
@ApiModelProperty(value = "状态", notes = "0=正常,1=停用")
private String status;
}

View File

@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.util.List;
@Data
@ApiModel("查询单次对话语料/唤醒语料VO")
@ -13,6 +14,9 @@ public class ViCorpusVO {
@ApiModelProperty("测试语料-连续对话的父ID")
private String parentId;
@ApiModelProperty("测试语料-连续对话的父ID列表")
private List<String> parentIds;
@ApiModelProperty("语料名称")
private String corpusName;
@ -29,6 +33,6 @@ public class ViCorpusVO {
private String status;
@NotEmpty(message = "语料类型不能为空")
@ApiModelProperty(value = "语料类型", notes = "WAKEUP 唤醒,TEST 单次对话测试")
@ApiModelProperty(value = "语料类型", required = true, notes = "WAKEUP 唤醒,TEST 单次对话测试")
private String type;
}

View File

@ -32,10 +32,10 @@ public interface IViCorpusService extends IService<ViCorpus> {
/**
* 查询连续对话列表
*
* @param viCorpus 语料库
* @param viCorpusVO 语料库
* @return 语料库集合
*/
public List<ViContinuousCorpusVO> selectContinuousList(ViCorpus viCorpus);
public List<ViContinuousCorpusVO> selectContinuousList(ViCorpusVO viCorpusVO);
/**
* 新增语料库

View File

@ -0,0 +1,53 @@
package com.cmvr.vi.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cmvr.vi.model.domain.ViProject;
import java.util.List;
/**
* 语音交互-项目Service接口
*
* @author cmvr-iot
*/
public interface IViProjectService extends IService<ViProject> {
/**
* 查询语音交互-项目
*
* @param projectId 语音交互-项目主键
* @return 语音交互-项目
*/
public ViProject selectViProjectByProjectId(Long projectId);
/**
* 查询语音交互-项目列表
*
* @param viProject 语音交互-项目
* @return 语音交互-项目集合
*/
public List<ViProject> selectViProjectList(ViProject viProject);
/**
* 新增语音交互-项目
*
* @param viProject 语音交互-项目
* @return 结果
*/
public int insertViProject(ViProject viProject);
/**
* 修改语音交互-项目
*
* @param viProject 语音交互-项目
* @return 结果
*/
public int updateViProject(ViProject viProject);
/**
* 批量删除语音交互-项目
*
* @param projectIds 需要删除的语音交互-项目主键集合
* @return 结果
*/
public int deleteViProjectByProjectIds(Long[] projectIds);
}

View File

@ -0,0 +1,53 @@
package com.cmvr.vi.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cmvr.vi.model.domain.ViScheme;
import java.util.List;
/**
* 语音交互-方案Service接口
*
* @author cmvr-iot
*/
public interface IViSchemeService extends IService<ViScheme> {
/**
* 查询语音交互-方案
*
* @param schemeId 语音交互-方案主键
* @return 语音交互-方案
*/
public ViScheme selectViSchemeBySchemeId(Long schemeId);
/**
* 查询语音交互-方案列表
*
* @param viScheme 语音交互-方案
* @return 语音交互-方案集合
*/
public List<ViScheme> selectViSchemeList(ViScheme viScheme);
/**
* 新增语音交互-方案
*
* @param viScheme 语音交互-方案
* @return 结果
*/
public int insertViScheme(ViScheme viScheme);
/**
* 修改语音交互-方案
*
* @param viScheme 语音交互-方案
* @return 结果
*/
public int updateViScheme(ViScheme viScheme);
/**
* 批量删除语音交互-方案
*
* @param schemeIds 需要删除的语音交互-方案主键集合
* @return 结果
*/
public int deleteViSchemeBySchemeIds(Long[] schemeIds);
}

View File

@ -57,6 +57,7 @@ public class IViCorpusServiceImpl extends ServiceImpl<ViCorpusMapper, ViCorpus>
.like(ObjUtil.isNotEmpty(viCorpusVO.getCorpusName()), ViCorpus::getCorpusName, viCorpusVO.getCorpusName())
.like(ObjUtil.isNotEmpty(viCorpusVO.getTextContent()), ViCorpus::getTextContent, viCorpusVO.getTextContent())
.eq(ObjUtil.isNotEmpty(viCorpusVO.getStatus()), ViCorpus::getStatus, viCorpusVO.getStatus())
.in(CollUtil.isNotEmpty(viCorpusVO.getParentIds()), ViCorpus::getParentId, viCorpusVO.getParentIds())
.orderByAsc(ViCorpus::getSortOrder)
.orderByDesc(ViCorpus::getUpdateTime);
@ -65,7 +66,7 @@ public class IViCorpusServiceImpl extends ServiceImpl<ViCorpusMapper, ViCorpus>
@Override
public List<ViContinuousCorpusVO> selectContinuousList(ViCorpus viCorpus) {
public List<ViContinuousCorpusVO> selectContinuousList(ViCorpusVO viCorpusVO) {
// 查询父级
MPJLambdaWrapper<ViCorpus> wrapper = new MPJLambdaWrapper<>();
wrapper.select(ViCorpus::getParentId)
@ -74,9 +75,10 @@ public class IViCorpusServiceImpl extends ServiceImpl<ViCorpusMapper, ViCorpus>
.select(ViCorpus::getDialect)
.eq(ViCorpus::getType, ViCorpusEnum.TEST)
.eq(ViCorpus::getContinuous, 0)
.like(ObjUtil.isNotEmpty(viCorpus.getVoiceType()), ViCorpus::getVoiceType, viCorpus.getVoiceType())
.like(ObjUtil.isNotEmpty(viCorpus.getDialect()), ViCorpus::getDialect, viCorpus.getDialect())
.like(ObjUtil.isNotEmpty(viCorpus.getCorpusName()), ViCorpus::getCorpusName, viCorpus.getCorpusName())
.like(ObjUtil.isNotEmpty(viCorpusVO.getVoiceType()), ViCorpus::getVoiceType, viCorpusVO.getVoiceType())
.like(ObjUtil.isNotEmpty(viCorpusVO.getDialect()), ViCorpus::getDialect, viCorpusVO.getDialect())
.like(ObjUtil.isNotEmpty(viCorpusVO.getCorpusName()), ViCorpus::getCorpusName, viCorpusVO.getCorpusName())
.in(CollUtil.isNotEmpty(viCorpusVO.getParentIds()), ViCorpus::getParentId, viCorpusVO.getParentIds())
.groupBy(ViCorpus::getParentId, ViCorpus::getVoiceType, ViCorpus::getDialect, ViCorpus::getCorpusName);
List<ViContinuousCorpusVO> list = this.baseMapper.selectJoinList(ViContinuousCorpusVO.class, wrapper);

View File

@ -0,0 +1,50 @@
package com.cmvr.vi.service.impl;
import cn.hutool.core.util.ObjUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cmvr.vi.mapper.ViProjectMapper;
import com.cmvr.vi.model.domain.ViProject;
import com.cmvr.vi.service.IViProjectService;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
/**
* 语音交互-项目Service业务层处理
*
* @author cmvr-iot
*/
@Service
public class ViProjectServiceImpl extends ServiceImpl<ViProjectMapper, ViProject> implements IViProjectService {
@Override
public ViProject selectViProjectByProjectId(Long projectId) {
return this.getById(projectId);
}
@Override
public List<ViProject> selectViProjectList(ViProject viProject) {
LambdaQueryWrapper<ViProject> wrapper = Wrappers.lambdaQuery();
wrapper.eq(ObjUtil.isNotEmpty(viProject.getProjectName()), ViProject::getProjectName, viProject.getProjectName())
.eq(ObjUtil.isNotEmpty(viProject.getStatus()), ViProject::getStatus, viProject.getStatus());
return this.list(wrapper);
}
@Override
public int insertViProject(ViProject viProject) {
return this.baseMapper.insert(viProject);
}
@Override
public int updateViProject(ViProject viProject) {
return this.baseMapper.updateById(viProject);
}
@Override
public int deleteViProjectByProjectIds(Long[] projectIds) {
return this.baseMapper.deleteBatchIds(Arrays.asList(projectIds));
}
}

View File

@ -0,0 +1,49 @@
package com.cmvr.vi.service.impl;
import cn.hutool.core.util.ObjUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cmvr.vi.mapper.ViSchemeMapper;
import com.cmvr.vi.model.domain.ViScheme;
import com.cmvr.vi.service.IViSchemeService;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
/**
* 语音交互-方案Service业务层处理
*
* @author cmvr-iot
*/
@Service
public class ViSchemeServiceImpl extends ServiceImpl<ViSchemeMapper, ViScheme> implements IViSchemeService {
@Override
public ViScheme selectViSchemeBySchemeId(Long schemeId) {
return this.getById(schemeId);
}
@Override
public List<ViScheme> selectViSchemeList(ViScheme viScheme) {
LambdaQueryWrapper<ViScheme> wrapper = Wrappers.lambdaQuery();
wrapper.eq(ObjUtil.isNotEmpty(viScheme.getSchemeName()), ViScheme::getSchemeName, viScheme.getSchemeName())
.eq(ObjUtil.isNotEmpty(viScheme.getStatus()), ViScheme::getStatus, viScheme.getStatus());
return this.list(wrapper);
}
@Override
public int insertViScheme(ViScheme viScheme) {
return this.baseMapper.insert(viScheme);
}
@Override
public int updateViScheme(ViScheme viScheme) {
return this.baseMapper.updateById(viScheme);
}
@Override
public int deleteViSchemeBySchemeIds(Long[] schemeIds) {
return this.baseMapper.deleteBatchIds(Arrays.asList(schemeIds));
}
}