From c825168e8755ff815b0a957873f546759b16860e Mon Sep 17 00:00:00 2001 From: linbangquan <1437892690@qq.com> Date: Tue, 14 Nov 2023 19:14:34 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20SQL=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E9=80=82=E9=85=8DTiDB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1024432422748160]SQL语句适配TiDB http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1024432422748160 --- .../api/document/KnowledgeDocumentSearchApi.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/neatlogic/module/knowledge/api/document/KnowledgeDocumentSearchApi.java b/src/main/java/neatlogic/module/knowledge/api/document/KnowledgeDocumentSearchApi.java index 6133fab..0fe1448 100644 --- a/src/main/java/neatlogic/module/knowledge/api/document/KnowledgeDocumentSearchApi.java +++ b/src/main/java/neatlogic/module/knowledge/api/document/KnowledgeDocumentSearchApi.java @@ -42,6 +42,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.*; +import java.util.stream.Collectors; @Service @AuthAction(action = KNOWLEDGE.class) @@ -112,6 +113,17 @@ public class KnowledgeDocumentSearchApi extends PrivateApiComponentBase { KnowledgeDocumentVo documentVoParam = new KnowledgeDocumentVo(jsonObj); //补充查看权限条件参数(圈子成员or圈子审批人) getDocumentViewParam(documentVoParam); + String knowledgeDocumentTypeUuid = documentVoParam.getKnowledgeDocumentTypeUuid(); + if (StringUtils.isNotBlank(knowledgeDocumentTypeUuid)) { + KnowledgeDocumentTypeVo typeVo = knowledgeDocumentTypeMapper.getTypeByUuid(documentVoParam.getKnowledgeDocumentTypeUuid()); + if (typeVo == null) { + throw new KnowledgeDocumentTypeNotFoundException(documentVoParam.getKnowledgeDocumentTypeUuid()); + } + documentVoParam.setKnowledgeCircleId(typeVo.getKnowledgeCircleId()); + List typeList = knowledgeDocumentTypeMapper.getChildAndSelfByLftRht(typeVo.getLft(), typeVo.getRht(), typeVo.getKnowledgeCircleId()); + List typeUuidList = typeList.stream().map(KnowledgeDocumentTypeVo::getUuid).collect(Collectors.toList()); + documentVoParam.setKnowledgeDocumentTypeUuidList(typeUuidList); + } //根据keyword等条件,从数据库搜索知识 List documentList = new ArrayList<>(); List documentIdList = knowledgeDocumentMapper.searchKnowledgeDocumentId(documentVoParam); -- Gitee