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
bd25cafe
Commit
bd25cafe
authored
Oct 30, 2024
by
wei
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
案卷序号
parent
15030a46
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
15 deletions
+50
-15
ExtFilesServiceImpl.java
...t/dcs/document/core/service/impl/ExtFilesServiceImpl.java
+50
-15
No files found.
inet-doc-expand-core/src/main/java/com/inet/dcs/document/core/service/impl/ExtFilesServiceImpl.java
View file @
bd25cafe
package
com
.
inet
.
dcs
.
document
.
core
.
service
.
impl
;
package
com
.
inet
.
dcs
.
document
.
core
.
service
.
impl
;
import
org.springframework.stereotype.Service
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.List
;
import
com.inet.dcs.document.common.vo.ExtFilesVO
;
import
com.inet.dcs.document.common.vo.ExtFilesVO
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.*
;
import
com.inet.dcs.document.core.service.ExtFilesService
;
import
com.inet.dcs.document.core.repository.ExtFilesRepository
;
import
com.inet.dcs.document.core.repository.ExtFilesRepository
;
import
com.inet.dcs.document.core.service.ExtFilesService
;
import
com.inet.dcs.document.entity.po.ExtFiles
;
import
com.inet.dcs.document.entity.po.ExtFiles
;
import
javax.annotation.Resource
;
import
com.yonde.dex.basedata.exception.DxBusinessException
;
import
com.yonde.dex.dao.service.DxDaoPluginExpander
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Collection
;
/**
/**
* @description: ExtFiles-ServiceImpl
* @description: ExtFiles-ServiceImpl
* @author: dexadmin
* @author: dexadmin
* @version: V
* @version: V
* @date: 2024-10-29 10:30:49
* @date: 2024-10-29 10:30:49
**/
**/
@Slf4j
@Slf4j
@Service
(
ExtFilesServiceImpl
.
BEAN_NAME
)
@Service
(
ExtFilesServiceImpl
.
BEAN_NAME
)
public
class
ExtFilesServiceImpl
<
V
extends
ExtFilesVO
>
implements
ExtFilesService
<
V
>{
public
class
ExtFilesServiceImpl
<
V
extends
ExtFilesVO
>
implements
ExtFilesService
<
V
>
,
DxDaoPluginExpander
<
V
>
{
public
static
final
String
BEAN_NAME
=
"extFilesServiceImpl"
;
public
static
final
String
BEAN_NAME
=
"extFilesServiceImpl"
;
...
@@ -29,6 +28,42 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic
...
@@ -29,6 +28,42 @@ public class ExtFilesServiceImpl<V extends ExtFilesVO> implements ExtFilesServic
@Autowired
@Autowired
ExtFilesRepository
<
ExtFiles
>
extFilesRepository
;
ExtFilesRepository
<
ExtFiles
>
extFilesRepository
;
// 需要补位的长度
public
static
final
int
LENGTH
=
3
;
@Override
public
void
beforeSave
(
Collection
<
V
>
target
)
{
// 全宗号+项目号+项目代号+类别代号+盒号(三位流水号)+后缀“-(两位数字流水号)例如:2-20114272031-QH03-JS01-001-(01)
for
(
V
v
:
target
)
{
String
caseNumber
=
v
.
getCaseNumber
();
caseNumber
=
getCaseNumber
(
caseNumber
);
String
categoryNumber
=
v
.
getCategoryNumber
();
String
volumeNumber
=
"2-"
+
"项目号"
+
"-"
+
"项目代号"
+
"-"
.
concat
(
categoryNumber
+
"-"
).
concat
(
caseNumber
);
v
.
setVolumeNumber
(
volumeNumber
);
}
}
private
String
getCaseNumber
(
String
caseNumber
)
{
StringBuilder
caseNumberBuilder
=
new
StringBuilder
();
int
length
=
caseNumber
.
length
();
// 正常输入补位后不能超过3位数字
if
(!
caseNumber
.
contains
(
"="
)
&&
length
>
3
)
{
throw
new
DxBusinessException
(
"500"
,
"案卷序号:"
+
caseNumber
+
"不能超过3位数"
);
}
// 无后缀-输入,位数3补齐0
if
(!
caseNumber
.
contains
(
"="
))
{
// 不满足位数
if
(
length
<
LENGTH
)
{
for
(
int
i
=
0
;
i
<
LENGTH
-
length
;
i
++)
{
caseNumberBuilder
.
append
(
"0"
);
}
}
}
else
{
// 包含-认为是插入后缀情况 暂时定义为直接拼上
}
return
caseNumberBuilder
.
append
(
caseNumber
).
toString
();
}
}
}
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