Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
iClear-Connect-Pre-Clearance
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
zelong.shao
2024-12-25 19:22:41 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
df5a8b99ea54134e11bdcf59276a8cb59ea635a0
df5a8b99
1 parent
0bccd013
task|zip包临时目录调整
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
18 deletions
server/task-schedule/src/main/java/com/fedex/connect/task/utils/sys/ConFileEmailUtil.java
server/task-schedule/src/main/resources/application-dev.yml
server/task-schedule/src/main/resources/application-test.yml
server/task-schedule/src/main/java/com/fedex/connect/task/utils/sys/ConFileEmailUtil.java
View file @
df5a8b9
...
...
@@ -112,6 +112,7 @@ public class ConFileEmailUtil {
portFileDto
.
setDestIataCode
(
portCode
);
portFileDto
.
setZipPath
(
finalPath
+
fileName
);
log
.
error
(
"zipPath:"
+
finalPath
+
fileName
);
portFileDto
.
setFileName
(
fileName
);
}
catch
(
Exception
e
)
{
...
...
@@ -301,30 +302,24 @@ public class ConFileEmailUtil {
String
targetDirPath
=
null
;
try
{
// 获取文件的扩展名
String
extension
=
filePath
.
substring
(
filePath
.
lastIndexOf
(
"."
));
String
fileNameOld
=
file
.
getName
();
// 使用 getName() 获取文件名
// 生成新的文件名
String
timeStamp
=
DateUtil
.
yyyyMMddHHmmss
(
new
Date
());
String
fileName
=
String
.
format
(
"%s%s%s"
,
fileNameOld
,
timeStamp
,
extension
);
// 构建目标文件路径
targetDirPath
=
String
.
join
(
File
.
separator
,
propertiesConfig
.
getZipPath
(),
DateUtil
.
format
(
new
Date
()),
// 使用提前生成的时间戳,避免重复计算
conPushEmail
.
getBizCode
(),
file
Name
file
.
getName
()
);
// 获取目标目录,并创建目录(如果不存在)
File
targetDir
=
new
File
(
targetDirPath
).
getParentFile
();
if
(!
targetDir
.
exists
()
&&
targetDir
.
mkdirs
())
{
// 复制文件
nioFileUtils
.
copyFile
(
file
,
targetDirPath
);
// 删除临时文件
nioFileUtils
.
deleteTempFile
(
Paths
.
get
(
filePath
));
if
(!
targetDir
.
exists
()){
targetDir
.
mkdirs
();
}
// 复制文件
nioFileUtils
.
copyFile
(
file
,
targetDirPath
);
// 删除临时文件
nioFileUtils
.
deleteTempFile
(
Paths
.
get
(
filePath
));
}
catch
(
Exception
e
)
{
// 记录错误信息
...
...
server/task-schedule/src/main/resources/application-dev.yml
View file @
df5a8b9
...
...
@@ -57,5 +57,5 @@ imp001:
upload
:
path
:
zip
:
/app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zip
zipTemp
:
/app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipTemp
zipFinal
:
/app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipFinal
\ No newline at end of file
zipTemp
:
/app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipTemp/
zipFinal
:
/app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipFinal/
\ No newline at end of file
...
...
server/task-schedule/src/main/resources/application-test.yml
View file @
df5a8b9
...
...
@@ -53,5 +53,5 @@ imp001:
upload
:
path
:
zip
:
/app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zip
zipTemp
:
/app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipTemp
zipFinal
:
/app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipFinal
\ No newline at end of file
zipTemp
:
/app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipTemp/
zipFinal
:
/app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipFinal/
\ No newline at end of file
...
...
Please
register
or
login
to post a comment