From 2a865d1432dd81373ef124eb62e967760c0f496d Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 17 May 2024 13:27:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9BC=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskManagePlat/TaskManageBCService.cs | 3 ++- .../TaskManageRollingNominationService.cs | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs index e09404ba..601054cb 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs @@ -2632,6 +2632,7 @@ namespace Myshipping.Application if (bcOrder.BOOKING_ORDER_ID != null && bcOrder.BOOKING_ORDER_ID.HasValue && bcOrder.BOOKING_ORDER_ID.Value > 0) { + /* SaveBookingOrderInput bkModel = new SaveBookingOrderInput { MBLNO = bcOrder.MBL_NO.ToUpper().Trim(), @@ -2689,7 +2690,7 @@ namespace Myshipping.Application else { _logger.LogInformation($"taskPKId={taskPKId} 更新订舱详情失败没有对应舱位ID"); - } + }*/ } else { diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs index 2ea5f233..b83ab3b8 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs @@ -1120,6 +1120,23 @@ namespace Myshipping.Application if (fromEntity.Count > 0) model.From = fromEntity.Select(p => p.Adapt()).ToList(); + + model.LoadDetailList = list.Select(a => a.Adapt()).ToList(); + + if (model.From != null && model.From.Count > 0) + { + var firstLoadDetail = model.LoadDetailList.FirstOrDefault(); + + if (model.From.Any(t => string.IsNullOrWhiteSpace(t.Port))) + { + model.From = model.From.Where(a => a.Terminal.Contains(firstLoadDetail.LoadPortName?.Trim())).ToList(); + } + else + { + model.From = model.From.Where(a => a.Port.Equals(firstLoadDetail.LoadPortName?.Trim(),StringComparison.OrdinalIgnoreCase)).ToList(); + } + } + var toEntity = shipList.Where(a => Regex.IsMatch(a.SHIP_TYPE, "To(\\s+[0-9]+)?" , RegexOptions.IgnoreCase)).ToList(); @@ -1180,8 +1197,6 @@ namespace Myshipping.Application List> tuples = new List>(); - model.LoadDetailList = list.Select(a => a.Adapt()).ToList(); - model.FromToList = new List(); if (model.LoadDetailList.Count > 0) From 78bdb5e36eb771014790de88994e2ef574e6195a Mon Sep 17 00:00:00 2001 From: wanghaomei <86whm@163.com> Date: Fri, 17 May 2024 14:08:11 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=89=A3=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingCustomerOrder/BookingCustomerOrderService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs index ac41963f..1043b68b 100644 --- a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs +++ b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs @@ -25,6 +25,7 @@ using Myshipping.Core.Helper; using Myshipping.Core.Service; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using NPOI.SS.Formula.PTG; using RabbitMQ.Client; using System; using System.Collections.Generic; @@ -2139,6 +2140,8 @@ namespace Myshipping.Application fr.Type = typeStr; fr.Amount = total; await _repFeeRecord.InsertAsync(fr); + + SaveAuditLog($"扣费成功", model.Id, model.CreatedUserId.Value, model.TenantId.Value, "系统", remark: ""); } else { From cb023b9689c7ad53cfd7364bd11234d65239d69d Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 17 May 2024 15:03:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=90=E8=B8=AA?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/QueryTraceAfterPortResultDto.cs | 2 +- .../EmbedTraceProductService.cs | 4 +- .../TaskManagePlat/TaskManageBCService.cs | 67 +++++++++++-------- 3 files changed, 41 insertions(+), 32 deletions(-) diff --git a/Myshipping.Application/Service/EmbedProjectGoodsStatus/Dtos/QueryTraceAfterPortResultDto.cs b/Myshipping.Application/Service/EmbedProjectGoodsStatus/Dtos/QueryTraceAfterPortResultDto.cs index effd0df9..8cb025cb 100644 --- a/Myshipping.Application/Service/EmbedProjectGoodsStatus/Dtos/QueryTraceAfterPortResultDto.cs +++ b/Myshipping.Application/Service/EmbedProjectGoodsStatus/Dtos/QueryTraceAfterPortResultDto.cs @@ -16,7 +16,7 @@ namespace Myshipping.Application /// /// 回执消息 /// - public string message { get; set; } + public string msg { get; set; } /// /// 查询详情列表 diff --git a/Myshipping.Application/Service/EmbedProjectGoodsStatus/EmbedTraceProductService.cs b/Myshipping.Application/Service/EmbedProjectGoodsStatus/EmbedTraceProductService.cs index 6db0e021..16172d2e 100644 --- a/Myshipping.Application/Service/EmbedProjectGoodsStatus/EmbedTraceProductService.cs +++ b/Myshipping.Application/Service/EmbedProjectGoodsStatus/EmbedTraceProductService.cs @@ -318,9 +318,9 @@ namespace Myshipping.Application } else { - _logger.LogInformation($"{JSON.Serialize(queryDto)} 查询失败,{queryRlt.message}"); + _logger.LogInformation($"{JSON.Serialize(queryDto)} 查询失败,{queryRlt.msg}"); - throw Oops.Oh(result.resultMessage.Contains("官网查询无数据") ? "无查询结果" : "查询失败"); + throw Oops.Oh((result != null && result.resultMessage != null && result.resultMessage.Contains("官网查询无数据")) ? "无查询结果" : queryRlt.msg); } return result; diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs index 601054cb..79d40824 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs @@ -2536,6 +2536,38 @@ namespace Myshipping.Application if (bcOrder == null) throw Oops.Oh($"BC任务获取失败,不存在或已作废"); + DjyTenantParamValueOutput paramConfig = null; + DjyTenantParamValueOutput dingdingConfig = null; + + var paramList = _djyTenantParamService.GetParaCodeWithValue(new[] { CONST_AMENDMENT_DEFAULT_PARAM, + CONST_CANCELLATION_DEFAULT_PARAM, + CONST_AMENDMENT_DING_DEFAULT_PARAM, + CONST_CANCELLATION_DING_DEFAULT_PARAM }).GetAwaiter().GetResult(); + + if (baseTask.TASK_TYPE == TaskBaseTypeEnum.BC_MODIFY.ToString()) + { + if (paramList != null && paramList.Count > 0) + { + paramConfig = paramList.FirstOrDefault(a => a.ParaCode.Equals(CONST_AMENDMENT_DEFAULT_PARAM, StringComparison.OrdinalIgnoreCase)); + + dingdingConfig = paramList.FirstOrDefault(a => a.ParaCode.Equals(CONST_AMENDMENT_DING_DEFAULT_PARAM, StringComparison.OrdinalIgnoreCase)); + } + + } + else if (baseTask.TASK_TYPE == TaskBaseTypeEnum.CANCELLATION.ToString()) + { + if (paramList != null && paramList.Count > 0) + { + paramConfig = paramList.FirstOrDefault(a => a.ParaCode.Equals(CONST_CANCELLATION_DEFAULT_PARAM, StringComparison.OrdinalIgnoreCase)); + + dingdingConfig = paramList.FirstOrDefault(a => a.ParaCode.Equals(CONST_CANCELLATION_DING_DEFAULT_PARAM, StringComparison.OrdinalIgnoreCase)); + } + } + + _logger.LogInformation($"taskPKId={taskPKId} 判断是否默认转发邮件 paramConfig={JSON.Serialize(paramConfig)}"); + + + if (!bcOrder.BOOKING_SLOT_ID.HasValue || bcOrder.BOOKING_SLOT_ID.Value == 0) { var server = _namedBookingSlotServiceProvider.GetService(nameof(BookingSlotService)); @@ -2603,6 +2635,8 @@ namespace Myshipping.Application } else { + _logger.LogInformation($"taskPKId={taskPKId} 无法获取舱位信息"); + throw Oops.Oh($"无法获取舱位信息"); } } @@ -2698,35 +2732,7 @@ namespace Myshipping.Application } - DjyTenantParamValueOutput paramConfig = null; - DjyTenantParamValueOutput dingdingConfig = null; - - var paramList = _djyTenantParamService.GetParaCodeWithValue(new[] { CONST_AMENDMENT_DEFAULT_PARAM, - CONST_CANCELLATION_DEFAULT_PARAM, - CONST_AMENDMENT_DING_DEFAULT_PARAM, - CONST_CANCELLATION_DING_DEFAULT_PARAM }).GetAwaiter().GetResult(); - - if (baseTask.TASK_TYPE == TaskBaseTypeEnum.BC_MODIFY.ToString()) - { - if (paramList != null && paramList.Count > 0) - { - paramConfig = paramList.FirstOrDefault(a => a.ParaCode.Equals(CONST_AMENDMENT_DEFAULT_PARAM, StringComparison.OrdinalIgnoreCase)); - - dingdingConfig = paramList.FirstOrDefault(a => a.ParaCode.Equals(CONST_AMENDMENT_DING_DEFAULT_PARAM, StringComparison.OrdinalIgnoreCase)); - } - - } - else if (baseTask.TASK_TYPE == TaskBaseTypeEnum.CANCELLATION.ToString()) - { - if (paramList != null && paramList.Count > 0) - { - paramConfig = paramList.FirstOrDefault(a => a.ParaCode.Equals(CONST_CANCELLATION_DEFAULT_PARAM, StringComparison.OrdinalIgnoreCase)); - - dingdingConfig = paramList.FirstOrDefault(a => a.ParaCode.Equals(CONST_CANCELLATION_DING_DEFAULT_PARAM, StringComparison.OrdinalIgnoreCase)); - } - } - - _logger.LogInformation($"taskPKId={taskPKId} 判断是否默认转发邮件 paramConfig={JSON.Serialize(paramConfig)}"); + //如果值是ENABLE表示可以自动发送 if (paramConfig != null && paramConfig.ParaValue.Equals("ENABLE", StringComparison.OrdinalIgnoreCase)) @@ -2765,6 +2771,9 @@ namespace Myshipping.Application result.succ = false; result.msg = $"处理异常,原因:{ex.Message}"; + + _logger.LogInformation($"taskPKId={taskPKId} 处理异常,原因:{ex.Message}"); + //new EmailNoticeHelper().SendEmailNotice($"taskPKId={taskPKId} 转发通知邮件失败", $"taskPKId={taskPKId} 转发通知邮件失败,原因:{ex.Message}", App.Configuration["EmailNoticeDefaultUser"].GetUserEmailList());