转发邮件失败增加邮件提醒

master
jianghaiqing 7 months ago
parent 5b54e855ea
commit 2a933e4720

@ -2007,7 +2007,7 @@ namespace Myshipping.Application
var Id = entity.Id; var Id = entity.Id;
BookingOrderOutput ordOut = new BookingOrderOutput(); BookingOrderOutput ordOut = new BookingOrderOutput();
var main = await _rep.FirstOrDefaultAsync(u => u.Id == Id); var main = await _rep.AsQueryable().Filter(null, true).FirstAsync(u => u.Id == Id);
if (!string.IsNullOrEmpty(entity.MBLNO) || !string.IsNullOrEmpty(entity.CUSTNO)) if (!string.IsNullOrEmpty(entity.MBLNO) || !string.IsNullOrEmpty(entity.CUSTNO))
{ {

@ -13,6 +13,7 @@ using Microsoft.Extensions.Logging;
using Myshipping.Application.ConfigOption; using Myshipping.Application.ConfigOption;
using Myshipping.Application.Entity; using Myshipping.Application.Entity;
using Myshipping.Application.Enum; using Myshipping.Application.Enum;
using Myshipping.Application.Helper;
using Myshipping.Application.Service.BookingOrder; using Myshipping.Application.Service.BookingOrder;
using Myshipping.Application.Service.BookingSlot.Dto; using Myshipping.Application.Service.BookingSlot.Dto;
using Myshipping.Core; using Myshipping.Core;
@ -1796,6 +1797,8 @@ namespace Myshipping.Application
{ {
result.succ = false; result.succ = false;
result.msg = emailRlt.msg; result.msg = emailRlt.msg;
new EmailNoticeHelper().SendEmailNotice($"MBLNO={taskBCInfo.MBL_NO} 转发通知邮件失败", $"MBLNO={taskBCInfo.MBL_NO} 转发通知邮件失败,原因:{emailRlt.msg}", App.Configuration["EmailNoticeDefaultUser"].GetUserEmailList());
} }
} }
catch (Exception ex) catch (Exception ex)
@ -1804,6 +1807,8 @@ namespace Myshipping.Application
result.succ = false; result.succ = false;
result.msg = $"推送邮件失败,{ex.Message}"; result.msg = $"推送邮件失败,{ex.Message}";
new EmailNoticeHelper().SendEmailNotice($"MBLNO={taskBCInfo.MBL_NO} 转发通知邮件失败", $"MBLNO={taskBCInfo.MBL_NO} 转发通知邮件失败,原因:{ex.Message}", App.Configuration["EmailNoticeDefaultUser"].GetUserEmailList());
} }
return result; return result;
@ -2578,6 +2583,10 @@ namespace Myshipping.Application
{ {
result.succ = false; result.succ = false;
result.msg = $"处理异常,原因:{ex.Message}"; result.msg = $"处理异常,原因:{ex.Message}";
new EmailNoticeHelper().SendEmailNotice($"taskPKId={taskPKId} 转发通知邮件失败", $"taskPKId={taskPKId} 转发通知邮件失败,原因:{ex.Message}", App.Configuration["EmailNoticeDefaultUser"].GetUserEmailList());
} }
return result; return result;

@ -431,6 +431,13 @@ namespace Myshipping.Application
bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.HSCODE)); bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.HSCODE));
} }
if (!string.IsNullOrEmpty(siSubmitted.MARKS))
{
bkModel.MARKS = siSubmitted.MARKS;
bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.MARKS));
}
} }
if (ctnList.Count > 0) if (ctnList.Count > 0)
@ -659,6 +666,12 @@ namespace Myshipping.Application
}).ExecuteCommandAsync(); }).ExecuteCommandAsync();
} }
//处理附件
result.succ = true;
result.msg = "处理成功";
} }
else else
{ {
@ -666,6 +679,9 @@ namespace Myshipping.Application
siSubmitted.PROCESS_DATE = DateTime.Now; siSubmitted.PROCESS_DATE = DateTime.Now;
siSubmitted.PROCESS_RESULT = "更新订舱信息失败"; siSubmitted.PROCESS_RESULT = "更新订舱信息失败";
siSubmitted.UPDATE_BOOKING_DATE = DateTime.Now; siSubmitted.UPDATE_BOOKING_DATE = DateTime.Now;
result.succ = false;
result.msg = "处理失败";
} }
} }
@ -689,14 +705,16 @@ namespace Myshipping.Application
result.msg = ex.Message; result.msg = ex.Message;
} }
if (!result.succ && siSubmitted != null) if (!result.succ)
{
if (siSubmitted != null)
{ {
siSubmitted.PROCESS_STATUS = "FAILURE"; siSubmitted.PROCESS_STATUS = "FAILURE";
siSubmitted.PROCESS_DATE = DateTime.Now; siSubmitted.PROCESS_DATE = DateTime.Now;
if (result.msg.Length > 500) if (result.msg.Length > 500)
{ {
siSubmitted.PROCESS_RESULT = result.msg.Substring(0,500); siSubmitted.PROCESS_RESULT = result.msg.Substring(0, 500);
} }
else else
{ {
@ -708,6 +726,23 @@ namespace Myshipping.Application
x.PROCESS_DATE, x.PROCESS_DATE,
x.PROCESS_STATUS, x.PROCESS_STATUS,
x.PROCESS_RESULT, x.PROCESS_RESULT,
x.DIFF_NUM,
x.IS_SET_AUTO_UPD_BOOKING,
}).ExecuteCommandAsync();
}
}
else
{
await _taskSISubmittedRepository.AsUpdateable(siSubmitted).UpdateColumns(x => new
{
x.PROCESS_DATE,
x.PROCESS_STATUS,
x.PROCESS_RESULT,
x.IS_UPDATE_BOOKING,
x.UPDATE_BOOKING_DATE,
x.DIFF_NUM,
x.BOOKING_ID,
x.IS_SET_AUTO_UPD_BOOKING x.IS_SET_AUTO_UPD_BOOKING
}).ExecuteCommandAsync(); }).ExecuteCommandAsync();
} }

@ -679,12 +679,13 @@ namespace Myshipping.Application
}); });
} }
/*
var siService = _namedtaskSISubmittedServiceProvider var siService = _namedtaskSISubmittedServiceProvider
.GetService<ITransient>(nameof(TaskManageSISubmittedService)); .GetService<ITransient>(nameof(TaskManageSISubmittedService));
await siService.ProcessSISubmitted(taskSISubmitted.TASK_ID); await siService.ProcessSISubmitted(taskSISubmitted.TASK_ID);
*/
} }
#endregion #endregion

Loading…
Cancel
Save