Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dcs-doc-expand
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
INET-TWO
server
dcs-doc-expand
Commits
7406afe1
Commit
7406afe1
authored
Sep 30, 2024
by
wangyangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文档:文档和目录查询
parent
b91dfd53
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
16 deletions
+91
-16
ExtDxDocumentController.java
...ument/core/controller/expand/ExtDxDocumentController.java
+17
-5
ExtDxDocumentService.java
...cs/document/core/service/expand/ExtDxDocumentService.java
+20
-5
ExtDxDocumentServiceImpl.java
...nt/core/service/impl/expand/ExtDxDocumentServiceImpl.java
+54
-6
No files found.
dcs-doc-expand-core/src/main/java/com/yonde/dcs/document/core/controller/expand/ExtDxDocumentController.java
View file @
7406afe1
package
com
.
yonde
.
dcs
.
document
.
core
.
controller
.
expand
;
import
com.yonde.dcs.document.common.vo.ExtReviseVersionVO
;
import
com.yonde.dcs.document.core.controller.expand.shadow.ExtDxDocumentControllerShadow
;
import
com.yonde.dcs.document.core.service.expand.ExtDxDocumentService
;
import
com.yonde.dex.basedata.entity.api.ApiResult
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
com.yonde.dcs.document.common.entity.vo.DxDocumentVO
;
import
io.swagger.annotations.Api
;
...
...
@@ -10,11 +14,11 @@ import com.yonde.dex.basedata.auth.annos.BasePermission;
import
com.yonde.dcs.document.core.controller.DocController
;
/**
* @description: DxDocument-Controller
* @author: dexadmin
* @version: V
* @date: 2024-8-2 15:26:32
**/
* @description: DxDocument-Controller
* @author: dexadmin
* @version: V
* @date: 2024-8-2 15:26:32
**/
@Api
(
tags
=
"DxDocument管理服务"
)
@RequestMapping
(
"/DxDocument"
)
@ResponseBody
()
...
...
@@ -22,6 +26,14 @@ import com.yonde.dcs.document.core.controller.DocController;
@BasePermission
(
"dcs-doc:DxDocument"
)
public
class
ExtDxDocumentController
<
V
extends
DxDocumentVO
,
S
extends
ExtDxDocumentService
<
V
>>
extends
ExtDxDocumentControllerShadow
<
V
,
S
>
{
@Autowired
private
ExtDxDocumentService
<
V
>
service
;
@ApiOperation
(
"文档和目录查询"
)
@GetMapping
({
"/docAndFloder"
})
public
ApiResult
docAndFloder
(
@RequestParam
Long
dxContextId
,
@RequestParam
Long
parentId
)
{
return
ApiResult
.
ok
(
service
.
getDocAndFolder
(
dxContextId
,
parentId
),
"查询成功"
);
}
}
...
...
dcs-doc-expand-core/src/main/java/com/yonde/dcs/document/core/service/expand/ExtDxDocumentService.java
View file @
7406afe1
...
...
@@ -2,13 +2,28 @@ package com.yonde.dcs.document.core.service.expand;
import
com.yonde.dcs.document.common.entity.vo.DxDocumentVO
;
import
com.yonde.dcs.document.core.service.expand.shadow.ExtDxDocumentServiceShadow
;
import
com.yonde.dex.basedata.entity.data.DxPageImpl
;
import
com.yonde.dex.basedata.entity.vo.IdOnlyVO
;
import
java.util.List
;
import
java.util.Map
;
/**
* @description: DxDocument-service
* @author: dexadmin
* @version: V
* @date: 2024-8-2 15:26:32
**/
* @description: DxDocument-service
* @author: dexadmin
* @version: V
* @date: 2024-8-2 15:26:32
**/
public
interface
ExtDxDocumentService
<
V
extends
DxDocumentVO
>
extends
ExtDxDocumentServiceShadow
<
V
>
{
/**
* 获取文档和文件夹
*
* @param dxContextId 项目id
* @param parentId 目录夹id
* @return
*/
Map
<
String
,
DxPageImpl
>
getDocAndFolder
(
Long
dxContextId
,
Long
parentId
);
}
dcs-doc-expand-core/src/main/java/com/yonde/dcs/document/core/service/impl/expand/ExtDxDocumentServiceImpl.java
View file @
7406afe1
package
com
.
yonde
.
dcs
.
document
.
core
.
service
.
impl
.
expand
;
import
com.yonde.dcs.document.core.service.ExtDxDocumentFolderService
;
import
com.yonde.dcs.document.core.service.expand.ExtDxDocumentService
;
import
com.yonde.dcs.document.core.event.DocumentEvent
;
import
com.yonde.dex.basedata.data.search.SearchItem
;
import
com.yonde.dex.basedata.data.search.SearchItems
;
import
com.yonde.dex.basedata.data.search.SearchQueryBuilder
;
import
com.yonde.dex.basedata.data.search.SearchQueryCondition
;
import
com.yonde.dex.basedata.entity.data.DxPageImpl
;
import
com.yonde.dex.basedata.entity.data.VersionRelationType
;
import
com.yonde.dex.configspec.SpecSearch
;
import
org.springframework.stereotype.Service
;
import
java.util.
Collection
;
import
java.util.
*
;
import
com.yonde.dcs.document.common.entity.vo.DxDocumentVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -14,11 +22,11 @@ import com.yonde.dcs.document.entity.po.DxDocument;
import
com.yonde.dcs.document.core.service.impl.DocumentServiceImpl
;
/**
* @description: DxDocument-ServiceImpl
* @author: dexadmin
* @version: V
* @date: 2024-8-2 15:26:32
**/
* @description: DxDocument-ServiceImpl
* @author: dexadmin
* @version: V
* @date: 2024-8-2 15:26:32
**/
@Slf4j
@Service
(
DocumentServiceImpl
.
BEAN_NAME
)
public
class
ExtDxDocumentServiceImpl
<
V
extends
DxDocumentVO
>
extends
DocumentServiceImpl
<
V
>
implements
ExtDxDocumentService
<
V
>
{
...
...
@@ -26,6 +34,9 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe
public
static
final
String
BEAN_NAME
=
"documentServiceImpl"
;
@Autowired
private
ExtDxDocumentFolderService
dxDocumentFolderService
;
@Autowired
DocumentRepository
<
DxDocument
>
documentRepository
;
@Autowired
...
...
@@ -37,12 +48,49 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe
//documentEvent.createDocListener(v);
}
}
@Override
public
void
beforeUpdate
(
Collection
<
V
>
target
,
Collection
<
V
>
origin
)
{
for
(
V
v
:
target
)
{
//documentEvent.updateDocListener(v);
}
}
@Override
public
Map
<
String
,
DxPageImpl
>
getDocAndFolder
(
Long
dxContextId
,
Long
parentId
)
{
Map
<
String
,
DxPageImpl
>
result
=
new
HashMap
<>();
//查询目录
SearchQueryCondition
folderCondition
=
SearchQueryBuilder
.
openBuild
()
.
openFilterBuilder
()
.
setItem
(
"dxContextId"
,
SearchItem
.
Operator
.
EQ
,
dxContextId
)
.
setItem
(
"parentId"
,
SearchItem
.
Operator
.
EQ
,
parentId
)
.
builder
().
build
();
DxPageImpl
folderPage
=
dxDocumentFolderService
.
findRecursion
(
folderCondition
);
result
.
put
(
"DxDocumentFolder"
,
folderPage
);
//查询文档
SearchQueryCondition
documentCondition
=
SearchQueryBuilder
.
openBuild
()
.
openFilterBuilder
()
.
setItem
(
"dxContextId"
,
SearchItem
.
Operator
.
EQ
,
dxContextId
)
.
setItem
(
"dxDocumentFolderId"
,
SearchItem
.
Operator
.
ISNULL
,
null
)
.
setItem
(
"latest"
,
SearchItem
.
Operator
.
EQ
,
true
)
.
setItem
(
"checkOuted"
,
SearchItem
.
Operator
.
EQ
,
false
)
.
builder
().
build
();
// SearchQueryCondition documentCondition = SearchQueryCondition.builder()
// .searchItems(SearchItems.builder()
// .item(new SearchItem("dxContextId", SearchItem.Operator.EQ, dxContextId, null))
// .item(new SearchItem("dxDocumentFolderId", SearchItem.Operator.ISNULL, null, null))
// .item(new SearchItem("latest", SearchItem.Operator.EQ, true, null))
// .item(new SearchItem("checkOuted", SearchItem.Operator.EQ, false, null))
// .operator(SearchItems.BooleanOperator.AND).build()).build();
SpecSearch
specSearch
=
SpecSearch
.
builder
()
.
searchQueryCondition
(
documentCondition
)
.
build
();
DxPageImpl
<
V
>
docPage
=
this
.
findByConfigSpec
(
specSearch
);
result
.
put
(
"DxDocument"
,
docPage
);
return
result
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment