修改舱位变更

master
jianghaiqing 6 months ago
parent a97c46b1a2
commit 8cc2d1bfef

@ -13,14 +13,14 @@ namespace Myshipping.Application
public enum CautionNoticeTaskEnum public enum CautionNoticeTaskEnum
{ {
/// <summary> /// <summary>
/// 计费周差异 /// 计费周变更
/// </summary> /// </summary>
[Description("计费周差异")] [Description("计费周变更")]
WeekAt, WeekAt,
/// <summary> /// <summary>
/// 计费日期差异 /// 计费日期变更
/// </summary> /// </summary>
[Description("计费日期差异")] [Description("计费日期变更")]
PriceCalcDate, PriceCalcDate,
/// <summary> /// <summary>
/// 直达转为中转 /// 直达转为中转
@ -28,9 +28,9 @@ namespace Myshipping.Application
[Description("直达转为中转")] [Description("直达转为中转")]
ChangeTransfer, ChangeTransfer,
/// <summary> /// <summary>
/// 船名航次变 /// 船名航次变
/// </summary> /// </summary>
[Description("船名航次变")] [Description("船名航次变")]
ChangeVesselVoyno, ChangeVesselVoyno,
/// <summary> /// <summary>
/// VGM截止时间提前 /// VGM截止时间提前

@ -3159,6 +3159,111 @@ namespace Myshipping.Application
CreateTask(CautionNoticeTaskEnum.PriceCalcDate, bcSrcDto, userList, null, slotInfo, srcPriceDate, targetPriceDate, $"提单号:{bcSrcDto.MBLNo} 计费日期变更了 原:{srcPriceDate} 新:{targetPriceDate}"); CreateTask(CautionNoticeTaskEnum.PriceCalcDate, bcSrcDto, userList, null, slotInfo, srcPriceDate, targetPriceDate, $"提单号:{bcSrcDto.MBLNo} 计费日期变更了 原:{srcPriceDate} 新:{targetPriceDate}");
} }
} }
string srcVesselVoyno = $"{bcSrcDto.Vessel}/{bcSrcDto.VoyNo}";
string targetVesselVoyno = $"{bcTargetDto.Vessel}/{bcTargetDto.VoyNo}";
if (!srcVesselVoyno.Equals(targetVesselVoyno, StringComparison.OrdinalIgnoreCase))
{
if (bookingSlotAllocList.Count > 0)
{
bookingSlotAllocList.ForEach(async ca =>
{
var bookingInfo = _repBookingOrder.AsQueryable().Filter(null, true).First(x => x.Id == ca.Alloc.BOOKING_ID && x.IsDeleted == false
&& x.TenantId == UserManager.TENANT_ID);
CreateTask(CautionNoticeTaskEnum.ChangeVesselVoyno, bcSrcDto, userList, bookingInfo, slotInfo, srcVesselVoyno, targetVesselVoyno, $"提单号:{bcSrcDto.MBLNo} 船名航次变更了 原:{srcVesselVoyno} 新:{targetVesselVoyno}");
});
}
if (slotInfo != null && !userIds.Any(p => p == slotInfo.CreatedUserId.Value))
{
CreateTask(CautionNoticeTaskEnum.ChangeVesselVoyno, bcSrcDto, userList, null, slotInfo, srcVesselVoyno, targetVesselVoyno, $"提单号:{bcSrcDto.MBLNo} 船名航次变更了 原:{srcVesselVoyno} 新:{targetVesselVoyno}");
}
}
string srcCarrierType = bcSrcDto.CarriageType ?? "";
string targetCarrierType = bcTargetDto.CarriageType ?? "";
//如果原来是直航现在变成了中转需要做重要提醒
if (!srcCarrierType.Equals(targetCarrierType, StringComparison.OrdinalIgnoreCase)
&& srcCarrierType.Equals("DIRECT_SHIP", StringComparison.OrdinalIgnoreCase)
&& targetCarrierType.Equals("TRANSFER_SHIP", StringComparison.OrdinalIgnoreCase))
{
if (bookingSlotAllocList.Count > 0)
{
bookingSlotAllocList.ForEach(async ca =>
{
var bookingInfo = _repBookingOrder.AsQueryable().Filter(null, true).First(x => x.Id == ca.Alloc.BOOKING_ID && x.IsDeleted == false
&& x.TenantId == UserManager.TENANT_ID);
CreateTask(CautionNoticeTaskEnum.ChangeTransfer, bcSrcDto, userList, bookingInfo, slotInfo, "直达", "中转", $"提单号:{bcSrcDto.MBLNo} 直达变成中转了");
});
}
if (slotInfo != null && !userIds.Any(p => p == slotInfo.CreatedUserId.Value))
{
CreateTask(CautionNoticeTaskEnum.ChangeTransfer, bcSrcDto, userList, null, slotInfo, "直达", "中转", $"提单号:{bcSrcDto.MBLNo} 直达变成中转了");
}
}
string srcVGMCut = bcSrcDto.VGMSubmissionCutDate;
string targeVGMCut = bcTargetDto.VGMSubmissionCutDate;
if (!string.IsNullOrWhiteSpace(srcVGMCut) && !string.IsNullOrWhiteSpace(targeVGMCut) && !srcVGMCut.Equals(targeVGMCut))
{
DateTime srcVGMCutDate = DateTime.Parse(srcVGMCut);
DateTime targeVGMCutDate = DateTime.Parse(targeVGMCut);
if (srcVGMCutDate > targeVGMCutDate)
{
if (bookingSlotAllocList.Count > 0)
{
bookingSlotAllocList.ForEach(async ca =>
{
var bookingInfo = _repBookingOrder.AsQueryable().Filter(null, true).First(x => x.Id == ca.Alloc.BOOKING_ID && x.IsDeleted == false
&& x.TenantId == UserManager.TENANT_ID);
CreateTask(CautionNoticeTaskEnum.VGMCutDateAdvanced, bcSrcDto, userList, bookingInfo, slotInfo, srcVGMCut, targeVGMCut, $"提单号:{bcSrcDto.MBLNo} VGM截单时间提前了 原:{srcVGMCut} 新:{targeVGMCut}");
});
}
if (slotInfo != null && !userIds.Any(p => p == slotInfo.CreatedUserId.Value))
{
CreateTask(CautionNoticeTaskEnum.VGMCutDateAdvanced, bcSrcDto, userList, null, slotInfo, srcVGMCut, targeVGMCut, $"提单号:{bcSrcDto.MBLNo} VGM截单时间提前了 原:{srcVGMCut} 新:{targeVGMCut}");
}
}
}
string srcSICut = bcSrcDto.SICutDate;
string targeSICut = bcTargetDto.SICutDate;
if (!string.IsNullOrWhiteSpace(srcSICut) && !string.IsNullOrWhiteSpace(targeSICut) && !srcSICut.Equals(targeSICut))
{
DateTime srcSICutDate = DateTime.Parse(srcSICut);
DateTime targeSICutDate = DateTime.Parse(targeSICut);
//如果新给的SI截止时间需要推送通知
if (srcSICutDate > targeSICutDate)
{
if (bookingSlotAllocList.Count > 0)
{
bookingSlotAllocList.ForEach(async ca =>
{
var bookingInfo = _repBookingOrder.AsQueryable().Filter(null, true).First(x => x.Id == ca.Alloc.BOOKING_ID && x.IsDeleted == false
&& x.TenantId == UserManager.TENANT_ID);
CreateTask(CautionNoticeTaskEnum.SICutDateAdvanced, bcSrcDto, userList, bookingInfo, slotInfo, srcSICut, targeSICut, $"提单号:{bcSrcDto.MBLNo} 样单截止时间提前了 原:{srcSICut} 新:{targeSICut}");
});
}
if (slotInfo != null && !userIds.Any(p => p == slotInfo.CreatedUserId.Value))
{
CreateTask(CautionNoticeTaskEnum.SICutDateAdvanced, bcSrcDto, userList, null, slotInfo, srcSICut, targeSICut, $"提单号:{bcSrcDto.MBLNo} 样单截止时间提前了 原:{srcSICut} 新:{targeSICut}");
}
}
}
} }
} }
catch (Exception ex) catch (Exception ex)
@ -3246,9 +3351,11 @@ namespace Myshipping.Application
messageInfo.Main.CarrierId = dto.carrier; messageInfo.Main.CarrierId = dto.carrier;
messageInfo.Main.CustomerId = dto.customerId; messageInfo.Main.CustomerId = dto.customerId;
messageInfo.Main.CustomerName = dto.customerName; messageInfo.Main.CustomerName = dto.customerName;
messageInfo.Main.MBlNo = dto.mblNo;
messageInfo.Main.ETD = dto.etd;
messageInfo.Main.TaskTitle = $"重要提醒-{dto.cautionNoticeType.GetDescription()} {dto.vessel}/{dto.voyno} {dto.etd} BLNo:{dto.mblNo}"; messageInfo.Main.TaskTitle = $"重要提醒-{dto.cautionNoticeType.GetDescription()} BLNo:{dto.mblNo} {dto.vessel}/{dto.voyno} {(dto.etd.HasValue? dto.etd.Value.ToString("yyyy-MM-dd"):"")} ";
messageInfo.Main.TaskDesp = $"重要提醒-{dto.cautionNoticeType.GetDescription()} {dto.vessel}/{dto.voyno} {dto.etd} BLNo:{dto.mblNo}"; messageInfo.Main.TaskDesp = $"重要提醒-{dto.cautionNoticeType.GetDescription()} BLNo:{dto.mblNo} {dto.vessel}/{dto.voyno} {(dto.etd.HasValue ? dto.etd.Value.ToString("yyyy-MM-dd") : "")}";
messageInfo.Main.CautionNoticeInfo = new TaskManageOrderCautionNoticeInfo messageInfo.Main.CautionNoticeInfo = new TaskManageOrderCautionNoticeInfo
{ {
@ -3355,13 +3462,22 @@ namespace Myshipping.Application
sourceBusiTypeName = "舱位管理", sourceBusiTypeName = "舱位管理",
vessel = bcSrcDto.Vessel, vessel = bcSrcDto.Vessel,
voyno = bcSrcDto.VoyNo, voyno = bcSrcDto.VoyNo,
etd = bcSrcDto.ETD,
tenentName = UserManager.TENANT_NAME, tenentName = UserManager.TENANT_NAME,
notifyContent = notifyContent, notifyContent = notifyContent,
notifyList = new List<CautionNoticeTaskNoitfyDto>() notifyList = new List<CautionNoticeTaskNoitfyDto>()
}; };
if(!string.IsNullOrWhiteSpace(bcSrcDto.ETD))
{
DateTime etd = DateTime.MinValue;
if(DateTime.TryParse(bcSrcDto.ETD,out etd))
{
notice.etd = etd;
}
}
if (bookingInfo != null) if (bookingInfo != null)
{ {
notice.bookingId = bookingInfo.Id; notice.bookingId = bookingInfo.Id;

@ -106,7 +106,7 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// ETD /// ETD
/// </summary> /// </summary>
public string etd { get; set; } public Nullable<DateTime> etd { get; set; }
/// <summary> /// <summary>
/// 委托客户ID /// 委托客户ID

Loading…
Cancel
Save