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
7c37e00c
Commit
7c37e00c
authored
Oct 30, 2024
by
wei
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
非项目群下的案卷,查顶级
parent
5a59f6ef
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
1 deletion
+43
-1
ExtFilesServiceImpl.java
...t/dcs/document/core/service/impl/ExtFilesServiceImpl.java
+43
-1
No files found.
inet-doc-expand-core/src/main/java/com/inet/dcs/document/core/service/impl/ExtFilesServiceImpl.java
View file @
7c37e00c
...
...
@@ -3,8 +3,15 @@ package com.inet.dcs.document.core.service.impl;
import
com.inet.dcs.document.common.vo.ExtFilesVO
;
import
com.inet.dcs.document.core.repository.ExtFilesRepository
;
import
com.inet.dcs.document.core.service.ExtFilesService
;
import
com.inet.dcs.document.core.util.SearchUtil
;
import
com.inet.dcs.document.entity.po.ExtFiles
;
import
com.yonde.dex.basedata.data.search.SearchItem
;
import
com.yonde.dex.basedata.data.search.SearchQueryCondition
;
import
com.yonde.dex.basedata.entity.data.DxPageImpl
;
import
com.yonde.dex.basedata.exception.DxBusinessException
;
import
com.yonde.dex.basic.feign.expand.ExtDxContextProjectServiceFeign
;
import
com.yonde.dex.context.common.vo.DxContextProjectVO
;
import
com.yonde.dex.context.common.vo.DxContextVO
;
import
com.yonde.dex.dao.service.DxDaoPluginExpander
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -31,17 +38,52 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic
// 需要补位的长度
public
static
final
int
LENGTH
=
3
;
@Autowired
private
ExtDxContextProjectServiceFeign
extDxContextProjectServiceFeign
;
@Override
public
void
beforeSave
(
Collection
<
V
>
target
)
{
// 全宗号+项目号+项目代号+类别代号+盒号(三位流水号)+后缀“-(两位数字流水号)例如:2-20114272031-QH03-JS01-001-(01)
String
projectCodeAndNumber
;
for
(
V
v
:
target
)
{
DxContextVO
dxContext
=
v
.
getDxContext
();
if
(
"program"
.
equals
(
dxContext
.
getProjectClass
()))
{
projectCodeAndNumber
=
dxContext
.
getContractCode
()
+
"-"
+
dxContext
.
getNumber
();
}
else
{
projectCodeAndNumber
=
this
.
getProjectCodeAndNumber
(
dxContext
);
}
String
caseNumber
=
this
.
getCaseNumber
(
v
.
getCaseNumber
());
String
categoryNumber
=
v
.
getCategoryNumber
();
String
volumeNumber
=
"2-"
+
"项目号"
+
"-"
+
"项目代号"
+
"-"
.
concat
(
categoryNumber
+
"-"
).
concat
(
caseNumber
);
String
volumeNumber
=
"2-"
.
concat
(
projectCodeAndNumber
+
"-"
)
.
concat
(
categoryNumber
+
"-"
).
concat
(
caseNumber
);
v
.
setVolumeNumber
(
volumeNumber
);
}
}
private
String
getProjectCodeAndNumber
(
DxContextVO
dxContext
)
{
boolean
projectClass
=
false
;
// 项目群上的合同编号
String
contractCode
=
""
;
// 项目群的项目代号
String
number
=
""
;
// 非项目群下的案卷,查顶级
while
(!
projectClass
)
{
dxContext
=
this
.
getProjectInfo
(
dxContext
);
projectClass
=
"program"
.
equals
(
dxContext
.
getProjectClass
());
if
(
projectClass
)
{
contractCode
=
dxContext
.
getContractCode
();
number
=
dxContext
.
getNumber
();
}
}
return
contractCode
+
"-"
+
number
;
}
private
DxContextVO
getProjectInfo
(
DxContextVO
dxContextVO
)
{
SearchQueryCondition
searchProgram
=
SearchUtil
.
buildQuery
(
"id"
,
SearchItem
.
Operator
.
EQ
,
dxContextVO
.
getParentId
());
DxPageImpl
programDxPage
=
extDxContextProjectServiceFeign
.
findRecursion
(
searchProgram
);
return
(
DxContextVO
)
programDxPage
.
getContent
().
get
(
0
);
}
private
String
getCaseNumber
(
String
caseNumber
)
{
StringBuilder
caseNumberBuilder
=
new
StringBuilder
();
int
length
=
caseNumber
.
length
();
...
...
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