Merge pull request '列表中文件夹类型文件,返回是否存在子文件夹' (#868) from wanjia9506/microservices:feat_document_126283 into master

This commit is contained in:
wanjia9506 2025-05-14 09:34:54 +08:00
commit 0f689986f2
4 changed files with 14 additions and 0 deletions

View File

@ -72,4 +72,7 @@ public class PmsDocumentVo
@ApiModelProperty(value = "是否被收藏")
private Boolean isFavour;
@ApiModelProperty(value = "是否存在子文件夹")
private Boolean hasChildDir=false;
}

View File

@ -86,4 +86,6 @@ public interface PmsDocumentMapper
Long[] selectLinkedRepoIds(@Param("enterpriseId") Long enterpriseId, @Param("projectId") Long projectId);
List<PmsDocument> selectPmsFavoriteDocumentList(PmsDocumentFavoriteSearchVo pmsDocumentFavoriteSearchVo);
boolean hasChildDirById(@Param("documentId") Long documentId);
}

View File

@ -231,6 +231,9 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
}
pmsDocumentVo.setWikiRepositorySimpleInfo(wikiRepositoryInfo);
pmsDocumentVo.setIsFavour(pmsDocumentUserFavoriteMapper.isDocumentInFavorites(SecurityUtils.getUserId(), pmsDocument.getId()));
if (PmsDocumentType.DOCUMENT_DIRECTORY.getKey() == pmsDocumentVo.getDocType()) {
pmsDocumentVo.setHasChildDir(pmsDocumentMapper.hasChildDirById(pmsDocument.getId()));
}
return pmsDocumentVo;
}

View File

@ -230,4 +230,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and pms_project_id = #{projectId}
and wiki_gitlink_repo_id is not null
</select>
<select id="hasChildDirById" resultType="java.lang.Boolean">
select count(*)
from pms_document
where parent_id = #{documentId}
and doc_type = 1
</select>
</mapper>