Showing
5 changed files
with
12 additions
and
7 deletions
| ... | @@ -40,8 +40,7 @@ public class SendFailedEmailTemplate implements EmailTemplate { | ... | @@ -40,8 +40,7 @@ public class SendFailedEmailTemplate implements EmailTemplate { |
| 40 | " <p>2.【推送预清关文件】任务,系统启动后每{1}分钟轮巡一次。</p>\n" + | 40 | " <p>2.【推送预清关文件】任务,系统启动后每{1}分钟轮巡一次。</p>\n" + |
| 41 | " <p>3.【提醒发件人】任务,系统启动后每{2}分钟轮巡一次。</p>\n" + | 41 | " <p>3.【提醒发件人】任务,系统启动后每{2}分钟轮巡一次。</p>\n" + |
| 42 | " <p>备注:邮件发送机制:</p>\n" + | 42 | " <p>备注:邮件发送机制:</p>\n" + |
| 43 | - " <p>该预警邮件任务,系统启动后每30分钟执行一次,当日上述3个定时任务,有任何一个任务的最终判定为失败的记录数量大于5,则自动发送邮件通知FedEX IT,每个接口显示最新10条失败运单号、当日调用总次数、当日调用失败总次数。</p>\n" + | 43 | + " <p>该预警邮件任务,系统启动后每30分钟执行一次,当日上述3个定时任务,有任何一个任务的最终判定为失败的记录数量大于5,则自动发送邮件通知FedEX IT,每个接口显示最新10条失败运单号、当日调用总次数、当日调用失败总次数。</p>\n" ; |
| 44 | - " <p style=\"font-size:10px;\">(注:所有任务相关的数字均可以在系统配置界面调整)</p>"; | ||
| 45 | 44 | ||
| 46 | String TABLE = "<table style=\"width: 100%;table-layout: fixed;padding: 20px;width: 100%;border-collapse: collapse;\">\n" + | 45 | String TABLE = "<table style=\"width: 100%;table-layout: fixed;padding: 20px;width: 100%;border-collapse: collapse;\">\n" + |
| 47 | "<tr>\n" + | 46 | "<tr>\n" + | ... | ... |
| ... | @@ -11,4 +11,5 @@ public class PortFileDto { | ... | @@ -11,4 +11,5 @@ public class PortFileDto { |
| 11 | private String shipperPhone; | 11 | private String shipperPhone; |
| 12 | private String shipperAccount; | 12 | private String shipperAccount; |
| 13 | private String originCountry; | 13 | private String originCountry; |
| 14 | + private String fileName; | ||
| 14 | } | 15 | } | ... | ... |
| 1 | package com.fedex.connect.task.data.dto; | 1 | package com.fedex.connect.task.data.dto; |
| 2 | 2 | ||
| 3 | +import com.fedex.connect.common.annotation.SensitiveEntity; | ||
| 4 | +import com.fedex.connect.common.annotation.SensitiveField; | ||
| 3 | import lombok.Data; | 5 | import lombok.Data; |
| 4 | @Data | 6 | @Data |
| 7 | +@SensitiveEntity | ||
| 5 | public class PushZipEmailDto { | 8 | public class PushZipEmailDto { |
| 6 | private String destIataCode; | 9 | private String destIataCode; |
| 7 | private String filePath; | 10 | private String filePath; |
| 11 | + @SensitiveField | ||
| 8 | private String shipperContactName; | 12 | private String shipperContactName; |
| 9 | private String shipperEmail; | 13 | private String shipperEmail; |
| 10 | private String shipperPhone; | 14 | private String shipperPhone; | ... | ... |
| ... | @@ -67,7 +67,7 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush | ... | @@ -67,7 +67,7 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush |
| 67 | //获取待发送的文件并打zip包 | 67 | //获取待发送的文件并打zip包 |
| 68 | PortFileDto portFileDto = new PortFileDto(); | 68 | PortFileDto portFileDto = new PortFileDto(); |
| 69 | List<PushZipEmailDto> attachmentDetailsByBizId = attachmentExtRepository.findAttachmentDetailsByBizId(conPushEmail.getBizId()); | 69 | List<PushZipEmailDto> attachmentDetailsByBizId = attachmentExtRepository.findAttachmentDetailsByBizId(conPushEmail.getBizId()); |
| 70 | - portFileDto = conFileEmailUtil.getPortZipMap(portFileDto, attachmentDetailsByBizId, tempPath, finalPath, zipUtils); | 70 | + portFileDto = conFileEmailUtil.getPortZipMap(portFileDto, attachmentDetailsByBizId, tempPath, finalPath, zipUtils,conPushEmail.getBizCode()); |
| 71 | //发送邮件 | 71 | //发送邮件 |
| 72 | result = conFileEmailUtil.sendEmail(portFileDto, emailUtil,mailMessageReqDto,conPushEmail); | 72 | result = conFileEmailUtil.sendEmail(portFileDto, emailUtil,mailMessageReqDto,conPushEmail); |
| 73 | //根据是否成功发送邮件对文件进行备份 | 73 | //根据是否成功发送邮件对文件进行备份 | ... | ... |
| ... | @@ -73,7 +73,7 @@ public class ConFileEmailUtil { | ... | @@ -73,7 +73,7 @@ public class ConFileEmailUtil { |
| 73 | * @param zipUtils | 73 | * @param zipUtils |
| 74 | * @return void | 74 | * @return void |
| 75 | */ | 75 | */ |
| 76 | - public PortFileDto getPortZipMap(PortFileDto portFileDto, List<PushZipEmailDto> attachmentDetailsByBizId, String tempPath, String finalPath, ZipUtils zipUtils) throws Exception{ | 76 | + public PortFileDto getPortZipMap(PortFileDto portFileDto, List<PushZipEmailDto> attachmentDetailsByBizId, String tempPath, String finalPath, ZipUtils zipUtils,String consignmentCode) throws Exception{ |
| 77 | List<File> filesList = new ArrayList<>(); | 77 | List<File> filesList = new ArrayList<>(); |
| 78 | String portCode = null; | 78 | String portCode = null; |
| 79 | for (PushZipEmailDto pushZipEmailDto : attachmentDetailsByBizId) { | 79 | for (PushZipEmailDto pushZipEmailDto : attachmentDetailsByBizId) { |
| ... | @@ -92,8 +92,8 @@ public class ConFileEmailUtil { | ... | @@ -92,8 +92,8 @@ public class ConFileEmailUtil { |
| 92 | portFileDto.setOriginCountry(pushZipEmailDto.getOriginCountry()); | 92 | portFileDto.setOriginCountry(pushZipEmailDto.getOriginCountry()); |
| 93 | } | 93 | } |
| 94 | String date = DateUtil.yyyyMMddHHmmss(new Date()); | 94 | String date = DateUtil.yyyyMMddHHmmss(new Date()); |
| 95 | - String fileName = date + BaseSeparatorConstants.SEPARATOR_UNDERLINE + portCode + BaseConstants.FILE_SUFFIX_KEYS.ZIP; | 95 | + String fileName = date + BaseSeparatorConstants.SEPARATOR_UNDERLINE + consignmentCode + BaseConstants.FILE_SUFFIX_KEYS.ZIP; |
| 96 | - String fileNameTemp = date + BaseSeparatorConstants.SEPARATOR_UNDERLINE + portCode + BaseConstants.FILE_SUFFIX_KEYS.ZIP + BaseConstants.FILE_SUFFIX_KEYS.TEMP; | 96 | + String fileNameTemp = date + BaseSeparatorConstants.SEPARATOR_UNDERLINE + consignmentCode + BaseConstants.FILE_SUFFIX_KEYS.ZIP + BaseConstants.FILE_SUFFIX_KEYS.TEMP; |
| 97 | FileOutputStream fos = null; | 97 | FileOutputStream fos = null; |
| 98 | if (CollectionUtils.isEmpty(filesList)){ | 98 | if (CollectionUtils.isEmpty(filesList)){ |
| 99 | return portFileDto; | 99 | return portFileDto; |
| ... | @@ -112,6 +112,7 @@ public class ConFileEmailUtil { | ... | @@ -112,6 +112,7 @@ public class ConFileEmailUtil { |
| 112 | 112 | ||
| 113 | portFileDto.setDestIataCode(portCode); | 113 | portFileDto.setDestIataCode(portCode); |
| 114 | portFileDto.setZipPath(finalPath + fileName); | 114 | portFileDto.setZipPath(finalPath + fileName); |
| 115 | + portFileDto.setFileName(fileName); | ||
| 115 | 116 | ||
| 116 | } catch (Exception e) { | 117 | } catch (Exception e) { |
| 117 | log.error("生成压缩包错误:{}", e.getMessage(), e); | 118 | log.error("生成压缩包错误:{}", e.getMessage(), e); |
| ... | @@ -182,7 +183,7 @@ public class ConFileEmailUtil { | ... | @@ -182,7 +183,7 @@ public class ConFileEmailUtil { |
| 182 | if (!StringUtils.isEmpty(portFileDto.getZipPath())){ | 183 | if (!StringUtils.isEmpty(portFileDto.getZipPath())){ |
| 183 | List<MailAttachmentBo> srcFiles = new ArrayList<>(); | 184 | List<MailAttachmentBo> srcFiles = new ArrayList<>(); |
| 184 | File file = new File(portFileDto.getZipPath()); | 185 | File file = new File(portFileDto.getZipPath()); |
| 185 | - srcFiles.add(new MailAttachmentBo(file, "")); | 186 | + srcFiles.add(new MailAttachmentBo(file, portFileDto.getFileName())); |
| 186 | mailConfigDto.setFileList(srcFiles); | 187 | mailConfigDto.setFileList(srcFiles); |
| 187 | } | 188 | } |
| 188 | 189 | ... | ... |
-
Please register or login to post a comment