|
|
@ -59,6 +59,8 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
private readonly ITaskLogService _logService;
|
|
|
|
private readonly ITaskLogService _logService;
|
|
|
|
private readonly ITaskMailService _taskMailService;
|
|
|
|
private readonly ITaskMailService _taskMailService;
|
|
|
|
private readonly ITaskAllocationService _taskAllocationService;
|
|
|
|
private readonly ITaskAllocationService _taskAllocationService;
|
|
|
|
|
|
|
|
private readonly ISeaExportCommonService _seaExportCommonService;
|
|
|
|
|
|
|
|
private readonly IBookingSlotService _bookingSlotService;
|
|
|
|
|
|
|
|
|
|
|
|
public TaskManageCutDateChangeService(IUser user, ILogger<TaskManageCutDateChangeService> logger,
|
|
|
|
public TaskManageCutDateChangeService(IUser user, ILogger<TaskManageCutDateChangeService> logger,
|
|
|
|
ISaasDbService saasDbService,
|
|
|
|
ISaasDbService saasDbService,
|
|
|
@ -71,6 +73,8 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
_userService = serviceProvider.GetRequiredService<IUserService>();
|
|
|
|
_userService = serviceProvider.GetRequiredService<IUserService>();
|
|
|
|
_taskMailService = serviceProvider.GetRequiredService<ITaskMailService>();
|
|
|
|
_taskMailService = serviceProvider.GetRequiredService<ITaskMailService>();
|
|
|
|
_taskAllocationService = serviceProvider.GetRequiredService<ITaskAllocationService>();
|
|
|
|
_taskAllocationService = serviceProvider.GetRequiredService<ITaskAllocationService>();
|
|
|
|
|
|
|
|
_seaExportCommonService = serviceProvider.GetRequiredService<ISeaExportCommonService>();
|
|
|
|
|
|
|
|
_bookingSlotService = serviceProvider.GetRequiredService<IBookingSlotService>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 通过任务主键获取截止时间变更详情
|
|
|
|
#region 通过任务主键获取截止时间变更详情
|
|
|
@ -210,136 +214,127 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 自动更新订单的截单日期并转发
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 自动更新订单的截单日期并转发
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="taskPKId">截止时间变更任务主键</param>
|
|
|
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
|
|
|
public async Task<DataResult> AutoUpdateOrderCutDateAndTranmitToCustomer(long taskPKId)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SeaExportOrderExtension orderInfo = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var queryRlt = await SearchAndMarkBookingOrder(taskPKId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!queryRlt.Succeeded)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new Exception(queryRlt.Message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
orderInfo = queryRlt.Data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新海运出口截单时间
|
|
|
|
|
|
|
|
var orderRlt = UpdateBookingOrderCutDate(taskPKId, orderInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新舱位的截单时间
|
|
|
|
|
|
|
|
var slotRlt = UpdateBookingSlotCutDate(taskPKId, orderInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//如果没有配置批量,则按单票发送邮件
|
|
|
|
|
|
|
|
//var rlt = await SendEmailToCustomer(taskPKId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//logger.LogInformation($"taskPKId={taskPKId} 推送邮件完成,结果:{JsonConvert.SerializeObject(rlt)}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//Logger.Log(NLog.LogLevel.Info, $"taskPKId={taskPKId} 自动更新订单的截单日期并转发失败异常,原因:{ex.Message}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Failed( $"自动更新订单的截单日期并转发失败,原因:{ex.Message}", MultiLanguageConst.Operation_Failed);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed(string.Empty, MultiLanguageConst.OperationSuccess);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 更新订舱截单时间
|
|
|
|
#region 更新订舱截单时间
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 更新订舱截单时间
|
|
|
|
/// 更新订舱截单时间
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="taskPKId">任务主键</param>
|
|
|
|
/// <param name="taskPKId">任务主键</param>
|
|
|
|
/// <param name="orderInfo">相关海运出口订舱详情</param>
|
|
|
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
private async Task<DataResult> UpdateBookingOrderCutDate(long taskPKId, SeaExportOrderExtension orderInfo)
|
|
|
|
private async Task<DataResult> UpdateBookingOrderCutDate(long taskPKId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
|
|
|
|
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
|
|
|
|
//任务不考虑OrgId,这里去掉
|
|
|
|
|
|
|
|
tenantDb.QueryFilter.Clear<IOrgId>();
|
|
|
|
tenantDb.QueryFilter.Clear<IOrgId>();
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var queryList = await tenantDb.Queryable<TaskBaseInfo>()
|
|
|
|
var entity = tenantDb.Queryable<TaskCutDateChangeInfo>().Filter(null, true).First(a => a.TASK_ID == taskPKId);
|
|
|
|
.InnerJoin<TaskCutDateChangeInfo>((a, b) => a.Id == b.TASK_ID)
|
|
|
|
|
|
|
|
.Where((a, b) => a.Id == taskPKId)
|
|
|
|
|
|
|
|
.Select((a, b) => new { Base = a, Cut = b })
|
|
|
|
|
|
|
|
.ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//任务主键{taskPkId}无法获取业务信息
|
|
|
|
|
|
|
|
if (queryList.Count == 0)
|
|
|
|
|
|
|
|
throw new Exception(string.Format(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.TaskBaseInfoFromTaskIdNull)), taskPKId));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<long> ids = new List<long> { orderInfo.currOrder.Id };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var cutBase = queryList.FirstOrDefault().Cut;
|
|
|
|
var cutDetail = await tenantDb.Queryable<TaskCutDateChangeDetailInfo>().FirstAsync(a => a.P_ID == entity.Id);
|
|
|
|
|
|
|
|
|
|
|
|
var cutDetail = await tenantDb.Queryable<TaskCutDateChangeDetailInfo>().FirstAsync(a => a.P_ID == cutBase.Id);
|
|
|
|
var queryRlt = await _seaExportService.SearchOrderInfo(entity.MBL_NO);
|
|
|
|
|
|
|
|
|
|
|
|
if (orderInfo.splitOrMergeFlag == 1)
|
|
|
|
if (!queryRlt.Succeeded)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (orderInfo.otherOrderList.Count > 0)
|
|
|
|
logger.LogInformation($"匹配订单信息失败 mblno={entity.MBL_NO},原因:{queryRlt.Message}");
|
|
|
|
ids.AddRange(orderInfo.otherOrderList.Select(a => a.Id).ToList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Logger.Log(NLog.LogLevel.Info, $"截止时间变更主键{taskPKId} MBLNO={cutDetail.MBL_NO} 检索海运出口订单匹配到拆票信息 ids={string.Join(",", ids.ToArray())}");
|
|
|
|
return DataResult.Failed($"匹配订单信息失败 mblno={entity.MBL_NO},原因:{queryRlt.Message}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var id in ids)
|
|
|
|
var orderInfo = queryRlt.Data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (orderInfo.currOrder.SplitOrMergeFlag == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
StringBuilder doBuilder = new StringBuilder();
|
|
|
|
List<long> orderIdList = new List<long> { orderInfo.currOrder.Id };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (orderInfo.otherOrderList != null && orderInfo.otherOrderList.Count > 0)
|
|
|
|
|
|
|
|
orderIdList.AddRange(orderInfo.otherOrderList.Select(t => t.Id).ToList());
|
|
|
|
|
|
|
|
|
|
|
|
var bookingInfo = await tenantDb.Queryable<SeaExport>().FirstAsync(a => a.Id == id);
|
|
|
|
var orderList = tenantDb.Queryable<SeaExport>().Filter(null, true).Where(a => orderIdList.Contains(a.Id)).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
if (bookingInfo != null)
|
|
|
|
foreach (var id in orderIdList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
var currOrder = orderList.FirstOrDefault(b => b.Id == id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SeaExportOpenEditReq bkModel = new SeaExportOpenEditReq
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Id = id,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder doBuilder = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
|
|
if (cutDetail.VGM_CUT.HasValue)
|
|
|
|
if (cutDetail.VGM_CUT.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
doBuilder.Append($"VGM CUT 原:{bookingInfo.VGMCloseDate} 新:{cutDetail.VGM_CUT.Value}");
|
|
|
|
doBuilder.Append($"VGM CUT 原:{currOrder.VGMCloseDate} 新:{cutDetail.VGM_CUT.Value}");
|
|
|
|
bookingInfo.VGMCloseDate = cutDetail.VGM_CUT.Value;
|
|
|
|
bkModel.VGMCloseDate = cutDetail.VGM_CUT.Value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (cutDetail.CY_CUTOFF.HasValue)
|
|
|
|
if (cutDetail.CY_CUTOFF.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
doBuilder.Append($"CY CUT 原:{bookingInfo.ClosingDate} 新:{cutDetail.CY_CUTOFF.Value}");
|
|
|
|
doBuilder.Append($"CY CUT 原:{currOrder.ClosingDate} 新:{cutDetail.CY_CUTOFF.Value}");
|
|
|
|
|
|
|
|
|
|
|
|
bookingInfo.ClosingDate = cutDetail.CY_CUTOFF.Value;
|
|
|
|
bkModel.ClosingDate = cutDetail.CY_CUTOFF.Value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (cutDetail.SI_CUTOFF.HasValue)
|
|
|
|
if (cutDetail.SI_CUTOFF.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
doBuilder.Append($"SI CUT 原:{bookingInfo.CloseDocDate} 新:{cutDetail.SI_CUTOFF.Value}");
|
|
|
|
doBuilder.Append($"SI CUT 原:{currOrder.CloseDocDate} 新:{cutDetail.SI_CUTOFF.Value}");
|
|
|
|
|
|
|
|
|
|
|
|
bookingInfo.CloseDocDate = cutDetail.SI_CUTOFF.Value;
|
|
|
|
bkModel.CloseDocDate = cutDetail.SI_CUTOFF.Value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tenantDb.Updateable<SeaExport>(bookingInfo).UpdateColumns(it => new
|
|
|
|
var bkRlt = await _seaExportCommonService.SeaExportOpenEdit(bkModel);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (bkRlt.Succeeded)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
it.VGMCloseDate,
|
|
|
|
logger.LogInformation($"taskPkId={taskPKId} 提单号{currOrder.MBLNO} 更新订舱数据成功 {doBuilder.ToString()}");
|
|
|
|
it.ClosingDate,
|
|
|
|
}
|
|
|
|
it.CloseDocDate
|
|
|
|
}
|
|
|
|
}).ExecuteCommand();
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SeaExportOpenEditReq bkModel = new SeaExportOpenEditReq
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Id = orderInfo.currOrder.Id,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder doBuilder = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (cutDetail.VGM_CUT.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
doBuilder.Append($"VGM CUT 原:{orderInfo.currOrder.VGMCloseDate} 新:{cutDetail.VGM_CUT.Value}");
|
|
|
|
|
|
|
|
bkModel.VGMCloseDate = cutDetail.VGM_CUT.Value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (cutDetail.CY_CUTOFF.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
doBuilder.Append($"CY CUT 原:{orderInfo.currOrder.ClosingDate} 新:{cutDetail.CY_CUTOFF.Value}");
|
|
|
|
|
|
|
|
|
|
|
|
//Logger.Log(NLog.LogLevel.Info, $"截止时间变更主键{taskPKId} id={id} mblno={bookingInfo.MBLNO} 更新订舱完毕 详情 {doBuilder.ToString()}");
|
|
|
|
bkModel.ClosingDate = cutDetail.CY_CUTOFF.Value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (cutDetail.SI_CUTOFF.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
doBuilder.Append($"SI CUT 原:{orderInfo.currOrder.CloseDocDate} 新:{cutDetail.SI_CUTOFF.Value}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bkModel.CloseDocDate = cutDetail.SI_CUTOFF.Value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var bkRlt = await _seaExportCommonService.SeaExportOpenEdit(bkModel);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (bkRlt.Succeeded)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
logger.LogInformation($"taskPkId={taskPKId} 提单号{entity.MBL_NO} 更新订舱数据成功 {doBuilder.ToString()}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch(Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Logger.Log(NLog.LogLevel.Info, $"taskPKId={taskPKId} 自动更新订单的截单日期更新订舱异常,原因:{ex.Message}");
|
|
|
|
logger.LogInformation($"taskPKId={taskPKId} 更新订单截止时间异常,原因:{ex.Message}");
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Failed($"自动更新订单的截单日期更新订舱,原因:{ex.Message}", MultiLanguageConst.Operation_Failed);
|
|
|
|
return DataResult.Failed($"更新订单截止时间异常,原因:{ex.Message}", MultiLanguageConst.OperationSuccess);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed(string.Empty, MultiLanguageConst.OperationSuccess);
|
|
|
|
return DataResult.Successed("更新成功", MultiLanguageConst.OperationSuccess);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
@ -350,7 +345,7 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
/// <param name="taskPKId">任务主键</param>
|
|
|
|
/// <param name="taskPKId">任务主键</param>
|
|
|
|
/// <param name="orderInfo">相关海运出口订舱详情</param>
|
|
|
|
/// <param name="orderInfo">相关海运出口订舱详情</param>
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
private async Task<DataResult> UpdateBookingSlotCutDate(long taskPKId, SeaExportOrderExtension orderInfo)
|
|
|
|
private async Task<DataResult> UpdateBookingSlotCutDate(long taskPKId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
|
|
|
|
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
|
|
|
|
//任务不考虑OrgId,这里去掉
|
|
|
|
//任务不考虑OrgId,这里去掉
|
|
|
@ -358,21 +353,15 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var queryList = await tenantDb.Queryable<TaskBaseInfo>()
|
|
|
|
var entity = tenantDb.Queryable<TaskCutDateChangeInfo>().Filter(null, true).First(a => a.TASK_ID == taskPKId);
|
|
|
|
.InnerJoin<TaskCutDateChangeInfo>((a, b) => a.Id == b.TASK_ID)
|
|
|
|
|
|
|
|
.Where((a, b) => a.Id == taskPKId)
|
|
|
|
|
|
|
|
.Select((a, b) => new { Base = a, Cut = b })
|
|
|
|
|
|
|
|
.ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//任务主键{taskPkId}无法获取业务信息
|
|
|
|
|
|
|
|
if (queryList.Count == 0)
|
|
|
|
|
|
|
|
throw new Exception(string.Format(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.TaskBaseInfoFromTaskIdNull)), taskPKId));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var cutBase = queryList.FirstOrDefault().Cut;
|
|
|
|
var cutDetail = await tenantDb.Queryable<TaskCutDateChangeDetailInfo>().FirstAsync(a => a.P_ID == entity.Id);
|
|
|
|
|
|
|
|
|
|
|
|
var cutDetail = await tenantDb.Queryable<TaskCutDateChangeDetailInfo>().FirstAsync(a => a.P_ID == cutBase.Id);
|
|
|
|
var slotOrder = await tenantDb.Queryable<BookingSlotBase>().FirstAsync(a => a.SlotBookingNo == entity.MBL_NO);
|
|
|
|
|
|
|
|
|
|
|
|
var slotOrder = await tenantDb.Queryable<BookingSlotBase>().FirstAsync(a => a.SlotBookingNo == cutBase.MBL_NO);
|
|
|
|
var slotModel = new BookingSlotOpenEditReq {
|
|
|
|
|
|
|
|
Id = slotOrder.Id,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder doBuilder = new StringBuilder();
|
|
|
|
StringBuilder doBuilder = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
|
@ -381,55 +370,73 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
if (cutDetail.VGM_CUT.HasValue)
|
|
|
|
if (cutDetail.VGM_CUT.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
doBuilder.Append($"VGM CUT 原:{slotOrder.VGMSubmissionCutDate} 新:{cutDetail.VGM_CUT.Value}");
|
|
|
|
doBuilder.Append($"VGM CUT 原:{slotOrder.VGMSubmissionCutDate} 新:{cutDetail.VGM_CUT.Value}");
|
|
|
|
slotOrder.VGMSubmissionCutDate = cutDetail.VGM_CUT.Value;
|
|
|
|
slotModel.VGMSubmissionCutDate = cutDetail.VGM_CUT.Value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (cutDetail.CY_CUTOFF.HasValue)
|
|
|
|
if (cutDetail.CY_CUTOFF.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
doBuilder.Append($"CY CUT 原:{slotOrder.CYCutDate} 新:{cutDetail.CY_CUTOFF.Value}");
|
|
|
|
doBuilder.Append($"CY CUT 原:{slotOrder.CYCutDate} 新:{cutDetail.CY_CUTOFF.Value}");
|
|
|
|
|
|
|
|
|
|
|
|
slotOrder.CYCutDate = cutDetail.CY_CUTOFF.Value;
|
|
|
|
slotModel.CYCutDate = cutDetail.CY_CUTOFF.Value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (cutDetail.SI_CUTOFF.HasValue)
|
|
|
|
if (cutDetail.SI_CUTOFF.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
doBuilder.Append($"SI CUT 原:{slotOrder.SICutDate} 新:{cutDetail.SI_CUTOFF.Value}");
|
|
|
|
doBuilder.Append($"SI CUT 原:{slotOrder.SICutDate} 新:{cutDetail.SI_CUTOFF.Value}");
|
|
|
|
|
|
|
|
|
|
|
|
slotOrder.SICutDate = cutDetail.SI_CUTOFF.Value;
|
|
|
|
slotModel.SICutDate = cutDetail.SI_CUTOFF.Value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (cutDetail.MANIFEST_CUT.HasValue)
|
|
|
|
if (cutDetail.MANIFEST_CUT.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
doBuilder.Append($"MANIFEST CUT 原:{slotOrder.ManifestCutDate} 新:{cutDetail.MANIFEST_CUT.Value}");
|
|
|
|
doBuilder.Append($"MANIFEST CUT 原:{slotOrder.ManifestCutDate} 新:{cutDetail.MANIFEST_CUT.Value}");
|
|
|
|
|
|
|
|
|
|
|
|
slotOrder.ManifestCutDate = cutDetail.MANIFEST_CUT.Value;
|
|
|
|
slotModel.ManifestCutDate = cutDetail.MANIFEST_CUT.Value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tenantDb.Updateable<BookingSlotBase>(slotOrder).UpdateColumns(it => new
|
|
|
|
var bkRlt = await _bookingSlotService.BookingSlotOpenEdit(slotModel);
|
|
|
|
{
|
|
|
|
|
|
|
|
it.VGMSubmissionCutDate,
|
|
|
|
|
|
|
|
it.CYCutDate,
|
|
|
|
|
|
|
|
it.SICutDate,
|
|
|
|
|
|
|
|
it.ManifestCutDate
|
|
|
|
|
|
|
|
}).ExecuteCommand();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Logger.Log(NLog.LogLevel.Info, $"截止时间变更主键{taskPKId} id={cutBase.Id} mblno={slotOrder.SlotBookingNo} 更新舱位完毕 详情 {doBuilder.ToString()}");
|
|
|
|
if (bkRlt.Succeeded)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
logger.LogInformation($"taskPkId={taskPKId} 提单号{entity.MBL_NO} 更新舱位数据成功 {doBuilder.ToString()}");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Logger.Log(NLog.LogLevel.Info, $"taskPKId={taskPKId} 自动更新订单的截单日期更新舱位异常,原因:{ex.Message}");
|
|
|
|
logger.LogInformation($"taskPKId={taskPKId} 更新舱位截止时间异常,原因:{ex.Message}");
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Failed($"自动更新订单的截单日期更新舱位,原因:{ex.Message}", MultiLanguageConst.Operation_Failed);
|
|
|
|
return DataResult.Failed($"更新舱位截止时间异常,原因:{ex.Message}", MultiLanguageConst.OperationSuccess);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed(string.Empty, MultiLanguageConst.OperationSuccess);
|
|
|
|
return DataResult.Successed("更新成功", MultiLanguageConst.OperationSuccess);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 更新订单和舱位的截止时间
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 更新订单和舱位的截止时间
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="dataContext">数据上下文</param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
public async Task<DataResult> ModifyBookingOrderOrSlotTask(TaskFlowDataContext dataContext)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var taskPKId = dataContext.Get<long>(TaskFlowDataNameConst.TaskPKId);
|
|
|
|
|
|
|
|
if (taskPKId == 0)
|
|
|
|
|
|
|
|
throw new ArgumentException($"缺少参数:{nameof(TaskFlowDataNameConst.TaskPKId)}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新订舱
|
|
|
|
|
|
|
|
await UpdateBookingOrderCutDate(taskPKId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新舱位
|
|
|
|
|
|
|
|
await UpdateBookingSlotCutDate(taskPKId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("更细成功");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 发送邮件通知给客户
|
|
|
|
#region 发送邮件通知给客户
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 发送邮件通知给客户
|
|
|
|
/// 发送邮件通知给客户
|
|
|
|