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 { 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 e09404ba..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($"无法获取舱位信息"); } } @@ -2632,6 +2666,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 +2724,7 @@ namespace Myshipping.Application else { _logger.LogInformation($"taskPKId={taskPKId} 更新订舱详情失败没有对应舱位ID"); - } + }*/ } else { @@ -2697,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)) @@ -2764,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()); 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)