Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
baihang-report
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
data-spider
baihang-report
Commits
13409fd9
Commit
13409fd9
authored
Jan 08, 2022
by
陈宏杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存文件名
parent
e6c20717
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
BaiHangDataDisposeController.java
...group/report/controller/BaiHangDataDisposeController.java
+2
-2
BaiHangDataDisposeService.java
...oup/report/service/baihang/BaiHangDataDisposeService.java
+10
-7
No files found.
src/main/java/cn/quantgroup/report/controller/BaiHangDataDisposeController.java
View file @
13409fd9
...
...
@@ -26,9 +26,9 @@ public class BaiHangDataDisposeController {
}
@PostMapping
(
"/encryptFieldAndCreateFile"
)
public
String
encryptFieldAndCreateFile
(
String
sourceCollectFileName
,
String
sourceFilePath
,
String
targetFilePath
){
public
String
encryptFieldAndCreateFile
(
String
sourceCollectFileName
,
String
sourceFilePath
,
String
targetFilePath
,
String
dataType
){
try
{
baiHangDataDisposeService
.
encryptFieldAndCreateFile
(
sourceCollectFileName
,
sourceFilePath
,
targetFilePath
);
baiHangDataDisposeService
.
encryptFieldAndCreateFile
(
sourceCollectFileName
,
sourceFilePath
,
targetFilePath
,
dataType
);
return
"SUCCESS"
;
}
catch
(
Exception
e
){
return
e
.
getMessage
();
...
...
src/main/java/cn/quantgroup/report/service/baihang/BaiHangDataDisposeService.java
View file @
13409fd9
...
...
@@ -20,10 +20,7 @@ import org.springframework.stereotype.Service;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.FileReader
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.UUID
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicInteger
;
@Slf4j
...
...
@@ -80,15 +77,16 @@ public class BaiHangDataDisposeService {
}
@Async
public
void
encryptFieldAndCreateFile
(
String
sourceCollectFileName
,
String
sourceFilePath
,
String
targetFilePath
)
throws
Exception
{
public
void
encryptFieldAndCreateFile
(
String
sourceCollectFileName
,
String
sourceFilePath
,
String
targetFilePath
,
String
dataType
)
throws
Exception
{
File
collectFile
=
new
File
(
sourceFilePath
+
sourceCollectFileName
);
File
subFile
=
null
;
String
dataStr
=
null
,
contentStr
=
null
;
String
dataStr
=
null
,
contentStr
=
null
,
encryptFileName
=
null
;
BufferedReader
bis
=
null
;
LoanInfoZhuDaiVo
loanInfoZhuDaiVo
=
null
;
RepaymentInfoZhuDai
repaymentInfoZhuDai
=
null
;
List
<
String
>
reportList
=
null
;
List
<
String
>
fileNameList
=
FileUtils
.
readLines
(
collectFile
,
"utf-8"
);
List
<
String
>
encryptFileNameList
=
new
LinkedList
();
for
(
String
fileName
:
fileNameList
)
{
if
(
StringUtils
.
isNotBlank
(
fileName
))
{
reportList
=
new
ArrayList
<>(
INITIAL_CAPACITY
);
...
...
@@ -121,10 +119,15 @@ public class BaiHangDataDisposeService {
File
file
=
new
File
(
targetFilePath
+
fileName
.
replace
(
"-R.cry"
,
".txt"
));
FileUtils
.
writeLines
(
file
,
reportList
);
if
(
reportList
.
size
()>
1
)
{
baiHangFileReportService
.
createFile
(
file
.
getAbsolutePath
());
encryptFileName
=
baiHangFileReportService
.
createFile
(
file
.
getAbsolutePath
());
encryptFileNameList
.
add
(
encryptFileName
);
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
encryptFileNameList
))
{
File
file
=
new
File
(
targetFilePath
+
dataType
+
"_old_"
+
DateUtils
.
formatDate
(
new
Date
(),
"yyyyMMdd"
)
+
".txt"
);
FileUtils
.
writeLines
(
file
,
encryptFileNameList
,
Boolean
.
TRUE
);
}
IoUtil
.
close
(
bis
);
log
.
info
(
"encryptFieldAndCreateFile数据处理完成,集合文件名 {}"
,
sourceCollectFileName
);
}
...
...
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