Showing
17 changed files
with
85 additions
and
40 deletions
| 1 | package com.fedex.connect.customer.controller.biz.impl; | 1 | package com.fedex.connect.customer.controller.biz.impl; |
| 2 | 2 | ||
| 3 | +import com.fedex.connect.common.dependencies.annotation.OperationMethodLog; | ||
| 4 | +import com.fedex.connect.common.dependencies.contants.AnnotationConstants; | ||
| 5 | +import com.fedex.connect.common.dependencies.util.FileUtil; | ||
| 3 | import com.fedex.connect.customer.controller.base.BaseController; | 6 | import com.fedex.connect.customer.controller.base.BaseController; |
| 4 | import com.fedex.connect.customer.controller.biz.IAttachmentController; | 7 | import com.fedex.connect.customer.controller.biz.IAttachmentController; |
| 5 | import io.swagger.annotations.Api; | 8 | import io.swagger.annotations.Api; |
| 9 | +import io.swagger.annotations.ApiOperation; | ||
| 6 | import lombok.extern.slf4j.Slf4j; | 10 | import lombok.extern.slf4j.Slf4j; |
| 11 | +import org.springframework.web.bind.annotation.GetMapping; | ||
| 7 | import org.springframework.web.bind.annotation.RequestMapping; | 12 | import org.springframework.web.bind.annotation.RequestMapping; |
| 13 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 8 | import org.springframework.web.bind.annotation.RestController; | 14 | import org.springframework.web.bind.annotation.RestController; |
| 9 | 15 | ||
| 16 | +import javax.servlet.http.HttpServletRequest; | ||
| 17 | +import javax.servlet.http.HttpServletResponse; | ||
| 18 | + | ||
| 10 | /** | 19 | /** |
| 11 | * @Author Szl | 20 | * @Author Szl |
| 12 | * @Description 类说明 附件相关 | 21 | * @Description 类说明 附件相关 |
| ... | @@ -18,4 +27,15 @@ import org.springframework.web.bind.annotation.RestController; | ... | @@ -18,4 +27,15 @@ import org.springframework.web.bind.annotation.RestController; |
| 18 | @Api(value = "AttachmentControllerImpl", tags = {"附件操作相关"}) | 27 | @Api(value = "AttachmentControllerImpl", tags = {"附件操作相关"}) |
| 19 | public class AttachmentController extends BaseController implements IAttachmentController { | 28 | public class AttachmentController extends BaseController implements IAttachmentController { |
| 20 | 29 | ||
| 30 | + @GetMapping(value = "/downLoadFile") | ||
| 31 | + @OperationMethodLog(describe = "business_log_20008",remarkType = AnnotationConstants.LOG_REMARK_TYPE_SPECIAL,status = AnnotationConstants.LOG_STATUS_SHOW) | ||
| 32 | + @ApiOperation(value = "下载单个文件") | ||
| 33 | + public void downLoadFile(HttpServletRequest request, HttpServletResponse response, | ||
| 34 | + @RequestParam(name = "path") String path, @RequestParam(name = "name") String name) throws Exception { | ||
| 35 | + | ||
| 36 | + name = new String(name.getBytes("UTF-8"), "ISO-8859-1"); | ||
| 37 | + String contentType = FileUtil.getContentType(name); | ||
| 38 | + response.setHeader("Content-Disposition", "attachment;filename=" + name +";content-type:"+contentType); | ||
| 39 | + FileUtil.download(request, response, path + FileUtil.SIGN, name,contentType); | ||
| 40 | + } | ||
| 21 | } | 41 | } | ... | ... |
| ... | @@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.RestController; | ... | @@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.RestController; |
| 26 | public class UploadRecordController extends BaseController implements IUploadRecordController { | 26 | public class UploadRecordController extends BaseController implements IUploadRecordController { |
| 27 | 27 | ||
| 28 | @Override | 28 | @Override |
| 29 | - @PostMapping("/queryHistoryList/{consignmentId}") | 29 | + @PostMapping("/queryHistoryList") |
| 30 | @ApiOperation(value = "ResponseVo", notes = "运单历史上传记录查询") | 30 | @ApiOperation(value = "ResponseVo", notes = "运单历史上传记录查询") |
| 31 | @OperationMethodLog(describe = "business_log_20006") | 31 | @OperationMethodLog(describe = "business_log_20006") |
| 32 | public ResponseVo queryHistoryList(@RequestBody AttachmentHistoryQuery attachmentHistoryQuery) { | 32 | public ResponseVo queryHistoryList(@RequestBody AttachmentHistoryQuery attachmentHistoryQuery) { | ... | ... |
| ... | @@ -8,6 +8,7 @@ import com.fedex.connect.customer.data.query.ConsignmentQuery; | ... | @@ -8,6 +8,7 @@ import com.fedex.connect.customer.data.query.ConsignmentQuery; |
| 8 | import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; | 8 | import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; |
| 9 | import com.fedex.connect.customer.repository.base.BaseDao; | 9 | import com.fedex.connect.customer.repository.base.BaseDao; |
| 10 | import com.fedex.connect.customer.repository.repo.IConsignmentRepository; | 10 | import com.fedex.connect.customer.repository.repo.IConsignmentRepository; |
| 11 | +import org.apache.commons.lang3.StringUtils; | ||
| 11 | import org.springframework.stereotype.Repository; | 12 | import org.springframework.stereotype.Repository; |
| 12 | 13 | ||
| 13 | import java.time.LocalDate; | 14 | import java.time.LocalDate; |
| ... | @@ -45,7 +46,7 @@ public class ConsignmentRepositoryImpl extends BaseDao implements IConsignmentRe | ... | @@ -45,7 +46,7 @@ public class ConsignmentRepositoryImpl extends BaseDao implements IConsignmentRe |
| 45 | if (SystemDefaultUserConstants.SYSTEM_USER_KEYS.USER_NAME.equals(consignment.getCreateUserName())){ | 46 | if (SystemDefaultUserConstants.SYSTEM_USER_KEYS.USER_NAME.equals(consignment.getCreateUserName())){ |
| 46 | consignment.setCreateUserName(user.getUserName()); | 47 | consignment.setCreateUserName(user.getUserName()); |
| 47 | } | 48 | } |
| 48 | - if (!user.getUserUuid().equals(consignment.getUserUuid()) && !user.getAccountNo().equals(consignment.getShipperAccount())){ | 49 | + if (!user.getUserUuid().equals(consignment.getUserUuid()) && (!StringUtils.isEmpty(user.getAccountNo()) && !user.getAccountNo().equals(consignment.getShipperAccount()))){ |
| 49 | consignment.setRecipientContactName(null); | 50 | consignment.setRecipientContactName(null); |
| 50 | consignment.setRecipientCompany(null); | 51 | consignment.setRecipientCompany(null); |
| 51 | consignment.setDocNondocFlag(null); | 52 | consignment.setDocNondocFlag(null); | ... | ... |
| ... | @@ -129,7 +129,7 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS | ... | @@ -129,7 +129,7 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS |
| 129 | /** | 129 | /** |
| 130 | * 初始化上传记录信息 | 130 | * 初始化上传记录信息 |
| 131 | */ | 131 | */ |
| 132 | - UploadRecord uploadRecord = uploadRecordUtil.initUploadRecord(consignment.getConsignmentCode()); | 132 | + UploadRecord uploadRecord = uploadRecordUtil.initUploadRecord(consignment.getConsignmentCode(),user); |
| 133 | /** | 133 | /** |
| 134 | * 保存运单相关信息 | 134 | * 保存运单相关信息 |
| 135 | */ | 135 | */ | ... | ... |
| ... | @@ -50,7 +50,7 @@ public class AttachmentUtil { | ... | @@ -50,7 +50,7 @@ public class AttachmentUtil { |
| 50 | * @return void | 50 | * @return void |
| 51 | */ | 51 | */ |
| 52 | private void initAttachment(Attachment attachment,String bizType,User user) throws Exception{ | 52 | private void initAttachment(Attachment attachment,String bizType,User user) throws Exception{ |
| 53 | - DictionaryEntries attachmentBizTypeEntries = cacheSystem.getDicAttachmentBizType(bizType); | 53 | + DictionaryEntries attachmentBizTypeEntries = cacheSystem.getDicAttachmentBizType(AttachmentBizTypeEnum.getCodeByExt1(bizType)); |
| 54 | attachment.setBizTypeCode(attachmentBizTypeEntries.getCode()); | 54 | attachment.setBizTypeCode(attachmentBizTypeEntries.getCode()); |
| 55 | attachment.setBizTypeName(attachmentBizTypeEntries.getEnglishName()); | 55 | attachment.setBizTypeName(attachmentBizTypeEntries.getEnglishName()); |
| 56 | DictionaryEntries attachmentFileTypeEntries = cacheSystem.getDicAttachmentFileType(AttachmentFileTypeEnum.FILE.getCode()); | 56 | DictionaryEntries attachmentFileTypeEntries = cacheSystem.getDicAttachmentFileType(AttachmentFileTypeEnum.FILE.getCode()); |
| ... | @@ -108,7 +108,7 @@ public class AttachmentUtil { | ... | @@ -108,7 +108,7 @@ public class AttachmentUtil { |
| 108 | //用户上传原文件名称 | 108 | //用户上传原文件名称 |
| 109 | attachment.setSourceFileName(sourceFileName); | 109 | attachment.setSourceFileName(sourceFileName); |
| 110 | //生成系统文件名称例子:AWB_123456789012_20241023164532982_001.pdf | 110 | //生成系统文件名称例子:AWB_123456789012_20241023164532982_001.pdf |
| 111 | - String fileName = AttachmentBizTypeEnum.getExt1ByCode(bizType) + BaseSeparatorConstants.SEPARATOR_UNDERLINE + | 111 | + String fileName = bizType + BaseSeparatorConstants.SEPARATOR_UNDERLINE + |
| 112 | consignmentCode + BaseSeparatorConstants.SEPARATOR_UNDERLINE + fileSuffix + suffix; | 112 | consignmentCode + BaseSeparatorConstants.SEPARATOR_UNDERLINE + fileSuffix + suffix; |
| 113 | //系统生成文件名称 | 113 | //系统生成文件名称 |
| 114 | attachment.setFileName(fileName); | 114 | attachment.setFileName(fileName); |
| ... | @@ -142,6 +142,7 @@ public class AttachmentUtil { | ... | @@ -142,6 +142,7 @@ public class AttachmentUtil { |
| 142 | 142 | ||
| 143 | public static MultipartFile findFileByName(MultipartFile[] files, String fileName) { | 143 | public static MultipartFile findFileByName(MultipartFile[] files, String fileName) { |
| 144 | for (MultipartFile file : files) { | 144 | for (MultipartFile file : files) { |
| 145 | + log.info("fileName:" + file.getOriginalFilename()); | ||
| 145 | if (file.getOriginalFilename().equals(fileName)) { | 146 | if (file.getOriginalFilename().equals(fileName)) { |
| 146 | return file; // 找到匹配的文件,返回该文件 | 147 | return file; // 找到匹配的文件,返回该文件 |
| 147 | } | 148 | } | ... | ... |
| ... | @@ -6,6 +6,7 @@ import com.fedex.connect.common.dependencies.enums.biz.ConsignmentStatusEnum; | ... | @@ -6,6 +6,7 @@ import com.fedex.connect.common.dependencies.enums.biz.ConsignmentStatusEnum; |
| 6 | import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils; | 6 | import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils; |
| 7 | import com.fedex.connect.common.model.bi.DictionaryEntries; | 7 | import com.fedex.connect.common.model.bi.DictionaryEntries; |
| 8 | import com.fedex.connect.common.model.biz.UploadRecord; | 8 | import com.fedex.connect.common.model.biz.UploadRecord; |
| 9 | +import com.fedex.connect.common.model.sys.User; | ||
| 9 | import lombok.extern.slf4j.Slf4j; | 10 | import lombok.extern.slf4j.Slf4j; |
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | import org.springframework.stereotype.Component; | 12 | import org.springframework.stereotype.Component; |
| ... | @@ -28,7 +29,7 @@ public class UploadRecordUtil { | ... | @@ -28,7 +29,7 @@ public class UploadRecordUtil { |
| 28 | * @param consignmentCode | 29 | * @param consignmentCode |
| 29 | * @return com.fedex.connect.common.model.biz.UploadRecord | 30 | * @return com.fedex.connect.common.model.biz.UploadRecord |
| 30 | */ | 31 | */ |
| 31 | - public UploadRecord initUploadRecord(String consignmentCode) throws Exception{ | 32 | + public UploadRecord initUploadRecord(String consignmentCode, User user) throws Exception{ |
| 32 | DictionaryEntries consignmentStatusDic = cacheSystem.getDicConsignmentStatus(ConsignmentStatusEnum.CONSIGNMENT_STATUS_01.getCode()); | 33 | DictionaryEntries consignmentStatusDic = cacheSystem.getDicConsignmentStatus(ConsignmentStatusEnum.CONSIGNMENT_STATUS_01.getCode()); |
| 33 | UploadRecord uploadRecord = new UploadRecord(); | 34 | UploadRecord uploadRecord = new UploadRecord(); |
| 34 | //记录当前运单号 | 35 | //记录当前运单号 |
| ... | @@ -36,6 +37,10 @@ public class UploadRecordUtil { | ... | @@ -36,6 +37,10 @@ public class UploadRecordUtil { |
| 36 | //记录当前运单状态 | 37 | //记录当前运单状态 |
| 37 | uploadRecord.setStatusCode(consignmentStatusDic.getCode()); | 38 | uploadRecord.setStatusCode(consignmentStatusDic.getCode()); |
| 38 | uploadRecord.setStatusName(consignmentStatusDic.getEnglishName()); | 39 | uploadRecord.setStatusName(consignmentStatusDic.getEnglishName()); |
| 40 | + uploadRecord.setCreateUserId(user.getId()); | ||
| 41 | + uploadRecord.setCreateUserName(user.getUserName()); | ||
| 42 | + uploadRecord.setModifyUserId(user.getId()); | ||
| 43 | + uploadRecord.setModifyUserName(user.getUserName()); | ||
| 39 | /** | 44 | /** |
| 40 | * 初始化基础字段 | 45 | * 初始化基础字段 |
| 41 | */ | 46 | */ | ... | ... |
| ... | @@ -6,6 +6,7 @@ business_log_20004=运单详细信息查询 | ... | @@ -6,6 +6,7 @@ business_log_20004=运单详细信息查询 |
| 6 | business_log_20005=根据运单ID查询用户上传记录 | 6 | business_log_20005=根据运单ID查询用户上传记录 |
| 7 | business_log_20006=运单历史上传记录查询 | 7 | business_log_20006=运单历史上传记录查询 |
| 8 | business_log_20007=上传历史附件记录 | 8 | business_log_20007=上传历史附件记录 |
| 9 | +business_log_20008=下载附件 | ||
| 9 | system_exception_20003=提示信息过长,未保存成功 | 10 | system_exception_20003=提示信息过长,未保存成功 |
| 10 | 11 | ||
| 11 | #******************鉴权相关提示,需要做国际化****************** | 12 | #******************鉴权相关提示,需要做国际化****************** | ... | ... |
| ... | @@ -6,6 +6,7 @@ business_log_20004=运单详细信息查询 | ... | @@ -6,6 +6,7 @@ business_log_20004=运单详细信息查询 |
| 6 | business_log_20005=根据运单ID查询用户上传记录 | 6 | business_log_20005=根据运单ID查询用户上传记录 |
| 7 | business_log_20006=运单历史上传记录查询 | 7 | business_log_20006=运单历史上传记录查询 |
| 8 | business_log_20007=上传历史附件记录 | 8 | business_log_20007=上传历史附件记录 |
| 9 | +business_log_20008=下载附件 | ||
| 9 | system_exception_20003=提示信息过长,未保存成功 | 10 | system_exception_20003=提示信息过长,未保存成功 |
| 10 | 11 | ||
| 11 | #******************鉴权相关提示,需要做国际化****************** | 12 | #******************鉴权相关提示,需要做国际化****************** | ... | ... |
| ... | @@ -65,4 +65,14 @@ public enum AttachmentBizTypeEnum { | ... | @@ -65,4 +65,14 @@ public enum AttachmentBizTypeEnum { |
| 65 | } | 65 | } |
| 66 | return null; // 如果没有找到匹配的 code,返回 null | 66 | return null; // 如果没有找到匹配的 code,返回 null |
| 67 | } | 67 | } |
| 68 | + | ||
| 69 | + public static String getCodeByExt1(String ext1) { | ||
| 70 | + for (AttachmentBizTypeEnum type : AttachmentBizTypeEnum.values()) { | ||
| 71 | + if (type.getExt1().equals(ext1)) { | ||
| 72 | + return type.getCode(); | ||
| 73 | + } | ||
| 74 | + } | ||
| 75 | + return null; // 如果没有找到匹配的 ext1,返回 null | ||
| 76 | + } | ||
| 77 | + | ||
| 68 | } | 78 | } | ... | ... |
| ... | @@ -28,17 +28,20 @@ public class DuplicateEmailTemplate implements EmailTemplate { | ... | @@ -28,17 +28,20 @@ public class DuplicateEmailTemplate implements EmailTemplate { |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | interface CLEARANCE_TITLE{ | 30 | interface CLEARANCE_TITLE{ |
| 31 | - String TITLE = "Sender Reminder:"; | 31 | + String TITLE = "Create waybill({0}) reminder"; |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | interface CLEARANCE_BODY{ | 34 | interface CLEARANCE_BODY{ |
| 35 | - String DESCRIPTION = "<p>Sender Reminder: The task will poll every {0} minutes after the system starts.</p>\n"; | 35 | + String DESCRIPTION = "<p>This email is a reminder email, please do not reply!</p>\n"; |
| 36 | 36 | ||
| 37 | String BODY = "<div><div style='margin-left:4%;'>" + | 37 | String BODY = "<div><div style='margin-left:4%;'>" + |
| 38 | - "<p align='center'><img src='{0}'></p>" + | 38 | + //"<p align='center'><img src='{0}'></p>" + |
| 39 | - "<p align='center'><img src='{1}'></p>" + | 39 | + //"<p align='center'><img src='{1}'></p>" + |
| 40 | - "<p>Import Pre-Clearance System Notification:</p>" + | 40 | + "<p>FedEx iClear Connect System Notification:</p>" + |
| 41 | - "<p> {2}The consignment has been created and uploaded by another user.</p>" + | 41 | + "<p> The waybill with tracking number {0} has been created by someone else. Please verify!</p>" + |
| 42 | - "</font><br/><br/>"; | 42 | + "</font><br/><br/>" + |
| 43 | + "<div style=color:#808080;font-style:Arial;font-size:14px;margin: auto;margin-bottom: 5px;>" + | ||
| 44 | + "{1}\n" + | ||
| 45 | + "</div>"; | ||
| 43 | } | 46 | } |
| 44 | } | 47 | } | ... | ... |
server/common-dependencies/src/main/java/com/fedex/connect/common/dependencies/util/FileUtil.java
0 → 100644
This diff is collapsed. Click to expand it.
| ... | @@ -86,8 +86,13 @@ public class ResponseUtils { | ... | @@ -86,8 +86,13 @@ public class ResponseUtils { |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | public <T> ResponseVo success(T data) { | 88 | public <T> ResponseVo success(T data) { |
| 89 | + if (data instanceof Enum) { | ||
| 90 | + ResponseCodeBo responseCodeBo = this.ref(data); | ||
| 91 | + return new ResponseVo<>(200, responseCodeBo.getErrMsg(), null); | ||
| 92 | + } else { | ||
| 89 | return new ResponseVo<>(data); | 93 | return new ResponseVo<>(data); |
| 90 | } | 94 | } |
| 95 | + } | ||
| 91 | 96 | ||
| 92 | public String msg(String msg){ | 97 | public String msg(String msg){ |
| 93 | String message = localeMessageUtil.getMessage(msg); | 98 | String message = localeMessageUtil.getMessage(msg); | ... | ... |
| ... | @@ -52,7 +52,7 @@ public class Dm501Consignments implements Serializable { | ... | @@ -52,7 +52,7 @@ public class Dm501Consignments implements Serializable { |
| 52 | //扫描状态日期 | 52 | //扫描状态日期 |
| 53 | Date scanDate; | 53 | Date scanDate; |
| 54 | //用户uuid | 54 | //用户uuid |
| 55 | - String uuid; | 55 | + String userId; |
| 56 | //发件人邮箱 | 56 | //发件人邮箱 |
| 57 | String shipperEmail; | 57 | String shipperEmail; |
| 58 | 58 | ... | ... |
| 1 | package com.fedex.connect.kafka.util; | 1 | package com.fedex.connect.kafka.util; |
| 2 | 2 | ||
| 3 | import com.fedex.connect.common.dependencies.cache.CacheSystem; | 3 | import com.fedex.connect.common.dependencies.cache.CacheSystem; |
| 4 | -import com.fedex.connect.common.dependencies.enums.biz.ConsignmentStatusEnum; | ||
| 5 | import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils; | 4 | import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils; |
| 6 | import com.fedex.connect.common.dependencies.util.DateUtil; | 5 | import com.fedex.connect.common.dependencies.util.DateUtil; |
| 7 | import com.fedex.connect.common.model.bi.DictionaryEntries; | 6 | import com.fedex.connect.common.model.bi.DictionaryEntries; |
| ... | @@ -108,7 +107,7 @@ public class Dm501Util { | ... | @@ -108,7 +107,7 @@ public class Dm501Util { |
| 108 | //重量单位 | 107 | //重量单位 |
| 109 | ceInfo.setWeightunit(dm501Consignment.getWeightUnit()); | 108 | ceInfo.setWeightunit(dm501Consignment.getWeightUnit()); |
| 110 | //用户uuid | 109 | //用户uuid |
| 111 | - ceInfo.setUserUuid(dm501Consignment.getUuid()); | 110 | + ceInfo.setUserUuid(dm501Consignment.getUserId()); |
| 112 | //发件人邮箱 | 111 | //发件人邮箱 |
| 113 | ceInfo.setShipperEmail(dm501Consignment.getShipperEmail()); | 112 | ceInfo.setShipperEmail(dm501Consignment.getShipperEmail()); |
| 114 | //参考信息 | 113 | //参考信息 | ... | ... |
| ... | @@ -9,4 +9,8 @@ | ... | @@ -9,4 +9,8 @@ |
| 9 | <library-name>lib4iClearConnect</library-name> | 9 | <library-name>lib4iClearConnect</library-name> |
| 10 | <specification-version>1.0</specification-version> | 10 | <specification-version>1.0</specification-version> |
| 11 | </wls:library-ref> | 11 | </wls:library-ref> |
| 12 | + <wls:virtual-directory-mapping> | ||
| 13 | + <wls:local-path>/app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect</wls:local-path> | ||
| 14 | + <wls:url-pattern>/*</wls:url-pattern> | ||
| 15 | + </wls:virtual-directory-mapping> | ||
| 12 | </wls:weblogic-web-app> | 16 | </wls:weblogic-web-app> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -25,11 +25,11 @@ public class EmailJob { | ... | @@ -25,11 +25,11 @@ public class EmailJob { |
| 25 | * @param | 25 | * @param |
| 26 | * @return void | 26 | * @return void |
| 27 | */ | 27 | */ |
| 28 | - //@ProcessingInterval(paramCode = ParamConfigConstants.TASK_PARAM_KEYS.NOTIFICATION_SENDER_EMAIL_INTERVAL) | 28 | + @ProcessingInterval(paramCode = ParamConfigConstants.TASK_PARAM_KEYS.NOTIFICATION_SENDER_EMAIL_INTERVAL) |
| 29 | - //@Scheduled(cron = "${export.task.allocation.sendOb}") | 29 | + @Scheduled(cron = "${export.task.allocation.sendOb}") |
| 30 | - //public void notificationSenderTask() { | 30 | + public void notificationSenderTask() { |
| 31 | - // duplicateConsignmentEmailService.duplicateConsignmentEmail(); | 31 | + duplicateConsignmentEmailService.duplicateConsignmentEmail(); |
| 32 | - //} | 32 | + } |
| 33 | 33 | ||
| 34 | /** | 34 | /** |
| 35 | * @Author Szl | 35 | * @Author Szl |
| ... | @@ -38,15 +38,15 @@ public class EmailJob { | ... | @@ -38,15 +38,15 @@ public class EmailJob { |
| 38 | * @param | 38 | * @param |
| 39 | * @return void | 39 | * @return void |
| 40 | */ | 40 | */ |
| 41 | - @ProcessingInterval(paramCode = ParamConfigConstants.TASK_PARAM_KEYS.PUSH_CON_EMAIL_INTERVAL) | 41 | + //@ProcessingInterval(paramCode = ParamConfigConstants.TASK_PARAM_KEYS.PUSH_CON_EMAIL_INTERVAL) |
| 42 | - @Scheduled(cron = "${export.task.allocation.sendOb}") | 42 | + //@Scheduled(cron = "${export.task.allocation.sendOb}") |
| 43 | - public void pushConsignmentFileTask() { | 43 | + //public void pushConsignmentFileTask() { |
| 44 | - pushConsignmentFileService.pushConsignmentFileTask(); | 44 | + // pushConsignmentFileService.pushConsignmentFileTask(); |
| 45 | - } | 45 | + //} |
| 46 | - | 46 | + // |
| 47 | - /** | 47 | + ///** |
| 48 | - * 发送失败邮件提醒 | 48 | + // * 发送失败邮件提醒 |
| 49 | - */ | 49 | + // */ |
| 50 | //@ProcessingInterval(paramCode = ParamConfigConstants.TASK_PARAM_KEYS.SEND_FAIL_ALERT_INTERVAL) | 50 | //@ProcessingInterval(paramCode = ParamConfigConstants.TASK_PARAM_KEYS.SEND_FAIL_ALERT_INTERVAL) |
| 51 | //@Scheduled(cron = "${export.task.allocation.sendOb}") | 51 | //@Scheduled(cron = "${export.task.allocation.sendOb}") |
| 52 | //public void sendingFailedEmailAlert() { | 52 | //public void sendingFailedEmailAlert() { | ... | ... |
| 1 | package com.fedex.connect.task.utils.sys; | 1 | package com.fedex.connect.task.utils.sys; |
| 2 | 2 | ||
| 3 | import com.fedex.connect.common.dependencies.cache.CacheSystem; | 3 | import com.fedex.connect.common.dependencies.cache.CacheSystem; |
| 4 | -import com.fedex.connect.common.dependencies.contants.ParamConfigConstants; | ||
| 5 | import com.fedex.connect.common.dependencies.enums.biz.EmailStatusEnum; | 4 | import com.fedex.connect.common.dependencies.enums.biz.EmailStatusEnum; |
| 6 | import com.fedex.connect.common.dependencies.template.clearanceEmail.DuplicateEmailTemplate; | 5 | import com.fedex.connect.common.dependencies.template.clearanceEmail.DuplicateEmailTemplate; |
| 7 | import com.fedex.connect.common.model.bi.DictionaryEntries; | 6 | import com.fedex.connect.common.model.bi.DictionaryEntries; |
| 8 | import com.fedex.connect.common.model.biz.Email; | 7 | import com.fedex.connect.common.model.biz.Email; |
| 9 | import com.fedex.connect.common.model.log.EmailHistory; | 8 | import com.fedex.connect.common.model.log.EmailHistory; |
| 10 | -import com.fedex.connect.common.model.sys.ParamConfig; | ||
| 11 | import com.fedex.connect.task.config.PropertiesConfig; | 9 | import com.fedex.connect.task.config.PropertiesConfig; |
| 12 | import com.fedex.connect.task.data.dto.MailConfigDto; | 10 | import com.fedex.connect.task.data.dto.MailConfigDto; |
| 13 | import com.fedex.connect.task.repository.repo.biz.IEmailRepository; | 11 | import com.fedex.connect.task.repository.repo.biz.IEmailRepository; |
| ... | @@ -59,7 +57,7 @@ public class DuplicateEmailUtil { | ... | @@ -59,7 +57,7 @@ public class DuplicateEmailUtil { |
| 59 | mailConfigDto.setReceiveAccount(email.getToAddress()); | 57 | mailConfigDto.setReceiveAccount(email.getToAddress()); |
| 60 | 58 | ||
| 61 | //设置邮件标题 | 59 | //设置邮件标题 |
| 62 | - mailConfigDto.setSubject(duplicateEmailTemplate.getTitle()); | 60 | + mailConfigDto.setSubject(duplicateEmailTemplate.getTitle(email.getBizCode())); |
| 63 | String emailBody = this.createEmailBody(email.getBizCode()); | 61 | String emailBody = this.createEmailBody(email.getBizCode()); |
| 64 | mailConfigDto.setContent(emailBody); | 62 | mailConfigDto.setContent(emailBody); |
| 65 | 63 | ||
| ... | @@ -89,14 +87,11 @@ public class DuplicateEmailUtil { | ... | @@ -89,14 +87,11 @@ public class DuplicateEmailUtil { |
| 89 | * 邮件备注 | 87 | * 邮件备注 |
| 90 | */ | 88 | */ |
| 91 | StringBuffer remarks = new StringBuffer(); | 89 | StringBuffer remarks = new StringBuffer(); |
| 92 | - ParamConfig paramConfig = paramConfigRepository.findValueByCode(ParamConfigConstants.TASK_PARAM_KEYS.NOTIFICATION_SENDER_EMAIL_INTERVAL); | 90 | + this.buildBottom(remarks); |
| 93 | - this.buildBottom(remarks,paramConfig.getValue()); | ||
| 94 | /** | 91 | /** |
| 95 | * 添加模板 | 92 | * 添加模板 |
| 96 | */ | 93 | */ |
| 97 | - return duplicateEmailTemplate.getBody(propertiesConfig.getBaseUrl()+propertiesConfig.getLine(), | 94 | + return duplicateEmailTemplate.getBody(bizCode, remarks); |
| 98 | - propertiesConfig.getBaseUrl()+propertiesConfig.getFedex(), | ||
| 99 | - bizCode, remarks); | ||
| 100 | } | 95 | } |
| 101 | 96 | ||
| 102 | 97 | ||
| ... | @@ -107,8 +102,8 @@ public class DuplicateEmailUtil { | ... | @@ -107,8 +102,8 @@ public class DuplicateEmailUtil { |
| 107 | * @param remarks | 102 | * @param remarks |
| 108 | * @return void | 103 | * @return void |
| 109 | */ | 104 | */ |
| 110 | - private void buildBottom(StringBuffer remarks, String paramConfig){ | 105 | + private void buildBottom(StringBuffer remarks){ |
| 111 | - remarks.append(duplicateEmailTemplate.getDescription(paramConfig)); | 106 | + remarks.append(duplicateEmailTemplate.getDescription()); |
| 112 | } | 107 | } |
| 113 | 108 | ||
| 114 | /** | 109 | /** | ... | ... |
-
Please register or login to post a comment