fix:数据查询界面,算例、任务 需要支持名称的模糊搜索
This commit is contained in:
@@ -145,7 +145,6 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
|
||||
|
||||
}
|
||||
|
||||
PageHelper.startPage(req.getCurrent(), req.getSize());
|
||||
var wrapper = fileMetadataInfoService.lambdaQuery()
|
||||
.eq(FileMetadataInfo::getTenantId, ThreadLocalContext.getTenantId())
|
||||
.isNull(FileMetadataInfo::getDeletedAt)
|
||||
@@ -187,6 +186,7 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
|
||||
wrapper.orderByDesc(FileMetadataInfo::getCreateTime);
|
||||
}
|
||||
|
||||
PageHelper.startPage(req.getCurrent(), req.getSize());
|
||||
List<FileMetadataInfo> fileMetadataInfos = wrapper.list();
|
||||
PageInfo<FileMetadataInfo> page = new PageInfo<>(fileMetadataInfos);
|
||||
|
||||
@@ -299,6 +299,21 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
|
||||
inByCurrentLevelCsv(wrapper, FileMetadataInfo::getTag9, tagReq.getTag9());
|
||||
inByCurrentLevelCsv(wrapper, FileMetadataInfo::getTag10, tagReq.getTag10());
|
||||
|
||||
// task/run 也支持按照名称模糊查询,先获取对应的taskId集合,逗号拼接后,然后设置到tagReq。taskId字段
|
||||
if(ObjectUtils.isNotEmpty(tagReq.getTaskName())){
|
||||
tagReq.setTaskId(fileMetadataInfoService.lambdaQuery()
|
||||
.eq(FileMetadataInfo::getRelatedResourceUuidOwnType,NodeTypeEnum.TASK.getValue())
|
||||
.like(FileMetadataInfo::getOriginalName,tagReq.getTaskName()).list().stream().map(FileMetadataInfo::getRelatedResourceUuid).collect(Collectors.joining( ",")));
|
||||
|
||||
}
|
||||
|
||||
if(ObjectUtils.isNotEmpty(tagReq.getRunName())){
|
||||
tagReq.setRunId(fileMetadataInfoService.lambdaQuery()
|
||||
.eq(FileMetadataInfo::getRelatedResourceUuidOwnType,NodeTypeEnum.RUN.getValue())
|
||||
.like(FileMetadataInfo::getOriginalName,tagReq.getRunName()).list().stream().map(FileMetadataInfo::getRelatedResourceUuid).collect(Collectors.joining( ",")));
|
||||
|
||||
}
|
||||
|
||||
// task/run 按普通IN过滤
|
||||
inByCsv(wrapper, FileMetadataInfo::getTaskId, tagReq.getTaskId());
|
||||
inByCsv(wrapper, FileMetadataInfo::getRunId, tagReq.getRunId());
|
||||
|
||||
@@ -113,7 +113,7 @@ import java.util.stream.Collectors;
|
||||
@ConditionalOnProperty(name = "fileSystem.chose", havingValue = "minio")
|
||||
public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
||||
// fileData 知识库文件列表可见的数据
|
||||
private final List<Integer> fileDatdList = ApproveFileDataTypeEnum.getVisibleInFileList();
|
||||
private final List<Integer> visibleInFileList = ApproveFileDataTypeEnum.getVisibleInFileList();
|
||||
|
||||
private static final String FLOWABLE_SIMULATION_BASEDIR = "/home/simulation/";
|
||||
|
||||
@@ -945,10 +945,7 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
||||
queryBigFileReq.setFileSuffix(queryBigFileReq.getFileSuffix().toLowerCase());
|
||||
}
|
||||
|
||||
if (DirTypeEnum.isApprovalRequired(dirType)) {
|
||||
// 需要审批的目录类型:排除新增在审批的文件
|
||||
queryBigFileReq.setApproveTypeList(fileDatdList);
|
||||
}
|
||||
|
||||
|
||||
List<Long> uploadUserId = org.apache.commons.lang3.StringUtils.isBlank(minioFileSearchReq.getUploadUserId())
|
||||
? new ArrayList<>()
|
||||
@@ -959,9 +956,16 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
||||
queryBigFileReq.setUploadUserId(uploadUserId);
|
||||
|
||||
Long userId =ThreadLocalContext.getUserId();
|
||||
if(!Objects.isNull(userId)){
|
||||
queryBigFileReq.setCurrentReqUserId(userId);
|
||||
queryBigFileReq.setApproveAllTypeList(ApproveFileDataTypeEnum.getAllVisibleInFileList());
|
||||
// 需要审批的目录类型 才需要设置审批类型, 如果是项目文件这种不需要审批的,可以看所有文件
|
||||
if (DirTypeEnum.isApprovalRequired(dirType)) {
|
||||
//文件不是 当前用户 上传的 看不到别的用户正在上传的文件
|
||||
queryBigFileReq.setApproveTypeList(visibleInFileList);
|
||||
|
||||
// 文件是 当前用户 上传的 可以看到自己上传中的文件
|
||||
if(!Objects.isNull(userId)){
|
||||
queryBigFileReq.setCurrentReqUserId(userId);
|
||||
queryBigFileReq.setApproveAllTypeList(ApproveFileDataTypeEnum.getAllVisibleInFileList());
|
||||
}
|
||||
}
|
||||
|
||||
SdmResponse<PageDataResp<List<FileStorage>>> searchResult = dataStorageAnalysis.listBigFile(queryBigFileReq);
|
||||
|
||||
@@ -227,47 +227,42 @@
|
||||
and file_storage.tenantId = #{tenantId}
|
||||
and file_metadata_info.deletedAt IS NULL
|
||||
|
||||
<!-- ===================== 修复后:兼容 currentReqUserId = null 的情况 ===================== -->
|
||||
<choose>
|
||||
<!-- 情况1:当前用户ID 不为空 → 自己看全部状态,别人看指定状态 -->
|
||||
<when test="queryBigFileReq.currentReqUserId != null">
|
||||
AND (
|
||||
<!-- 自己创建的:使用 approveAllTypeList -->
|
||||
<if test="queryBigFileReq.approveAllTypeList != null and queryBigFileReq.approveAllTypeList.size()>0">
|
||||
(file_metadata_info.creatorId = #{queryBigFileReq.currentReqUserId}
|
||||
AND file_metadata_info.approveType IN
|
||||
<foreach collection="queryBigFileReq.approveAllTypeList" item="approveType" open="(" separator="," close=")">
|
||||
#{approveType}
|
||||
</foreach>)
|
||||
</if>
|
||||
|
||||
<!-- 连接 OR -->
|
||||
<if test="(queryBigFileReq.approveAllTypeList != null and !queryBigFileReq.approveAllTypeList.isEmpty())
|
||||
and (queryBigFileReq.approveTypeList != null and !queryBigFileReq.approveTypeList.isEmpty())">
|
||||
OR
|
||||
</if>
|
||||
|
||||
<!-- 别人创建的:使用 approveTypeList -->
|
||||
<!-- 情况1:queryBigFileReq.approveTypeList不为空,是需要走审批的目录的文件的场景,需要满足:-->
|
||||
<if test="queryBigFileReq.approveTypeList != null and queryBigFileReq.approveTypeList.size()>0">
|
||||
(file_metadata_info.creatorId != #{queryBigFileReq.currentReqUserId}
|
||||
AND file_metadata_info.approveType IN
|
||||
<foreach collection="queryBigFileReq.approveTypeList" item="approveType" open="(" separator="," close=")">
|
||||
<!-- 文件不是 当前用户 上传的 看不到别的用户正在上传的文件,但是可以看到其他审批类型状态的文件 -->
|
||||
AND (
|
||||
file_metadata_info.approveType IN
|
||||
<foreach collection="queryBigFileReq.approveTypeList" item="approveType" open="(" separator=","
|
||||
close=")">
|
||||
#{approveType}
|
||||
</foreach>)
|
||||
</foreach>
|
||||
|
||||
<!-- 文件是 当前用户 上传的 可以看到自己上传中的文件 -->
|
||||
<if test="queryBigFileReq.approveAllTypeList != null and !queryBigFileReq.approveAllTypeList.size()>0">
|
||||
OR
|
||||
(file_metadata_info.creatorId = #{queryBigFileReq.currentReqUserId}
|
||||
AND file_metadata_info.approveType IN
|
||||
<foreach collection="queryBigFileReq.approveAllTypeList" item="approveType" open="(" separator="," close=")">
|
||||
#{approveType}
|
||||
</foreach>)
|
||||
</if>
|
||||
)
|
||||
</if>
|
||||
)
|
||||
</when>
|
||||
|
||||
<!-- 情况2:当前用户ID 为空 → 统一使用 approveTypeList(原来的逻辑) -->
|
||||
<otherwise>
|
||||
<if test="queryBigFileReq.approveTypeList != null and queryBigFileReq.approveTypeList.size()>0">
|
||||
AND file_metadata_info.approveType IN
|
||||
<foreach collection="queryBigFileReq.approveTypeList" item="approveType" open="(" separator="," close=")">
|
||||
<foreach collection="queryBigFileReq.approveTypeList" item="approveType" open="(" separator=","
|
||||
close=")">
|
||||
#{approveType}
|
||||
</foreach>
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
<!-- ===================================================================================== -->
|
||||
|
||||
<if test="queryBigFileReq.dirIds != null and queryBigFileReq.dirIds.size()>0">
|
||||
|
||||
Reference in New Issue
Block a user