From 4da5751ed9bc00ab2d4fe410b8b0c4a8deee80cb Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 21 May 2024 17:50:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BC=E4=BB=BB=E5=8A=A1=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=AE=A1=E8=B4=B9=E6=97=A5?= =?UTF-8?q?=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entity/TaskManagePlat/TaskBCInfo.cs | 5 + .../Enum/CautionNoticeTaskEnum.cs | 6 +- .../Service/BookingSlot/BookingSlotService.cs | 100 ++++++++++++++++-- .../TaskManagePlat/Dtos/TaskManageMapper.cs | 3 +- .../Dtos/TaskManageOrderBCInfo.cs | 5 + .../TaskManagePlat/TaskManageService.cs | 2 +- 6 files changed, 110 insertions(+), 11 deletions(-) diff --git a/Myshipping.Application/Entity/TaskManagePlat/TaskBCInfo.cs b/Myshipping.Application/Entity/TaskManagePlat/TaskBCInfo.cs index 250ca383..595c8270 100644 --- a/Myshipping.Application/Entity/TaskManagePlat/TaskBCInfo.cs +++ b/Myshipping.Application/Entity/TaskManagePlat/TaskBCInfo.cs @@ -391,5 +391,10 @@ namespace Myshipping.Application /// 处理时间 /// public Nullable PROCESS_DATE { get; set; } + + /// + /// 计费日期 + /// + public Nullable PRICE_CALCULATION_DATE { get; set; } } } diff --git a/Myshipping.Application/Enum/CautionNoticeTaskEnum.cs b/Myshipping.Application/Enum/CautionNoticeTaskEnum.cs index 9dc48bdd..3e3dbf92 100644 --- a/Myshipping.Application/Enum/CautionNoticeTaskEnum.cs +++ b/Myshipping.Application/Enum/CautionNoticeTaskEnum.cs @@ -28,10 +28,10 @@ namespace Myshipping.Application [Description("直达转为中转")] ChangeTransfer, /// - /// 船名变化 + /// 船名航次变化 /// - [Description("船名变化")] - ChangeVessel, + [Description("船名航次变化")] + ChangeVesselVoyno, /// /// 截止时间提前 /// diff --git a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs index 80a2e6a5..7e2ee178 100644 --- a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs @@ -2297,15 +2297,15 @@ namespace Myshipping.Application { if (bcSrcDto.CarrierId.Equals("MSK", StringComparison.OrdinalIgnoreCase)) { + var bookingList = _repAllocation.AsQueryable().Filter(null, true) + .Where(x => x.BOOKING_SLOT_ID == slotId && x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID).ToList(); + string srcWeek = bcSrcDto.WeekAt ?? ""; string targetWeek = bcTargetDto.WeekAt ?? ""; //如果计费周不一致需要推送推送任务台生成重要提醒 if (!srcWeek.Equals(targetWeek, StringComparison.OrdinalIgnoreCase)) { - var bookingList = _repAllocation.AsQueryable().Filter(null, true) - .Where(x => x.BOOKING_SLOT_ID == slotId && x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID).ToList(); - if (bookingList.Count > 0) { bookingList.ForEach(async ca => @@ -2348,9 +2348,6 @@ namespace Myshipping.Application if (!srcPriceCalcDate.Equals(targePriceCalcDate, StringComparison.OrdinalIgnoreCase)) { - var bookingList = _repAllocation.AsQueryable().Filter(null, true) - .Where(x => x.BOOKING_SLOT_ID == slotId && x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID).ToList(); - if (bookingList.Count > 0) { bookingList.ForEach(async ca => @@ -2387,6 +2384,97 @@ namespace Myshipping.Application })); } } + + string srcVessel = bcSrcDto.Vessel ?? ""; + string targetVessel = bcTargetDto.Vessel ?? ""; + + string srcVoyno = bcSrcDto.VoyNo ?? ""; + string targetVoyno = bcTargetDto.VoyNo ?? ""; + + //船名航次出现变化需要做重要提醒 + if (!srcVessel.Equals(targetVessel, StringComparison.OrdinalIgnoreCase) || !srcVoyno.Equals(targetVoyno, StringComparison.OrdinalIgnoreCase)) + { + if (bookingList.Count > 0) + { + bookingList.ForEach(async ca => + { + await _publisher.PublishAsync(new ChannelEventSource("CautionNoticeTask:Add", + new CautionNoticeTaskDto + { + cautionNoticeType = CautionNoticeTaskEnum.ChangeVesselVoyno, + bookingId = ca.BOOKING_ID, + bookingSlotId = ca.BOOKING_SLOT_ID, + createTime = DateTime.Now, + origVal = $"{srcVessel}/{srcVoyno}", + newVal = $"{targetVessel}/{targetVoyno}", + tenentId = UserManager.TENANT_ID, + userId = UserManager.UserId, + userName = UserManager.Name, + })); + + }); + } + else + { + await _publisher.PublishAsync(new ChannelEventSource("CautionNoticeTask:Add", + new CautionNoticeTaskDto + { + cautionNoticeType = CautionNoticeTaskEnum.ChangeVesselVoyno, + bookingSlotId = slotId, + createTime = DateTime.Now, + origVal = srcWeek, + newVal = targetWeek, + tenentId = UserManager.TENANT_ID, + userId = UserManager.UserId, + userName = UserManager.Name, + })); + } + } + + string srcCarrierType = bcSrcDto.CarriageType ?? ""; + string targetCarrierType = bcTargetDto.CarriageType ?? ""; + + //如果原来是直航现在变成了中转需要做重要提醒 + if (!srcVessel.Equals(targetVessel, StringComparison.OrdinalIgnoreCase) + && srcVessel.Equals("DIRECT_SHIP", StringComparison.OrdinalIgnoreCase) + && targetCarrierType.Equals("TRANSFER_SHIP", StringComparison.OrdinalIgnoreCase)) + { + if (bookingList.Count > 0) + { + bookingList.ForEach(async ca => + { + await _publisher.PublishAsync(new ChannelEventSource("CautionNoticeTask:Add", + new CautionNoticeTaskDto + { + cautionNoticeType = CautionNoticeTaskEnum.ChangeTransfer, + bookingId = ca.BOOKING_ID, + bookingSlotId = ca.BOOKING_SLOT_ID, + createTime = DateTime.Now, + origVal = srcCarrierType, + newVal = targetCarrierType, + tenentId = UserManager.TENANT_ID, + userId = UserManager.UserId, + userName = UserManager.Name, + })); + + }); + } + else + { + await _publisher.PublishAsync(new ChannelEventSource("CautionNoticeTask:Add", + new CautionNoticeTaskDto + { + cautionNoticeType = CautionNoticeTaskEnum.ChangeTransfer, + bookingSlotId = slotId, + createTime = DateTime.Now, + origVal = srcCarrierType, + newVal = targetCarrierType, + tenentId = UserManager.TENANT_ID, + userId = UserManager.UserId, + userName = UserManager.Name, + })); + } + } } } #endregion diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs index d94c858d..88ac7396 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs @@ -817,7 +817,8 @@ namespace Myshipping.Application .Map(dest => dest.SECOND_ETD, src => src.SecondETD) .Map(dest => dest.SECOND_ETA, src => src.SecondETA) .Map(dest => dest.BOOKING_COMFIRM_DATE, src => src.BookingConfirmDate) - .Map(dest => dest.BATCH_NO, src => src.BatchNo); + .Map(dest => dest.BATCH_NO, src => src.BatchNo) + .Map(dest => dest.PRICE_CALCULATION_DATE, src => src.PriceCalculationDate); config.ForType() .Map(dest => dest.CtnCode, src => src.CTNCODE) diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderBCInfo.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderBCInfo.cs index 2aa4d7e4..b2b07b10 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderBCInfo.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderBCInfo.cs @@ -346,5 +346,10 @@ namespace Myshipping.Application /// 批次号 /// public string BatchNo { get; set; } + + /// + /// 计费时间 + /// + public Nullable PriceCalculationDate { get; set; } } } diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index 4d10c72e..1a11c807 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -1431,7 +1431,7 @@ namespace Myshipping.Application { taskCautionNoticeInfo.IS_PRICE_DATE_DIFF = true; } - else if (info.Main.CautionNoticeInfo.CautionNoticeType == CautionNoticeTaskEnum.ChangeVessel) + else if (info.Main.CautionNoticeInfo.CautionNoticeType == CautionNoticeTaskEnum.ChangeVesselVoyno) { taskCautionNoticeInfo.IS_VESSEL_CHANGE = true; }