Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dcs-plan
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-plan
Commits
bac1ffea
Commit
bac1ffea
authored
Nov 14, 2024
by
wangqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
季报自定义编码规则
parent
003f75ad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
QuarterlyReportEncode.java
...com/yonde/dcs/plan/core/encode/QuarterlyReportEncode.java
+49
-0
No files found.
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/encode/QuarterlyReportEncode.java
0 → 100644
View file @
bac1ffea
package
com
.
yonde
.
dcs
.
plan
.
core
.
encode
;
import
com.yonde.dcs.plan.common.utils.SearchUtil
;
import
com.yonde.dcs.plan.common.vo.ExtQuarterlyReportVO
;
import
com.yonde.dcs.plan.common.vo.ExtSupplierManageVO
;
import
com.yonde.dcs.plan.core.service.ExtQuarterlyReportService
;
import
com.yonde.dcs.plan.core.service.ExtSupplierManageService
;
import
com.yonde.dex.basedata.data.search.SearchItem
;
import
com.yonde.dex.basedata.entity.data.DxPageImpl
;
import
com.yonde.dex.basedata.exception.DxBusinessException
;
import
com.yonde.dex.initialization.encoder.CustomizeEncode
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.time.Year
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 工艺规程自定义编码规则
*/
@Slf4j
@Component
public
class
QuarterlyReportEncode
implements
CustomizeEncode
<
ExtQuarterlyReportVO
>
{
@Autowired
private
ExtQuarterlyReportService
extQuarterlyReportService
;
@Override
public
synchronized
String
generateEncode
(
ExtQuarterlyReportVO
extQuarterlyReportVO
)
{
// 季报文件编码格式:DWD-XMB-JD-年月-02-1/2
String
code
=
"DWD-XMB-JD-年月-02-"
+
extQuarterlyReportVO
.
getQuarterlyReportType
();
String
replace
=
extQuarterlyReportVO
.
getQuarterlyReportTime
().
toString
().
replace
(
"-"
,
""
);
String
yearMonth
=
replace
.
substring
(
0
,
6
);
code
=
code
.
replace
(
"年月"
,
yearMonth
);
log
.
info
(
"Quarterly Report Generate Encode.code={}"
,
code
);
List
content
=
extQuarterlyReportService
.
findRecursion
(
SearchUtil
.
buildQuery
(
"fileNumber"
,
SearchItem
.
Operator
.
EQ
,
code
)).
getContent
();
if
(
ObjectUtils
.
isNotEmpty
(
content
)
&&
content
.
size
()
>
0
){
throw
new
DxBusinessException
(
"500"
,
"文件编码:"
+
code
+
"已存在"
);
}
return
code
;
}
}
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