|
|
@ -63,6 +63,7 @@ namespace Myshipping.Application
|
|
|
|
private readonly IDjyCustomerService _djyCustomerService;
|
|
|
|
private readonly IDjyCustomerService _djyCustomerService;
|
|
|
|
private readonly IBookingValueAddedService _bookingValueAddedService;
|
|
|
|
private readonly IBookingValueAddedService _bookingValueAddedService;
|
|
|
|
private readonly IBookingLabelService _bookingLabelService;
|
|
|
|
private readonly IBookingLabelService _bookingLabelService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const string CONST_BC_FILE_CODE = "bc";
|
|
|
|
const string CONST_BC_FILE_CODE = "bc";
|
|
|
|
const string CONST_BC_FILE_NAME = "Booking Confirmation";
|
|
|
|
const string CONST_BC_FILE_NAME = "Booking Confirmation";
|
|
|
@ -92,6 +93,7 @@ namespace Myshipping.Application
|
|
|
|
SqlSugarRepository<BookingSlotCompare> bookingSlotCompareRepository,
|
|
|
|
SqlSugarRepository<BookingSlotCompare> bookingSlotCompareRepository,
|
|
|
|
SqlSugarRepository<BookingOrderContact> bookingOrderContactRepository,
|
|
|
|
SqlSugarRepository<BookingOrderContact> bookingOrderContactRepository,
|
|
|
|
INamedServiceProvider<IBookingOrderService> namedBookingOrderServiceProvider,
|
|
|
|
INamedServiceProvider<IBookingOrderService> namedBookingOrderServiceProvider,
|
|
|
|
|
|
|
|
|
|
|
|
IBookingValueAddedService bookingValueAddedService,
|
|
|
|
IBookingValueAddedService bookingValueAddedService,
|
|
|
|
SqlSugarRepository<BookingOrder> repBookingOrder,
|
|
|
|
SqlSugarRepository<BookingOrder> repBookingOrder,
|
|
|
|
SqlSugarRepository<BookingLabelAllocation> repLabelAllocation,
|
|
|
|
SqlSugarRepository<BookingLabelAllocation> repLabelAllocation,
|
|
|
@ -119,6 +121,8 @@ namespace Myshipping.Application
|
|
|
|
_repBookingOrder = repBookingOrder;
|
|
|
|
_repBookingOrder = repBookingOrder;
|
|
|
|
_repLabelAllocation = repLabelAllocation;
|
|
|
|
_repLabelAllocation = repLabelAllocation;
|
|
|
|
_bookingLabelService = bookingLabelService;
|
|
|
|
_bookingLabelService = bookingLabelService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 舱位
|
|
|
|
#region 舱位
|
|
|
@ -722,6 +726,9 @@ namespace Myshipping.Application
|
|
|
|
TaskBCInfoDto bcSrcDto = model.Adapt<TaskBCInfoDto>();
|
|
|
|
TaskBCInfoDto bcSrcDto = model.Adapt<TaskBCInfoDto>();
|
|
|
|
TaskBCInfoDto bcTargetDto = dto.DataObj.Adapt<TaskBCInfoDto>();
|
|
|
|
TaskBCInfoDto bcTargetDto = dto.DataObj.Adapt<TaskBCInfoDto>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//执行差异重要提醒
|
|
|
|
|
|
|
|
//await MeasureDiffCautionTask(bcSrcDto, bcTargetDto, model.Id);
|
|
|
|
|
|
|
|
|
|
|
|
//提取箱信息
|
|
|
|
//提取箱信息
|
|
|
|
var ctnList = _repCtn.AsQueryable().Filter(null, true)
|
|
|
|
var ctnList = _repCtn.AsQueryable().Filter(null, true)
|
|
|
|
.Where(x => x.IsDeleted == false && x.TenantId.Value == UserManager.TENANT_ID
|
|
|
|
.Where(x => x.IsDeleted == false && x.TenantId.Value == UserManager.TENANT_ID
|
|
|
@ -2145,6 +2152,113 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 估算差异重要提醒
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 估算差异重要提醒
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="bcSrcDto">原舱位详情</param>
|
|
|
|
|
|
|
|
/// <param name="bcTargetDto">新舱位详情</param>
|
|
|
|
|
|
|
|
/// <param name="slotId">舱位ID</param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
|
|
|
public async Task MeasureDiffCautionTask(TaskBCInfoDto bcSrcDto, TaskBCInfoDto bcTargetDto, long slotId)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (bcSrcDto.CarrierId.Equals("MSK", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
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 =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await _publisher.PublishAsync(new ChannelEventSource("CautionNoticeTask:Add",
|
|
|
|
|
|
|
|
new CautionNoticeTaskDto
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cautionNoticeType = CautionNoticeTaskEnum.WeekAt,
|
|
|
|
|
|
|
|
bookingId = ca.BOOKING_ID,
|
|
|
|
|
|
|
|
bookingSlotId = ca.BOOKING_SLOT_ID,
|
|
|
|
|
|
|
|
createTime = DateTime.Now,
|
|
|
|
|
|
|
|
origVal = srcWeek,
|
|
|
|
|
|
|
|
newVal = targetWeek,
|
|
|
|
|
|
|
|
tenentId = UserManager.TENANT_ID,
|
|
|
|
|
|
|
|
userId = UserManager.UserId,
|
|
|
|
|
|
|
|
userName = UserManager.Name,
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await _publisher.PublishAsync(new ChannelEventSource("CautionNoticeTask:Add",
|
|
|
|
|
|
|
|
new CautionNoticeTaskDto
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cautionNoticeType = CautionNoticeTaskEnum.WeekAt,
|
|
|
|
|
|
|
|
bookingSlotId = slotId,
|
|
|
|
|
|
|
|
createTime = DateTime.Now,
|
|
|
|
|
|
|
|
origVal = srcWeek,
|
|
|
|
|
|
|
|
newVal = targetWeek,
|
|
|
|
|
|
|
|
tenentId = UserManager.TENANT_ID,
|
|
|
|
|
|
|
|
userId = UserManager.UserId,
|
|
|
|
|
|
|
|
userName = UserManager.Name,
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string srcPriceCalcDate = bcSrcDto.PriceCalculationDate.HasValue ? bcSrcDto.PriceCalculationDate.Value.ToString("yyyy-MM-dd") : "";
|
|
|
|
|
|
|
|
string targePriceCalcDate = bcTargetDto.PriceCalculationDate.HasValue ? bcTargetDto.PriceCalculationDate.Value.ToString("yyyy-MM-dd") : "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await _publisher.PublishAsync(new ChannelEventSource("CautionNoticeTask:Add",
|
|
|
|
|
|
|
|
new CautionNoticeTaskDto
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cautionNoticeType = CautionNoticeTaskEnum.PriceCalcDate,
|
|
|
|
|
|
|
|
bookingId = ca.BOOKING_ID,
|
|
|
|
|
|
|
|
bookingSlotId = ca.BOOKING_SLOT_ID,
|
|
|
|
|
|
|
|
createTime = DateTime.Now,
|
|
|
|
|
|
|
|
origVal = srcWeek,
|
|
|
|
|
|
|
|
newVal = targetWeek,
|
|
|
|
|
|
|
|
tenentId = UserManager.TENANT_ID,
|
|
|
|
|
|
|
|
userId = UserManager.UserId,
|
|
|
|
|
|
|
|
userName = UserManager.Name,
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await _publisher.PublishAsync(new ChannelEventSource("CautionNoticeTask:Add",
|
|
|
|
|
|
|
|
new CautionNoticeTaskDto
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cautionNoticeType = CautionNoticeTaskEnum.PriceCalcDate,
|
|
|
|
|
|
|
|
bookingSlotId = slotId,
|
|
|
|
|
|
|
|
createTime = DateTime.Now,
|
|
|
|
|
|
|
|
origVal = srcWeek,
|
|
|
|
|
|
|
|
newVal = targetWeek,
|
|
|
|
|
|
|
|
tenentId = UserManager.TENANT_ID,
|
|
|
|
|
|
|
|
userId = UserManager.UserId,
|
|
|
|
|
|
|
|
userName = UserManager.Name,
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|