zelong.shao

customer|task|模板调整&&add调整

package com.fedex.connect.customer.data.dto;
import com.fedex.connect.common.model.biz.Consignment;
import lombok.Data;
@Data
......@@ -8,5 +9,5 @@ public class ConsignmentAddDto {
* 是否为该用户的运单 1:是 0:否
*/
private Integer isCreatorFlag;
private Long consignmentId;
private Consignment consignment;
}
......
......@@ -126,13 +126,18 @@ public class ConsignmentUtil {
*/
public ResponseVo consignmentCheckWithNotCe(Consignment consignment, AddBo bo){
ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto();
consignmentAddDto.setConsignmentId(consignment.getId());
if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getShipperAccount())){
if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getUserInputShipperAccount())){
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
Consignment consignmentUserInput = new Consignment();
consignmentUserInput.setOriginCountry(consignment.getUserInputOriginCountry());
consignmentUserInput.setOriginCountryCode(consignment.getUserInputOriginCountryCode());
consignmentUserInput.setShipperAccount(consignment.getUserInputShipperAccount());
consignmentUserInput.setDestinationCountryCode(consignment.getDestinationCountryCode());
consignmentUserInput.setDestinationCountry(consignment.getDestinationCountry());
consignmentAddDto.setConsignment(consignmentUserInput);
return responseUtils.success(consignmentAddDto);
}else {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_THREE);
consignmentAddDto.setConsignmentId(null);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30011,consignmentAddDto);
}
}
......@@ -148,13 +153,13 @@ public class ConsignmentUtil {
*/
public ResponseVo consignmentCheckWithCe(Consignment consignment, AddBo bo, User user) {
ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto();
consignmentAddDto.setConsignmentId(consignment.getId());
/**
* uuid相同,直接返回所有运单信息
*/
if (Objects.equals(consignment.getUserUuid(), user.getUserUuid())) {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
consignmentAddDto.setConsignment(consignment);
return responseUtils.success(consignmentAddDto);
}
......@@ -163,6 +168,7 @@ public class ConsignmentUtil {
*/
if (isShipperAccountMatch(user.getAccountNo(), consignment.getShipperAccount())) {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
consignmentAddDto.setConsignment(consignment);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30004, consignmentAddDto);
}
......@@ -171,7 +177,6 @@ public class ConsignmentUtil {
*/
if (!StringUtils.hasText(bo.getShipperAccount())){
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO);
consignmentAddDto.setConsignmentId(null);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30005,consignmentAddDto);
}
......@@ -180,6 +185,7 @@ public class ConsignmentUtil {
*/
if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getShipperAccount())) {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
consignmentAddDto.setConsignment(consignment);
return responseUtils.success(consignmentAddDto);
}
......@@ -187,10 +193,16 @@ public class ConsignmentUtil {
if (!StringUtils.isEmpty(consignment.getUserInputShipperAccount())){
if (isShipperAccountMatch(bo.getShipperAccount(),consignment.getUserInputShipperAccount())){
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
Consignment consignmentUserInput = new Consignment();
consignmentUserInput.setOriginCountry(consignment.getUserInputOriginCountry());
consignmentUserInput.setOriginCountryCode(consignment.getUserInputOriginCountryCode());
consignmentUserInput.setShipperAccount(consignment.getUserInputShipperAccount());
consignmentUserInput.setDestinationCountryCode(consignment.getDestinationCountryCode());
consignmentUserInput.setDestinationCountry(consignment.getDestinationCountry());
consignmentAddDto.setConsignment(consignmentUserInput);
return responseUtils.success(consignmentAddDto);
}else {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_THREE);
consignmentAddDto.setConsignmentId(null);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30011,consignmentAddDto);
}
}
......@@ -200,7 +212,6 @@ public class ConsignmentUtil {
*/
if (StringUtils.hasText(bo.getShipperAccount())) {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO);
consignmentAddDto.setConsignmentId(null);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30005,consignmentAddDto);
}
......
......@@ -28,17 +28,15 @@ public class DuplicateEmailTemplate implements EmailTemplate {
}
interface CLEARANCE_TITLE{
String TITLE = "Create waybill({0}) reminder";
String TITLE = "Notification: declaration documents submitted ({0})";
}
interface CLEARANCE_BODY{
String DESCRIPTION = "<p>This email is a reminder email, please do not reply!</p>\n";
String BODY = "<div><div style='margin-left:4%;'>" +
//"<p align='center'><img src='{0}'></p>" +
//"<p align='center'><img src='{1}'></p>" +
"<p>FedEx iClear Connect System Notification:</p>" +
"<p>&nbsp;&nbsp;&nbsp;&nbsp;The waybill with tracking number {0} has been created by someone else. Please verify!</p>" +
"<p>&nbsp;&nbsp;&nbsp;&nbsp;Please note that the declaration documents of waybill with tracking number {0} has been submitted by someone else!</p>" +
"</font><br/><br/>" +
"<div style=color:#808080;font-style:Arial;font-size:14px;margin: auto;margin-bottom: 5px;>" +
"{1}\n" +
......
......@@ -32,28 +32,28 @@ public class SendFailedEmailTemplate implements EmailTemplate {
interface FAILED_EMAIL_TITLE{
String TITLE = "Failed task warning";
String TITLE = "接口调用失败详情";
}
interface FAILED_EMAIL_BODY{
String DESCRIPTION = "<p>1.[File Push] Task: The system performs a polling every {0} minutes after startup.</p>\n" +
" <p>2.[Push Pre-Clearance File] Task: The system performs a polling every {1} minutes after startup.</p>\n" +
" <p>3.[Remind Sender] Task: The system performs a polling every {2} minutes after startup.</p>\n" +
" <p>Note: Email Sending Mechanism:</p>\n" +
" <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" +
" <p style=\"font-size:10px;\">(Note: All task-related numbers can be adjusted in the system configuration interface.)</p>";
String DESCRIPTION = "<p>1.【文件推送】任务,系统启动后每{0}分钟轮巡一次。</p>\n" +
" <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>";
String TABLE = "<table style=\"width: 100%;table-layout: fixed;padding: 20px;width: 100%;border-collapse: collapse;\">\n" +
"<tr>\n" +
"<td style=\"border: 0px;text-align: left;padding: 8px;\">\n" +
"<div style=\"margin: auto;padding: 20px;\">\n" +
"<h2 style=\"text-align: center;\">Task Push Failure Details</h2>\n" +
"<h2 style=\"text-align: center;\">接口调用失败详情</h2>\n" +
"<table style=\"width: 100%;border-collapse: collapse;\">\n" +
"<tr>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">Task Name</th>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">Failed Tracking Number</th>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">Total Number</th>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">Failure Count</th>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">任务名称</th>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">失败的运单号</th>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">总数</th>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">失败数量</th>\n" +
"</tr>\n" +
"{0}\n" +
"</table>\n" +
......
......@@ -62,7 +62,7 @@ public class SendFailedEmailAlertServiceImpl extends BaseService implements ISen
* 无错误邮件不发送邮件
*/
boolean dataFlag = sendFailedEmailDto.stream()
.anyMatch(failedEmailDto -> failedEmailDto.getStatusCodeCount() != 0);
.anyMatch(failedEmailDto -> failedEmailDto.getStatusCodeCount() > 5);
if (!dataFlag) {
return;
}
......