Merge branch 'main' of http://192.168.65.198:3000/toolchaintechnologycenter/spdm-backend
This commit is contained in:
@@ -15,7 +15,7 @@ public class QueryDirReq extends BaseReq {
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "上传用户ID")
|
||||
private Long uploadUserId;
|
||||
private String uploadUserId;
|
||||
|
||||
// 1项目,2阶段,3学科,4学科下文件列表
|
||||
@Schema(description = "类型: 1项目, 2阶段, 3学科, 4学科下文件列表", defaultValue = "0")
|
||||
|
||||
@@ -77,4 +77,9 @@ public class FileSearchReq extends BaseReq {
|
||||
*/
|
||||
@Schema(description = "是否过滤空数据")
|
||||
private boolean filterEmptyData;
|
||||
|
||||
@Schema(description = "上传人id")
|
||||
private String uploadUserId;
|
||||
|
||||
|
||||
}
|
||||
@@ -49,4 +49,7 @@ public class QueryBigFileReq extends BaseReq {
|
||||
@Schema(description = "文件业务类型(1:模型文件 2:仿真报告、3:计算文件、4:曲线文件、5:云图文件,6:网格文件,7:计算过程文件)")
|
||||
private Integer fileBizType;
|
||||
|
||||
@Schema(description = "上传人id")
|
||||
private String uploadUserId;
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.sdm.data.model.req.QueryBigFileReq;
|
||||
import com.sdm.data.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -33,6 +34,7 @@ import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
@@ -283,6 +285,12 @@ public class DataStorageAnalysisImpl implements DataStorageAnalysis {
|
||||
if (queryBigFileReq.getFileSize() != null && queryBigFileReq.getFileSizeUnit() != null) {
|
||||
fileSizeInBytes = convertToBytes(queryBigFileReq.getFileSize(), queryBigFileReq.getFileSizeUnit());
|
||||
}
|
||||
List<Long> userIds = StringUtils.isBlank(queryBigFileReq.getUploadUserId())
|
||||
? new ArrayList<>()
|
||||
: Arrays.stream(queryBigFileReq.getUploadUserId().split(","))
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
List<Long> fileIds = fileStorageService.lambdaQuery()
|
||||
.select(FileStorage::getFileId)
|
||||
.eq(ObjectUtils.isNotEmpty(queryBigFileReq.getDirId()), FileStorage::getDirId, queryBigFileReq.getDirId())
|
||||
@@ -292,6 +300,7 @@ public class DataStorageAnalysisImpl implements DataStorageAnalysis {
|
||||
.gt(ObjectUtils.isNotEmpty(queryBigFileReq.getStartTime()), FileStorage::getCreateTime, queryBigFileReq.getStartTime())
|
||||
.lt(ObjectUtils.isNotEmpty(queryBigFileReq.getEndTime()), FileStorage::getCreateTime, queryBigFileReq.getEndTime())
|
||||
.gt(ObjectUtils.isNotEmpty(fileSizeInBytes), FileStorage::getFileSize, fileSizeInBytes)
|
||||
.in(org.apache.commons.collections4.CollectionUtils.isNotEmpty(userIds), FileStorage::getUserId, userIds)
|
||||
.list().stream()
|
||||
.map(FileStorage::getFileId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@@ -633,12 +633,18 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
||||
if (ObjectUtils.isNotEmpty(fileMetadataInfo)) {
|
||||
queryBigFileReq.setDirId(fileMetadataInfo.getId());
|
||||
}
|
||||
|
||||
BeanUtils.copyProperties(minioFileSearchReq, queryBigFileReq);
|
||||
List<Long> fileIdList =dataStorageAnalysis.getListBigFileId(queryBigFileReq);
|
||||
if(CollectionUtils.isEmpty(fileIdList)){
|
||||
return SdmResponse.success();
|
||||
}
|
||||
// 可变查询条件
|
||||
List<Long> creatorIds = org.apache.commons.lang3.StringUtils.isBlank(queryBigFileReq.getUploadUserId())
|
||||
? new ArrayList<>()
|
||||
: Arrays.stream(queryBigFileReq.getUploadUserId().split(","))
|
||||
.filter(org.apache.commons.lang3.StringUtils::isNotBlank)
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
PageHelper.startPage(minioFileSearchReq.getCurrent(), minioFileSearchReq.getSize());
|
||||
List<FileMetadataInfo> files = fileMetadataInfoService
|
||||
.lambdaQuery()
|
||||
@@ -646,13 +652,14 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
||||
.eq(FileMetadataInfo::getIsLatest, FileIsLastEnum.YES.getValue())
|
||||
// 这里是知识库文件:排除新增在审批的文件
|
||||
.in(FileMetadataInfo::getApproveType,fileDatdList)
|
||||
.in(org.apache.commons.collections4.CollectionUtils.isNotEmpty(creatorIds), FileMetadataInfo::getCreatorId, creatorIds)
|
||||
.list();
|
||||
setCreatorNames(files);
|
||||
setCidInfos(files);
|
||||
setProjectName(files);
|
||||
setAnalysisDirectionName(files);
|
||||
PageInfo<FileMetadataInfo> page = new PageInfo<>(files);
|
||||
return SdmResponse.success(page);
|
||||
return PageUtils.getJsonObjectSdmResponse(files, page);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -687,8 +694,14 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
||||
} else {
|
||||
return SdmResponse.success();
|
||||
}
|
||||
List<Long> creatorIds = org.apache.commons.lang3.StringUtils.isBlank(req.getUploadUserId())
|
||||
? new ArrayList<>()
|
||||
: Arrays.stream(req.getUploadUserId().split(","))
|
||||
.filter(org.apache.commons.lang3.StringUtils::isNotBlank)
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
List<FileMetadataInfo> list = fileMetadataInfoService.lambdaQuery().eq(FileMetadataInfo::getParentId, parentId)
|
||||
.eq(ObjectUtils.isNotEmpty(req.getUploadUserId()), FileMetadataInfo::getCreatorId, req.getUploadUserId())
|
||||
.in(org.apache.commons.collections4.CollectionUtils.isNotEmpty(creatorIds), FileMetadataInfo::getCreatorId, creatorIds)
|
||||
.eq(ObjectUtils.isNotEmpty(req.getQueryTarget()), FileMetadataInfo::getDataType, req.getQueryTarget())
|
||||
.like(ObjectUtils.isNotEmpty(req.getFileName()), FileMetadataInfo::getOriginalName, req.getFileName())
|
||||
.eq(FileMetadataInfo::getIsLatest, FileIsLastEnum.YES.getValue())
|
||||
|
||||
@@ -596,7 +596,7 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
|
||||
@Override
|
||||
public SdmResponse queryRunDir(QueryDirReq req) {
|
||||
return SdmResponse.success(dataFeignClient.queryDir(req));
|
||||
return dataFeignClient.queryDir(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user