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 10:24:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6dff141ce207a7ff5c83f00f77ea3baa840840f5
6dff141c
1 parent
b1d24cca
task|附件调整
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
7 deletions
server/common-dependencies/src/main/java/com/fedex/connect/common/dependencies/template/clearanceEmail/SendFailedEmailTemplate.java
server/task-schedule/src/main/java/com/fedex/connect/task/data/dto/PortFileDto.java
server/task-schedule/src/main/java/com/fedex/connect/task/data/dto/PushZipEmailDto.java
server/task-schedule/src/main/java/com/fedex/connect/task/service/biz/impl/PushConsignmentFileServiceImpl.java
server/task-schedule/src/main/java/com/fedex/connect/task/utils/sys/ConFileEmailUtil.java
server/common-dependencies/src/main/java/com/fedex/connect/common/dependencies/template/clearanceEmail/SendFailedEmailTemplate.java
View file @
6dff141
...
...
@@ -40,8 +40,7 @@ public class SendFailedEmailTemplate implements EmailTemplate {
" <p>2.【推送预清关文件】任务,系统启动后每{1}分钟轮巡一次。</p>\n"
+
" <p>3.【提醒发件人】任务,系统启动后每{2}分钟轮巡一次。</p>\n"
+
" <p>备注:邮件发送机制:</p>\n"
+
" <p>该预警邮件任务,系统启动后每30分钟执行一次,当日上述3个定时任务,有任何一个任务的最终判定为失败的记录数量大于5,则自动发送邮件通知FedEX IT,每个接口显示最新10条失败运单号、当日调用总次数、当日调用失败总次数。</p>\n"
+
" <p style=\"font-size:10px;\">(注:所有任务相关的数字均可以在系统配置界面调整)</p>"
;
" <p>该预警邮件任务,系统启动后每30分钟执行一次,当日上述3个定时任务,有任何一个任务的最终判定为失败的记录数量大于5,则自动发送邮件通知FedEX IT,每个接口显示最新10条失败运单号、当日调用总次数、当日调用失败总次数。</p>\n"
;
String
TABLE
=
"<table style=\"width: 100%;table-layout: fixed;padding: 20px;width: 100%;border-collapse: collapse;\">\n"
+
"<tr>\n"
+
...
...
server/task-schedule/src/main/java/com/fedex/connect/task/data/dto/PortFileDto.java
View file @
6dff141
...
...
@@ -11,4 +11,5 @@ public class PortFileDto {
private
String
shipperPhone
;
private
String
shipperAccount
;
private
String
originCountry
;
private
String
fileName
;
}
...
...
server/task-schedule/src/main/java/com/fedex/connect/task/data/dto/PushZipEmailDto.java
View file @
6dff141
package
com
.
fedex
.
connect
.
task
.
data
.
dto
;
import
com.fedex.connect.common.annotation.SensitiveEntity
;
import
com.fedex.connect.common.annotation.SensitiveField
;
import
lombok.Data
;
@Data
@SensitiveEntity
public
class
PushZipEmailDto
{
private
String
destIataCode
;
private
String
filePath
;
@SensitiveField
private
String
shipperContactName
;
private
String
shipperEmail
;
private
String
shipperPhone
;
...
...
server/task-schedule/src/main/java/com/fedex/connect/task/service/biz/impl/PushConsignmentFileServiceImpl.java
View file @
6dff141
...
...
@@ -67,7 +67,7 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush
//获取待发送的文件并打zip包
PortFileDto
portFileDto
=
new
PortFileDto
();
List
<
PushZipEmailDto
>
attachmentDetailsByBizId
=
attachmentExtRepository
.
findAttachmentDetailsByBizId
(
conPushEmail
.
getBizId
());
portFileDto
=
conFileEmailUtil
.
getPortZipMap
(
portFileDto
,
attachmentDetailsByBizId
,
tempPath
,
finalPath
,
zipUtils
);
portFileDto
=
conFileEmailUtil
.
getPortZipMap
(
portFileDto
,
attachmentDetailsByBizId
,
tempPath
,
finalPath
,
zipUtils
,
conPushEmail
.
getBizCode
()
);
//发送邮件
result
=
conFileEmailUtil
.
sendEmail
(
portFileDto
,
emailUtil
,
mailMessageReqDto
,
conPushEmail
);
//根据是否成功发送邮件对文件进行备份
...
...
server/task-schedule/src/main/java/com/fedex/connect/task/utils/sys/ConFileEmailUtil.java
View file @
6dff141
...
...
@@ -73,7 +73,7 @@ public class ConFileEmailUtil {
* @param zipUtils
* @return void
*/
public
PortFileDto
getPortZipMap
(
PortFileDto
portFileDto
,
List
<
PushZipEmailDto
>
attachmentDetailsByBizId
,
String
tempPath
,
String
finalPath
,
ZipUtils
zipUtils
)
throws
Exception
{
public
PortFileDto
getPortZipMap
(
PortFileDto
portFileDto
,
List
<
PushZipEmailDto
>
attachmentDetailsByBizId
,
String
tempPath
,
String
finalPath
,
ZipUtils
zipUtils
,
String
consignmentCode
)
throws
Exception
{
List
<
File
>
filesList
=
new
ArrayList
<>();
String
portCode
=
null
;
for
(
PushZipEmailDto
pushZipEmailDto
:
attachmentDetailsByBizId
)
{
...
...
@@ -92,8 +92,8 @@ public class ConFileEmailUtil {
portFileDto
.
setOriginCountry
(
pushZipEmailDto
.
getOriginCountry
());
}
String
date
=
DateUtil
.
yyyyMMddHHmmss
(
new
Date
());
String
fileName
=
date
+
BaseSeparatorConstants
.
SEPARATOR_UNDERLINE
+
por
tCode
+
BaseConstants
.
FILE_SUFFIX_KEYS
.
ZIP
;
String
fileNameTemp
=
date
+
BaseSeparatorConstants
.
SEPARATOR_UNDERLINE
+
por
tCode
+
BaseConstants
.
FILE_SUFFIX_KEYS
.
ZIP
+
BaseConstants
.
FILE_SUFFIX_KEYS
.
TEMP
;
String
fileName
=
date
+
BaseSeparatorConstants
.
SEPARATOR_UNDERLINE
+
consignmen
tCode
+
BaseConstants
.
FILE_SUFFIX_KEYS
.
ZIP
;
String
fileNameTemp
=
date
+
BaseSeparatorConstants
.
SEPARATOR_UNDERLINE
+
consignmen
tCode
+
BaseConstants
.
FILE_SUFFIX_KEYS
.
ZIP
+
BaseConstants
.
FILE_SUFFIX_KEYS
.
TEMP
;
FileOutputStream
fos
=
null
;
if
(
CollectionUtils
.
isEmpty
(
filesList
)){
return
portFileDto
;
...
...
@@ -112,6 +112,7 @@ public class ConFileEmailUtil {
portFileDto
.
setDestIataCode
(
portCode
);
portFileDto
.
setZipPath
(
finalPath
+
fileName
);
portFileDto
.
setFileName
(
fileName
);
}
catch
(
Exception
e
)
{
log
.
error
(
"生成压缩包错误:{}"
,
e
.
getMessage
(),
e
);
...
...
@@ -182,7 +183,7 @@ public class ConFileEmailUtil {
if
(!
StringUtils
.
isEmpty
(
portFileDto
.
getZipPath
())){
List
<
MailAttachmentBo
>
srcFiles
=
new
ArrayList
<>();
File
file
=
new
File
(
portFileDto
.
getZipPath
());
srcFiles
.
add
(
new
MailAttachmentBo
(
file
,
""
));
srcFiles
.
add
(
new
MailAttachmentBo
(
file
,
portFileDto
.
getFileName
()
));
mailConfigDto
.
setFileList
(
srcFiles
);
}
...
...
Please
register
or
login
to post a comment