数据回流
This commit is contained in:
parent
f8901b7f95
commit
5c990d571e
@ -85,22 +85,24 @@ public class DataRefluxDataController {
|
||||
|
||||
@GetMapping("/review-the-data")
|
||||
@Operation(summary = "数据回流配置保存数据")
|
||||
public void saveTheData(@Valid DataRefluxDataReqVO pageReqVO){
|
||||
public CommonResult<Boolean> saveTheData(@Valid DataRefluxDataReqVO pageReqVO){
|
||||
if (pageReqVO.getDataid() != null){
|
||||
pageReqVO.setDataids(Collections.singletonList(pageReqVO.getDataid()));
|
||||
}
|
||||
dataRefluxDataService.getDataRefluxDataIDs(pageReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/save-all-the-data")
|
||||
@Operation(summary = "数据回流配置保存全部数据")
|
||||
public void saveAllTheData(@Valid DataRefluxDataReqVO pageReqVO, DataRefluxConfigPageReqVO page){
|
||||
public CommonResult<Boolean> saveAllTheData(@Valid DataRefluxDataReqVO pageReqVO, DataRefluxConfigPageReqVO page){
|
||||
page.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
PageResult<DataRefluxDataDO> list = dataRefluxDataService.getTheDetails(page);
|
||||
List<DataRefluxDataDO> doList = list.getList();
|
||||
List<Long> collect = doList.stream().map(DataRefluxDataDO::getId).collect(Collectors.toList());
|
||||
pageReqVO.setDataids(collect);
|
||||
dataRefluxDataService.getDataRefluxDataIDs(pageReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.llm.service.datarefluxdata;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.datarefluxconfig.vo.DataRefluxConfigPageReqVO;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.datarefluxconfig.DataRefluxConfigDO;
|
||||
@ -146,8 +147,8 @@ public class DataRefluxDataServiceImpl implements DataRefluxDataService {
|
||||
List<DataRefluxDataDO> dataRefluxDataDOS = dataRefluxDataMapper.selectList(wrapper);
|
||||
DatasetDO dataRespVO = BeanUtils.toBean(pageReqVO, DatasetDO.class);
|
||||
dataRespVO.setId(null);
|
||||
DatasetDO datasetDO = datasetMapper.selectOne(new LambdaQueryWrapper<DatasetDO>().eq(DatasetDO::getDatasetName, dataRespVO.getDatasetName()));
|
||||
if (datasetDO!=null){
|
||||
List<DatasetDO> datasetDO = datasetMapper.selectList(new LambdaQueryWrapper<DatasetDO>().eq(DatasetDO::getDatasetName, dataRespVO.getDatasetName()));
|
||||
if (!CollectionUtils.isAnyEmpty(datasetDO)){
|
||||
throw new RuntimeException("数据集名称重复");
|
||||
}
|
||||
datasetMapper.insert(dataRespVO);
|
||||
|
Loading…
x
Reference in New Issue
Block a user