From 8ef44b6f85d4a5adad56beedfc702d63c41640b4 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 24 Jun 2024 14:03:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B1=E4=BD=8D=E5=90=88?= =?UTF-8?q?=E7=A5=A8=20=E6=96=B0=E5=A2=9E=E9=87=8D=E8=A6=81=E6=95=B4?= =?UTF-8?q?=E8=88=B9=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskCautionNoticeWholeShipDetailInfo.cs | 76 +++++++++++++ .../TaskCautionNoticeWholeShipInfo.cs | 105 ++++++++++++++++++ .../BookingLabel/IBookingLabelService.cs | 7 ++ .../Service/BookingSlot/BookingSlotService.cs | 39 +++++-- 4 files changed, 220 insertions(+), 7 deletions(-) create mode 100644 Myshipping.Application/Entity/TaskManagePlat/TaskCautionNoticeWholeShipDetailInfo.cs create mode 100644 Myshipping.Application/Entity/TaskManagePlat/TaskCautionNoticeWholeShipInfo.cs diff --git a/Myshipping.Application/Entity/TaskManagePlat/TaskCautionNoticeWholeShipDetailInfo.cs b/Myshipping.Application/Entity/TaskManagePlat/TaskCautionNoticeWholeShipDetailInfo.cs new file mode 100644 index 00000000..4c54b710 --- /dev/null +++ b/Myshipping.Application/Entity/TaskManagePlat/TaskCautionNoticeWholeShipDetailInfo.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + public class TaskCautionNoticeWholeShipDetailInfo + { + /// + /// 任务主键 + /// + public string TASK_ID { get; set; } + + /// + /// 任务提醒主键 + /// + public string P_ID { get; set; } + + /// + /// 提单号 + /// + public string MBL_NO { get; set; } + + /// + /// 订舱ID + /// + public Nullable BOOKING_ID { get; set; } + + /// + /// 舱位ID + /// + public Nullable BOOKING_SLOT_ID { get; set; } + + /// + /// 通知人ID + /// + public string NOTIFY_USER_ID { get; set; } + + /// + /// 被通知人名称 + /// + public string NOTIFY_USER_NAME { get; set; } + + /// + /// 被通知方式 + /// + public string NOTIFY_METHOD { get; set; } + + /// + /// 被通知人手机 + /// + public string NOTIFY_MOBILE { get; set; } + + /// + /// 被通知人邮箱 + /// + public string NOTIFY_EMAIL { get; set; } + + /// + /// 状态 + /// + public string STATUS { get; set; } + + /// + /// 状态名称 + /// + public string STATUS_NAME { get; set; } + + /// + /// 重试次数 + /// + public int RETRY_NUM { get; set; } + } +} diff --git a/Myshipping.Application/Entity/TaskManagePlat/TaskCautionNoticeWholeShipInfo.cs b/Myshipping.Application/Entity/TaskManagePlat/TaskCautionNoticeWholeShipInfo.cs new file mode 100644 index 00000000..689f9513 --- /dev/null +++ b/Myshipping.Application/Entity/TaskManagePlat/TaskCautionNoticeWholeShipInfo.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + /// + /// 重要任务提醒整船通知 + /// + public class TaskCautionNoticeWholeShipInfo + { + /// + /// 任务主键 + /// + public string TASK_ID { get; set; } + + /// + /// 船公司 + /// + public string CARRIER { get; set; } + + /// + /// 是否计费周差异 1-是 0-否 + /// + public bool IS_WEEK_DIFF { get; set; } + + /// + /// 是否计费日差异 1-是 0-否 + /// + public bool IS_PRICE_DATE_DIFF { get; set; } + + /// + /// 是否转为中转 1-是 0-否 + /// + public bool IS_TRANSFER { get; set; } + + /// + /// 是否船名变化 1-是 0-否 + /// + public bool IS_VESSEL_CHANGE { get; set; } + + /// + /// 是否截止时间提前 1-是 0-否 + /// + public bool IS_CUT_DATE_ADVANCED { get; set; } + + /// + /// VGM截止时间原始值 + /// + public string VGM_CUT_OLD_VAL { get; set; } + + /// + /// VGM截止时间修改值 + /// + public string VGM_CUT_NEW_VAL { get; set; } + + /// + /// SI截止时间原始值 + /// + public string SI_CUT_OLD_VAL { get; set; } + + /// + /// SI截止时间修改值 + /// + public string SI_CUT_NEW_VAL { get; set; } + + /// + /// 直达变中转原值 + /// + public string DIRECT_TO_TRANS_OLD_VAL { get; set; } + + /// + /// 直达变中转修改值 + /// + public string DIRECT_TO_TRANS_NEW_VAL { get; set; } + + /// + /// 船名原始值 + /// + public string VESSEL_OLD_VAL { get; set; } + + /// + /// 船名修改值 + /// + public string VESSEL_NEW_VAL { get; set; } + + /// + /// 航次原始值 + /// + public string VOYNO_OLD_VAL { get; set; } + + /// + /// 航次修改值 + /// + public string VOYNO_NEW_VAL { get; set; } + + /// + /// 原始值MD5 + /// + public string OLD_VAL_MD5 { get; set; } + + } +} diff --git a/Myshipping.Application/Service/BookingLabel/IBookingLabelService.cs b/Myshipping.Application/Service/BookingLabel/IBookingLabelService.cs index 71bb10c4..ce5a94e2 100644 --- a/Myshipping.Application/Service/BookingLabel/IBookingLabelService.cs +++ b/Myshipping.Application/Service/BookingLabel/IBookingLabelService.cs @@ -7,5 +7,12 @@ namespace Myshipping.Application public interface IBookingLabelService { Task> List(int? scope); + + /// + /// 设定标签 + /// + /// 请求参数 + /// + Task SetLabel(BindLabelDto input); } } diff --git a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs index 185ad108..bd654d79 100644 --- a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs @@ -74,6 +74,7 @@ namespace Myshipping.Application private readonly IEventPublisher _publisher; private readonly INamedServiceProvider _namedBookingOrderServiceProvider; private readonly INamedServiceProvider _namedTaskManageServiceProvider; + private readonly INamedServiceProvider _namedBookingLabelServiceProvider; private readonly IDjyCustomerService _djyCustomerService; private readonly IBookingValueAddedService _bookingValueAddedService; @@ -81,6 +82,7 @@ namespace Myshipping.Application private readonly IDjyTenantParamService _djyTenantParamService; private readonly ISysDataUserMenu _sysDataUserMenuService; + const string CONST_BC_FILE_CODE = "bc"; const string CONST_BC_FILE_NAME = "Booking Confirmation"; @@ -112,7 +114,7 @@ namespace Myshipping.Application SqlSugarRepository bookingSlotCompareRepository, SqlSugarRepository bookingOrderContactRepository, INamedServiceProvider namedBookingOrderServiceProvider, - + INamedServiceProvider namedBookingLabelServiceProvider, IBookingValueAddedService bookingValueAddedService, SqlSugarRepository repBookingOrder, SqlSugarRepository repLabelAllocation, @@ -152,6 +154,7 @@ namespace Myshipping.Application _djyTenantParamService = djyTenantParamService; _sysDataUserMenuService = sysDataUserMenuService; + _namedBookingLabelServiceProvider = namedBookingLabelServiceProvider; } #region 舱位 @@ -860,6 +863,9 @@ namespace Myshipping.Application CONST_BC_NOTICE_FILE_CODE, CONST_BC_NOTICE_FILE_NAME).GetAwaiter(); } } + + //触发标签自动绑定 + await GenerateSlotLabel(dto, id); } else if (dto.OpType == "update") { @@ -1019,6 +1025,9 @@ namespace Myshipping.Application //一般更新数据指的是Booking Amendment,需要与舱位进行数据比对 await PushCompareBCInfo(bcSrcDto, bcTargetDto, id, dto.BatchNo); + + //触发标签自动绑定 + await GenerateSlotLabel(dto,id); } else if (dto.OpType == "del") { @@ -3892,10 +3901,12 @@ namespace Myshipping.Application userIdList.Add(bookingInfo.CreatedUserId.Value); } - - if (bookingSlotInfo != null) + else { - userIdList.Add(bookingSlotInfo.CreatedUserId.Value); + if (bookingSlotInfo != null) + { + userIdList.Add(bookingSlotInfo.CreatedUserId.Value); + } } userIdList = userIdList.Distinct().ToList(); @@ -4092,7 +4103,7 @@ namespace Myshipping.Application .Select(a => $"{a.Key}*{a.Sum(b => b.CTNNUM)}").ToArray()); } - if (slotList.Any(a => string.IsNullOrWhiteSpace(a.LOAD_GUARANTEE_FLAG))) + if (slotList.Any(a => !string.IsNullOrWhiteSpace(a.LOAD_GUARANTEE_FLAG))) { rlt.importantNotes = string.Join(";", slotList.Where(a => !string.IsNullOrWhiteSpace(a.LOAD_GUARANTEE_FLAG)) .GroupBy(a => a.LOAD_GUARANTEE_FLAG_NAME) @@ -4244,8 +4255,9 @@ namespace Myshipping.Application /// 自动生成舱位标签 /// /// 舱位详情 + /// 舱位ID /// - private async Task GenerateSlotLabel(BookingSlotBaseApiDto dto) + private async Task GenerateSlotLabel(BookingSlotBaseApiDto dto,long id) { try { @@ -4417,7 +4429,20 @@ namespace Myshipping.Application if (ruleList.Count > 0) { - //_namedBookingLabelServiceServiceProvider. + var name = _namedBookingLabelServiceProvider + .GetService(nameof(BookingLabelService)); + + var bindModel = new BindLabelDto + { + BusinessIdArray = new[] { id }, + LabelIdArray = ruleList.Select(a => a.Id.Value).ToArray() + }; + + _logger.LogInformation($"标签绑定请求,{JSON.Serialize(bindModel)}"); + + await name.SetLabel(bindModel); + + _logger.LogInformation($"标签绑定请求完成"); } } }