From 2a933e4720e97f289fe6defaa314dd342891c28f Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 30 Apr 2024 23:30:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AC=E5=8F=91=E9=82=AE=E4=BB=B6=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=A2=9E=E5=8A=A0=E9=82=AE=E4=BB=B6=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 2 +- .../TaskManagePlat/TaskManageBCService.cs | 9 +++ .../TaskManageSISubmittedService.cs | 57 +++++++++++++++---- .../TaskManagePlat/TaskManageService.cs | 3 +- 4 files changed, 58 insertions(+), 13 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 7c878144..d0e3cbbd 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -2007,7 +2007,7 @@ namespace Myshipping.Application var Id = entity.Id; 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)) { diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs index 5b74770e..d9f8b1d8 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs @@ -13,6 +13,7 @@ using Microsoft.Extensions.Logging; using Myshipping.Application.ConfigOption; using Myshipping.Application.Entity; using Myshipping.Application.Enum; +using Myshipping.Application.Helper; using Myshipping.Application.Service.BookingOrder; using Myshipping.Application.Service.BookingSlot.Dto; using Myshipping.Core; @@ -1796,6 +1797,8 @@ namespace Myshipping.Application { result.succ = false; result.msg = emailRlt.msg; + + new EmailNoticeHelper().SendEmailNotice($"MBLNO={taskBCInfo.MBL_NO} 转发通知邮件失败", $"MBLNO={taskBCInfo.MBL_NO} 转发通知邮件失败,原因:{emailRlt.msg}", App.Configuration["EmailNoticeDefaultUser"].GetUserEmailList()); } } catch (Exception ex) @@ -1804,6 +1807,8 @@ namespace Myshipping.Application result.succ = false; result.msg = $"推送邮件失败,{ex.Message}"; + + new EmailNoticeHelper().SendEmailNotice($"MBLNO={taskBCInfo.MBL_NO} 转发通知邮件失败", $"MBLNO={taskBCInfo.MBL_NO} 转发通知邮件失败,原因:{ex.Message}", App.Configuration["EmailNoticeDefaultUser"].GetUserEmailList()); } return result; @@ -2578,6 +2583,10 @@ namespace Myshipping.Application { result.succ = false; result.msg = $"处理异常,原因:{ex.Message}"; + + new EmailNoticeHelper().SendEmailNotice($"taskPKId={taskPKId} 转发通知邮件失败", $"taskPKId={taskPKId} 转发通知邮件失败,原因:{ex.Message}", App.Configuration["EmailNoticeDefaultUser"].GetUserEmailList()); + + } return result; diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageSISubmittedService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageSISubmittedService.cs index 07220975..024f7114 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageSISubmittedService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageSISubmittedService.cs @@ -431,6 +431,13 @@ namespace Myshipping.Application 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) @@ -659,6 +666,12 @@ namespace Myshipping.Application }).ExecuteCommandAsync(); } + + + //处理附件 + + result.succ = true; + result.msg = "处理成功"; } else { @@ -666,6 +679,9 @@ namespace Myshipping.Application siSubmitted.PROCESS_DATE = DateTime.Now; siSubmitted.PROCESS_RESULT = "更新订舱信息失败"; siSubmitted.UPDATE_BOOKING_DATE = DateTime.Now; + + result.succ = false; + result.msg = "处理失败"; } } @@ -689,25 +705,44 @@ namespace Myshipping.Application result.msg = ex.Message; } - if (!result.succ && siSubmitted != null) + if (!result.succ) { - siSubmitted.PROCESS_STATUS = "FAILURE"; - siSubmitted.PROCESS_DATE = DateTime.Now; - - if (result.msg.Length > 500) - { - siSubmitted.PROCESS_RESULT = result.msg.Substring(0,500); - } - else + if (siSubmitted != null) { - siSubmitted.PROCESS_RESULT = result.msg; - } + siSubmitted.PROCESS_STATUS = "FAILURE"; + siSubmitted.PROCESS_DATE = DateTime.Now; + if (result.msg.Length > 500) + { + siSubmitted.PROCESS_RESULT = result.msg.Substring(0, 500); + } + else + { + siSubmitted.PROCESS_RESULT = result.msg; + } + + await _taskSISubmittedRepository.AsUpdateable(siSubmitted).UpdateColumns(x => new + { + x.PROCESS_DATE, + x.PROCESS_STATUS, + 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 }).ExecuteCommandAsync(); } diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index 718393dd..717a615a 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -679,12 +679,13 @@ namespace Myshipping.Application }); } + /* var siService = _namedtaskSISubmittedServiceProvider .GetService(nameof(TaskManageSISubmittedService)); await siService.ProcessSISubmitted(taskSISubmitted.TASK_ID); - + */ } #endregion