修改重要提醒任务

master
jianghaiqing 6 months ago
parent 2cf298d5ce
commit 24cfe5da8c

@ -3141,15 +3141,14 @@ namespace Myshipping.Application
CreateTask(CautionNoticeTaskEnum.WeekAt, bcSrcDto, userList, bookingInfo, slotInfo, srcWeek, targetWeek, $"提单号:{bcSrcDto.MBLNo} 计费周变更了 原:{srcWeek} 新:{targetWeek}"); CreateTask(CautionNoticeTaskEnum.WeekAt, bcSrcDto, userList, bookingInfo, slotInfo, srcWeek, targetWeek, $"提单号:{bcSrcDto.MBLNo} 计费周变更了 原:{srcWeek} 新:{targetWeek}");
}); });
} }
else if (slotInfo != null)
if (slotInfo != null && !userIds.Any(p => p == slotInfo.CreatedUserId.Value))
{ {
CreateTask(CautionNoticeTaskEnum.WeekAt, bcSrcDto, userList, null, slotInfo, srcWeek, targetWeek, $"提单号:{bcSrcDto.MBLNo} 计费周变更了 原:{srcWeek} 新:{targetWeek}"); CreateTask(CautionNoticeTaskEnum.WeekAt, bcSrcDto, userList, null, slotInfo, srcWeek, targetWeek, $"提单号:{bcSrcDto.MBLNo} 计费周变更了 原:{srcWeek} 新:{targetWeek}");
} }
} }
string srcPriceDate = bcSrcDto.PriceCalculationDate.HasValue? bcSrcDto.PriceCalculationDate.Value.ToString("yyyy-MM-dd"): ""; string srcPriceDate = bcSrcDto.PriceCalculationDate.HasValue? bcSrcDto.PriceCalculationDate.Value.ToString("yyyy-MM-dd"): "";
string targetPriceDate = bcTargetDto.PriceCalculationDate.HasValue ? bcSrcDto.PriceCalculationDate.Value.ToString("yyyy-MM-dd") : ""; string targetPriceDate = bcTargetDto.PriceCalculationDate.HasValue ? bcTargetDto.PriceCalculationDate.Value.ToString("yyyy-MM-dd") : "";
if (!srcPriceDate.Equals(targetPriceDate, StringComparison.OrdinalIgnoreCase)) if (!srcPriceDate.Equals(targetPriceDate, StringComparison.OrdinalIgnoreCase))
{ {
@ -3211,8 +3210,7 @@ namespace Myshipping.Application
CreateTask(CautionNoticeTaskEnum.ChangeTransfer, bcSrcDto, userList, bookingInfo, slotInfo, "直达", "中转", $"提单号:{bcSrcDto.MBLNo} 直达变成中转了"); CreateTask(CautionNoticeTaskEnum.ChangeTransfer, bcSrcDto, userList, bookingInfo, slotInfo, "直达", "中转", $"提单号:{bcSrcDto.MBLNo} 直达变成中转了");
}); });
} }
else if (slotInfo != null)
if (slotInfo != null && !userIds.Any(p => p == slotInfo.CreatedUserId.Value))
{ {
CreateTask(CautionNoticeTaskEnum.ChangeTransfer, bcSrcDto, userList, null, slotInfo, "直达", "中转", $"提单号:{bcSrcDto.MBLNo} 直达变成中转了"); CreateTask(CautionNoticeTaskEnum.ChangeTransfer, bcSrcDto, userList, null, slotInfo, "直达", "中转", $"提单号:{bcSrcDto.MBLNo} 直达变成中转了");
} }
@ -3238,8 +3236,7 @@ namespace Myshipping.Application
CreateTask(CautionNoticeTaskEnum.VGMCutDateAdvanced, bcSrcDto, userList, bookingInfo, slotInfo, srcVGMCut, targeVGMCut, $"提单号:{bcSrcDto.MBLNo} VGM截单时间提前了 原:{srcVGMCut} 新:{targeVGMCut}"); CreateTask(CautionNoticeTaskEnum.VGMCutDateAdvanced, bcSrcDto, userList, bookingInfo, slotInfo, srcVGMCut, targeVGMCut, $"提单号:{bcSrcDto.MBLNo} VGM截单时间提前了 原:{srcVGMCut} 新:{targeVGMCut}");
}); });
} }
else if (slotInfo != null)
if (slotInfo != null && !userIds.Any(p => p == slotInfo.CreatedUserId.Value))
{ {
CreateTask(CautionNoticeTaskEnum.VGMCutDateAdvanced, bcSrcDto, userList, null, slotInfo, srcVGMCut, targeVGMCut, $"提单号:{bcSrcDto.MBLNo} VGM截单时间提前了 原:{srcVGMCut} 新:{targeVGMCut}"); CreateTask(CautionNoticeTaskEnum.VGMCutDateAdvanced, bcSrcDto, userList, null, slotInfo, srcVGMCut, targeVGMCut, $"提单号:{bcSrcDto.MBLNo} VGM截单时间提前了 原:{srcVGMCut} 新:{targeVGMCut}");
} }
@ -3267,8 +3264,7 @@ namespace Myshipping.Application
CreateTask(CautionNoticeTaskEnum.SICutDateAdvanced, bcSrcDto, userList, bookingInfo, slotInfo, srcSICut, targeSICut, $"提单号:{bcSrcDto.MBLNo} 样单截止时间提前了 原:{srcSICut} 新:{targeSICut}"); CreateTask(CautionNoticeTaskEnum.SICutDateAdvanced, bcSrcDto, userList, bookingInfo, slotInfo, srcSICut, targeSICut, $"提单号:{bcSrcDto.MBLNo} 样单截止时间提前了 原:{srcSICut} 新:{targeSICut}");
}); });
} }
else if (slotInfo != null)
if (slotInfo != null && !userIds.Any(p => p == slotInfo.CreatedUserId.Value))
{ {
CreateTask(CautionNoticeTaskEnum.SICutDateAdvanced, bcSrcDto, userList, null, slotInfo, srcSICut, targeSICut, $"提单号:{bcSrcDto.MBLNo} 样单截止时间提前了 原:{srcSICut} 新:{targeSICut}"); CreateTask(CautionNoticeTaskEnum.SICutDateAdvanced, bcSrcDto, userList, null, slotInfo, srcSICut, targeSICut, $"提单号:{bcSrcDto.MBLNo} 样单截止时间提前了 原:{srcSICut} 新:{targeSICut}");
} }
@ -3278,9 +3274,9 @@ namespace Myshipping.Application
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogInformation($"提单号:{bcSrcDto.MBLNo} slotId={slotId} 估算差异重要提醒发生异常"); _logger.LogInformation($"提单号:{bcSrcDto.MBLNo} slotId={slotId} 估算差异重要提醒发生异常,原因:{ex.Message}");
new EmailNoticeHelper().SendEmailNotice($"MBLNO={bcSrcDto.MBLNo} slotId={slotId} 估算差异重要提醒发生异常", $"MBLNO={bcSrcDto.MBLNo} slotId={slotId} 估算差异重要提醒发生异常", App.Configuration["EmailNoticeDefaultUser"].GetUserEmailList()); new EmailNoticeHelper().SendEmailNotice($"MBLNO={bcSrcDto.MBLNo} slotId={slotId} 估算差异重要提醒发生异常", $"MBLNO={bcSrcDto.MBLNo} slotId={slotId} 估算差异重要提醒发生异常,原因:{ex.Message}", App.Configuration["EmailNoticeDefaultUser"].GetUserEmailList());
} }
} }
#endregion #endregion

Loading…
Cancel
Save