Showing
5 changed files
with
35 additions
and
25 deletions
| 1 | package com.fedex.connect.customer.data.dto; | 1 | package com.fedex.connect.customer.data.dto; |
| 2 | 2 | ||
| 3 | +import com.fedex.connect.common.model.biz.Consignment; | ||
| 3 | import lombok.Data; | 4 | import lombok.Data; |
| 4 | 5 | ||
| 5 | @Data | 6 | @Data |
| ... | @@ -8,5 +9,5 @@ public class ConsignmentAddDto { | ... | @@ -8,5 +9,5 @@ public class ConsignmentAddDto { |
| 8 | * 是否为该用户的运单 1:是 0:否 | 9 | * 是否为该用户的运单 1:是 0:否 |
| 9 | */ | 10 | */ |
| 10 | private Integer isCreatorFlag; | 11 | private Integer isCreatorFlag; |
| 11 | - private Long consignmentId; | 12 | + private Consignment consignment; |
| 12 | } | 13 | } | ... | ... |
| ... | @@ -126,13 +126,18 @@ public class ConsignmentUtil { | ... | @@ -126,13 +126,18 @@ public class ConsignmentUtil { |
| 126 | */ | 126 | */ |
| 127 | public ResponseVo consignmentCheckWithNotCe(Consignment consignment, AddBo bo){ | 127 | public ResponseVo consignmentCheckWithNotCe(Consignment consignment, AddBo bo){ |
| 128 | ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto(); | 128 | ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto(); |
| 129 | - consignmentAddDto.setConsignmentId(consignment.getId()); | 129 | + if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getUserInputShipperAccount())){ |
| 130 | - if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getShipperAccount())){ | ||
| 131 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE); | 130 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE); |
| 131 | + Consignment consignmentUserInput = new Consignment(); | ||
| 132 | + consignmentUserInput.setOriginCountry(consignment.getUserInputOriginCountry()); | ||
| 133 | + consignmentUserInput.setOriginCountryCode(consignment.getUserInputOriginCountryCode()); | ||
| 134 | + consignmentUserInput.setShipperAccount(consignment.getUserInputShipperAccount()); | ||
| 135 | + consignmentUserInput.setDestinationCountryCode(consignment.getDestinationCountryCode()); | ||
| 136 | + consignmentUserInput.setDestinationCountry(consignment.getDestinationCountry()); | ||
| 137 | + consignmentAddDto.setConsignment(consignmentUserInput); | ||
| 132 | return responseUtils.success(consignmentAddDto); | 138 | return responseUtils.success(consignmentAddDto); |
| 133 | }else { | 139 | }else { |
| 134 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_THREE); | 140 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_THREE); |
| 135 | - consignmentAddDto.setConsignmentId(null); | ||
| 136 | return responseUtils.success(ResponseCode.MESSAGE_CODE_30011,consignmentAddDto); | 141 | return responseUtils.success(ResponseCode.MESSAGE_CODE_30011,consignmentAddDto); |
| 137 | } | 142 | } |
| 138 | } | 143 | } |
| ... | @@ -148,13 +153,13 @@ public class ConsignmentUtil { | ... | @@ -148,13 +153,13 @@ public class ConsignmentUtil { |
| 148 | */ | 153 | */ |
| 149 | public ResponseVo consignmentCheckWithCe(Consignment consignment, AddBo bo, User user) { | 154 | public ResponseVo consignmentCheckWithCe(Consignment consignment, AddBo bo, User user) { |
| 150 | ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto(); | 155 | ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto(); |
| 151 | - consignmentAddDto.setConsignmentId(consignment.getId()); | ||
| 152 | 156 | ||
| 153 | /** | 157 | /** |
| 154 | * uuid相同,直接返回所有运单信息 | 158 | * uuid相同,直接返回所有运单信息 |
| 155 | */ | 159 | */ |
| 156 | if (Objects.equals(consignment.getUserUuid(), user.getUserUuid())) { | 160 | if (Objects.equals(consignment.getUserUuid(), user.getUserUuid())) { |
| 157 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE); | 161 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE); |
| 162 | + consignmentAddDto.setConsignment(consignment); | ||
| 158 | return responseUtils.success(consignmentAddDto); | 163 | return responseUtils.success(consignmentAddDto); |
| 159 | } | 164 | } |
| 160 | 165 | ||
| ... | @@ -163,6 +168,7 @@ public class ConsignmentUtil { | ... | @@ -163,6 +168,7 @@ public class ConsignmentUtil { |
| 163 | */ | 168 | */ |
| 164 | if (isShipperAccountMatch(user.getAccountNo(), consignment.getShipperAccount())) { | 169 | if (isShipperAccountMatch(user.getAccountNo(), consignment.getShipperAccount())) { |
| 165 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE); | 170 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE); |
| 171 | + consignmentAddDto.setConsignment(consignment); | ||
| 166 | return responseUtils.success(ResponseCode.MESSAGE_CODE_30004, consignmentAddDto); | 172 | return responseUtils.success(ResponseCode.MESSAGE_CODE_30004, consignmentAddDto); |
| 167 | } | 173 | } |
| 168 | 174 | ||
| ... | @@ -171,7 +177,6 @@ public class ConsignmentUtil { | ... | @@ -171,7 +177,6 @@ public class ConsignmentUtil { |
| 171 | */ | 177 | */ |
| 172 | if (!StringUtils.hasText(bo.getShipperAccount())){ | 178 | if (!StringUtils.hasText(bo.getShipperAccount())){ |
| 173 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO); | 179 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO); |
| 174 | - consignmentAddDto.setConsignmentId(null); | ||
| 175 | return responseUtils.success(ResponseCode.MESSAGE_CODE_30005,consignmentAddDto); | 180 | return responseUtils.success(ResponseCode.MESSAGE_CODE_30005,consignmentAddDto); |
| 176 | } | 181 | } |
| 177 | 182 | ||
| ... | @@ -180,6 +185,7 @@ public class ConsignmentUtil { | ... | @@ -180,6 +185,7 @@ public class ConsignmentUtil { |
| 180 | */ | 185 | */ |
| 181 | if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getShipperAccount())) { | 186 | if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getShipperAccount())) { |
| 182 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE); | 187 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE); |
| 188 | + consignmentAddDto.setConsignment(consignment); | ||
| 183 | return responseUtils.success(consignmentAddDto); | 189 | return responseUtils.success(consignmentAddDto); |
| 184 | } | 190 | } |
| 185 | 191 | ||
| ... | @@ -187,10 +193,16 @@ public class ConsignmentUtil { | ... | @@ -187,10 +193,16 @@ public class ConsignmentUtil { |
| 187 | if (!StringUtils.isEmpty(consignment.getUserInputShipperAccount())){ | 193 | if (!StringUtils.isEmpty(consignment.getUserInputShipperAccount())){ |
| 188 | if (isShipperAccountMatch(bo.getShipperAccount(),consignment.getUserInputShipperAccount())){ | 194 | if (isShipperAccountMatch(bo.getShipperAccount(),consignment.getUserInputShipperAccount())){ |
| 189 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE); | 195 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE); |
| 196 | + Consignment consignmentUserInput = new Consignment(); | ||
| 197 | + consignmentUserInput.setOriginCountry(consignment.getUserInputOriginCountry()); | ||
| 198 | + consignmentUserInput.setOriginCountryCode(consignment.getUserInputOriginCountryCode()); | ||
| 199 | + consignmentUserInput.setShipperAccount(consignment.getUserInputShipperAccount()); | ||
| 200 | + consignmentUserInput.setDestinationCountryCode(consignment.getDestinationCountryCode()); | ||
| 201 | + consignmentUserInput.setDestinationCountry(consignment.getDestinationCountry()); | ||
| 202 | + consignmentAddDto.setConsignment(consignmentUserInput); | ||
| 190 | return responseUtils.success(consignmentAddDto); | 203 | return responseUtils.success(consignmentAddDto); |
| 191 | }else { | 204 | }else { |
| 192 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_THREE); | 205 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_THREE); |
| 193 | - consignmentAddDto.setConsignmentId(null); | ||
| 194 | return responseUtils.success(ResponseCode.MESSAGE_CODE_30011,consignmentAddDto); | 206 | return responseUtils.success(ResponseCode.MESSAGE_CODE_30011,consignmentAddDto); |
| 195 | } | 207 | } |
| 196 | } | 208 | } |
| ... | @@ -200,7 +212,6 @@ public class ConsignmentUtil { | ... | @@ -200,7 +212,6 @@ public class ConsignmentUtil { |
| 200 | */ | 212 | */ |
| 201 | if (StringUtils.hasText(bo.getShipperAccount())) { | 213 | if (StringUtils.hasText(bo.getShipperAccount())) { |
| 202 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO); | 214 | consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO); |
| 203 | - consignmentAddDto.setConsignmentId(null); | ||
| 204 | return responseUtils.success(ResponseCode.MESSAGE_CODE_30005,consignmentAddDto); | 215 | return responseUtils.success(ResponseCode.MESSAGE_CODE_30005,consignmentAddDto); |
| 205 | } | 216 | } |
| 206 | 217 | ... | ... |
| ... | @@ -28,17 +28,15 @@ public class DuplicateEmailTemplate implements EmailTemplate { | ... | @@ -28,17 +28,15 @@ public class DuplicateEmailTemplate implements EmailTemplate { |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | interface CLEARANCE_TITLE{ | 30 | interface CLEARANCE_TITLE{ |
| 31 | - String TITLE = "Create waybill({0}) reminder"; | 31 | + String TITLE = "Notification: declaration documents submitted ({0})"; |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | interface CLEARANCE_BODY{ | 34 | interface CLEARANCE_BODY{ |
| 35 | String DESCRIPTION = "<p>This email is a reminder email, please do not reply!</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>" + | ||
| 39 | - //"<p align='center'><img src='{1}'></p>" + | ||
| 40 | "<p>FedEx iClear Connect System Notification:</p>" + | 38 | "<p>FedEx iClear Connect System Notification:</p>" + |
| 41 | - "<p> The waybill with tracking number {0} has been created by someone else. Please verify!</p>" + | 39 | + "<p> Please note that the declaration documents of waybill with tracking number {0} has been submitted by someone else!</p>" + |
| 42 | "</font><br/><br/>" + | 40 | "</font><br/><br/>" + |
| 43 | "<div style=color:#808080;font-style:Arial;font-size:14px;margin: auto;margin-bottom: 5px;>" + | 41 | "<div style=color:#808080;font-style:Arial;font-size:14px;margin: auto;margin-bottom: 5px;>" + |
| 44 | "{1}\n" + | 42 | "{1}\n" + | ... | ... |
| ... | @@ -32,28 +32,28 @@ public class SendFailedEmailTemplate implements EmailTemplate { | ... | @@ -32,28 +32,28 @@ public class SendFailedEmailTemplate implements EmailTemplate { |
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | interface FAILED_EMAIL_TITLE{ | 34 | interface FAILED_EMAIL_TITLE{ |
| 35 | - String TITLE = "Failed task warning"; | 35 | + String TITLE = "接口调用失败详情"; |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | interface FAILED_EMAIL_BODY{ | 38 | interface FAILED_EMAIL_BODY{ |
| 39 | - String DESCRIPTION = "<p>1.[File Push] Task: The system performs a polling every {0} minutes after startup.</p>\n" + | 39 | + String DESCRIPTION = "<p>1.【文件推送】任务,系统启动后每{0}分钟轮巡一次。</p>\n" + |
| 40 | - " <p>2.[Push Pre-Clearance File] Task: The system performs a polling every {1} minutes after startup.</p>\n" + | 40 | + " <p>2.【推送预清关文件】任务,系统启动后每{1}分钟轮巡一次。</p>\n" + |
| 41 | - " <p>3.[Remind Sender] Task: The system performs a polling every {2} minutes after startup.</p>\n" + | 41 | + " <p>3.【提醒发件人】任务,系统启动后每{2}分钟轮巡一次。</p>\n" + |
| 42 | - " <p>Note: Email Sending Mechanism:</p>\n" + | 42 | + " <p>备注:邮件发送机制:</p>\n" + |
| 43 | - " <p>This alert email task is executed every {3} minutes after the system starts. If any of the three scheduled tasks mentioned above have a final determination of failed records exceeding {4} for the day, an email notification will be automatically sent to FedEx IT. Each interface will display the latest {5} failed tracking numbers, the total number of calls made during the day, and the total number of failed calls for the day.</p>\n" + | 43 | + " <p>该预警邮件任务,系统启动后每30分钟执行一次,当日上述3个定时任务,有任何一个任务的最终判定为失败的记录数量大于5,则自动发送邮件通知FedEX IT,每个接口显示最新10条失败运单号、当日调用总次数、当日调用失败总次数。</p>\n" + |
| 44 | - " <p style=\"font-size:10px;\">(Note: All task-related numbers can be adjusted in the system configuration interface.)</p>"; | 44 | + " <p style=\"font-size:10px;\">(注:所有任务相关的数字均可以在系统配置界面调整)</p>"; |
| 45 | 45 | ||
| 46 | String TABLE = "<table style=\"width: 100%;table-layout: fixed;padding: 20px;width: 100%;border-collapse: collapse;\">\n" + | 46 | String TABLE = "<table style=\"width: 100%;table-layout: fixed;padding: 20px;width: 100%;border-collapse: collapse;\">\n" + |
| 47 | "<tr>\n" + | 47 | "<tr>\n" + |
| 48 | "<td style=\"border: 0px;text-align: left;padding: 8px;\">\n" + | 48 | "<td style=\"border: 0px;text-align: left;padding: 8px;\">\n" + |
| 49 | "<div style=\"margin: auto;padding: 20px;\">\n" + | 49 | "<div style=\"margin: auto;padding: 20px;\">\n" + |
| 50 | - "<h2 style=\"text-align: center;\">Task Push Failure Details</h2>\n" + | 50 | + "<h2 style=\"text-align: center;\">接口调用失败详情</h2>\n" + |
| 51 | "<table style=\"width: 100%;border-collapse: collapse;\">\n" + | 51 | "<table style=\"width: 100%;border-collapse: collapse;\">\n" + |
| 52 | "<tr>\n" + | 52 | "<tr>\n" + |
| 53 | - "<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">Task Name</th>\n" + | 53 | + "<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">任务名称</th>\n" + |
| 54 | - "<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">Failed Tracking Number</th>\n" + | 54 | + "<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">失败的运单号</th>\n" + |
| 55 | - "<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">Total Number</th>\n" + | 55 | + "<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">总数</th>\n" + |
| 56 | - "<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">Failure Count</th>\n" + | 56 | + "<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">失败数量</th>\n" + |
| 57 | "</tr>\n" + | 57 | "</tr>\n" + |
| 58 | "{0}\n" + | 58 | "{0}\n" + |
| 59 | "</table>\n" + | 59 | "</table>\n" + | ... | ... |
| ... | @@ -62,7 +62,7 @@ public class SendFailedEmailAlertServiceImpl extends BaseService implements ISen | ... | @@ -62,7 +62,7 @@ public class SendFailedEmailAlertServiceImpl extends BaseService implements ISen |
| 62 | * 无错误邮件不发送邮件 | 62 | * 无错误邮件不发送邮件 |
| 63 | */ | 63 | */ |
| 64 | boolean dataFlag = sendFailedEmailDto.stream() | 64 | boolean dataFlag = sendFailedEmailDto.stream() |
| 65 | - .anyMatch(failedEmailDto -> failedEmailDto.getStatusCodeCount() != 0); | 65 | + .anyMatch(failedEmailDto -> failedEmailDto.getStatusCodeCount() > 5); |
| 66 | if (!dataFlag) { | 66 | if (!dataFlag) { |
| 67 | return; | 67 | return; |
| 68 | } | 68 | } | ... | ... |
-
Please register or login to post a comment