修改任务台

master
jianghaiqing 8 months ago
parent bbc49d5389
commit f0909100fc

@ -180,5 +180,16 @@ namespace Myshipping.Application
/// </summary> /// </summary>
[Description("VGM未提交")] [Description("VGM未提交")]
VGM_MISSING, VGM_MISSING,
/// <summary>
/// 目的港未提货
/// </summary>
[Description("目的港未提货")]
POD_DISCHARGE_FULL,
/// <summary>
/// 目的港未返空箱
/// </summary>
[Description("目的港未返空箱")]
POD_GATEOUT_FULL,
} }
} }

@ -1297,5 +1297,72 @@ namespace Myshipping.Application.Service.BookingOrder
return string.Empty; return string.Empty;
} }
#endregion #endregion
#region 同步BC状态BC,Cancellation
/// <summary>
/// 同步BC状态BC,Cancellation
/// </summary>
/// <param name="mblno">提单号</param>
/// <param name="tenantId">租户ID</param>
/// <param name="opTypeName">操作类型 BC-同步BC状态 Cancellation-同步取消状态</param>
/// <returns>返回回执</returns>
public async Task<MSKBookingResultDto> SyncBCInfo(string mblno, long tenantId, string opTypeName = "BookingConfirmation")
{
MSKBookingResultDto result = new MSKBookingResultDto();
try
{
var model = await _bookingDeliveryRecordRep.AsQueryable().Filter(null, true)
.FirstAsync(a => a.BOOKING_REFERENCE == mblno && a.IsDeleted == false && a.TenantId == tenantId);
if(model == null)
throw Oops.Oh("订舱数据不存在或已作废");
if(opTypeName == "BookingConfirmation")
{
model.IS_RECV_BC = true;
model.LST_RECV_BC_DATE = DateTime.Now;
model.UpdatedTime = model.LST_RECV_BC_DATE;
model.UpdatedUserId = UserManager.UserId;
model.UpdatedUserName = UserManager.Name;
await _bookingDeliveryRecordRep.AsUpdateable(model).UpdateColumns(x => new {
x.IS_RECV_BC,
x.LST_RECV_BC_DATE,
x.UpdatedTime,
x.UpdatedUserId,
x.UpdatedUserName
}).ExecuteCommandAsync();
}
else if (opTypeName == "Cancellation")
{
model.IS_RECV_BK_CANCEL = true;
model.LST_RECV_BK_CANCEL_DATE = DateTime.Now;
model.UpdatedTime = model.LST_RECV_BC_DATE;
model.UpdatedUserId = UserManager.UserId;
model.UpdatedUserName = UserManager.Name;
await _bookingDeliveryRecordRep.AsUpdateable(model).UpdateColumns(x => new {
x.IS_RECV_BK_CANCEL,
x.LST_RECV_BK_CANCEL_DATE,
x.UpdatedTime,
x.UpdatedUserId,
x.UpdatedUserName
}).ExecuteCommandAsync();
}
result.succ = true;
}
catch(Exception ex)
{
result.succ = false;
result.msg = $"同步BC状态异常原因{ex.Message}";
}
return result;
}
#endregion
} }
} }

@ -80,5 +80,14 @@ namespace Myshipping.Application
/// <param name="copyNum">需要复制生成记录</param> /// <param name="copyNum">需要复制生成记录</param>
/// <returns>返回执行结果消息</returns> /// <returns>返回执行结果消息</returns>
Task<string> BatchCopy(long id,int copyNum); Task<string> BatchCopy(long id,int copyNum);
/// <summary>
/// 同步BC状态BC,Cancellation
/// </summary>
/// <param name="mblno">提单号</param>
/// <param name="tenantId">租户ID</param>
/// <param name="opTypeName">操作类型 BC-同步BC状态 Cancellation-同步取消状态</param>
/// <returns>返回回执</returns>
Task<MSKBookingResultDto> SyncBCInfo(string mblno, long tenantId, string opTypeName = "BookingConfirmation");
} }
} }

@ -18,6 +18,7 @@ using Microsoft.Extensions.Logging;
using Myshipping.Application.EDI; using Myshipping.Application.EDI;
using Myshipping.Application.Entity; using Myshipping.Application.Entity;
using Myshipping.Application.Helper; using Myshipping.Application.Helper;
using Myshipping.Application.Service.BookingOrder;
using Myshipping.Application.Service.BookingSlot.Dto; using Myshipping.Application.Service.BookingSlot.Dto;
using Myshipping.Core; using Myshipping.Core;
using Myshipping.Core.Const; using Myshipping.Core.Const;
@ -122,6 +123,8 @@ namespace Myshipping.Application
private readonly INamedServiceProvider<IBookingOrderService> _namedBookingOrderServiceProvider; private readonly INamedServiceProvider<IBookingOrderService> _namedBookingOrderServiceProvider;
private readonly INamedServiceProvider<ITaskManageRollingNominationService> _namedRollingNominationServiceProvider; private readonly INamedServiceProvider<ITaskManageRollingNominationService> _namedRollingNominationServiceProvider;
private readonly INamedServiceProvider<ITaskManageBCService> _namedTaskManageBCServiceProvider; private readonly INamedServiceProvider<ITaskManageBCService> _namedTaskManageBCServiceProvider;
private readonly INamedServiceProvider<IBookingMSKAPIService> _namedBookingMSKAPIServiceProvider;
private readonly IBookingValueAddedService _bookingValueAddedService; private readonly IBookingValueAddedService _bookingValueAddedService;
const string CONST_WEB_ACCOUNT_TYPE = "CmaWeb"; const string CONST_WEB_ACCOUNT_TYPE = "CmaWeb";
@ -178,6 +181,7 @@ namespace Myshipping.Application
INamedServiceProvider<ITaskManageRollingNominationService> namedRollingNominationServiceProvider, INamedServiceProvider<ITaskManageRollingNominationService> namedRollingNominationServiceProvider,
INamedServiceProvider<ITaskManageBCService> namedTaskManageBCServiceProvider, INamedServiceProvider<ITaskManageBCService> namedTaskManageBCServiceProvider,
IBookingValueAddedService bookingValueAddedService, IBookingValueAddedService bookingValueAddedService,
INamedServiceProvider<IBookingMSKAPIService> namedBookingMSKAPIServiceProvider,
ILogger<BookingOrderService> logger) ILogger<BookingOrderService> logger)
{ {
_taskBaseInfoRepository = taskBaseInfoRepository; _taskBaseInfoRepository = taskBaseInfoRepository;
@ -229,6 +233,8 @@ namespace Myshipping.Application
_taskDraftInfoRepository = taskDraftInfoRepository; _taskDraftInfoRepository = taskDraftInfoRepository;
_taskPODDischargeGateoutFullInfoRepository = taskPODDischargeGateoutFullInfoRepository; _taskPODDischargeGateoutFullInfoRepository = taskPODDischargeGateoutFullInfoRepository;
_taskPODDischargeGateoutFullDetailInfoRepository = taskPODDischargeGateoutFullDetailInfoRepository; _taskPODDischargeGateoutFullDetailInfoRepository = taskPODDischargeGateoutFullDetailInfoRepository;
_namedBookingMSKAPIServiceProvider = namedBookingMSKAPIServiceProvider;
} }
#region 创建任务 #region 创建任务
@ -773,6 +779,25 @@ namespace Myshipping.Application
2@ 2@
*/ */
if (info.Main.TaskType == TaskBaseTypeEnum.BC)
{
var service = _namedBookingMSKAPIServiceProvider
.GetService<ITransient>(nameof(BookingMSKAPIService));
var synRlt = await service.SyncBCInfo(info.Main.BCInfo.MBLNo, taskInfo.TenantId.Value);
_logger.LogInformation($"入库完BC自动推送状态到API订舱列表 mblno={info.Main.BCInfo.MBLNo} synRlt={JSON.Serialize(synRlt)}");
}
else if (info.Main.TaskType == TaskBaseTypeEnum.CANCELLATION)
{
var service = _namedBookingMSKAPIServiceProvider
.GetService<ITransient>(nameof(BookingMSKAPIService));
var synRlt = await service.SyncBCInfo(info.Main.BCInfo.MBLNo, taskInfo.TenantId.Value,"Cancellation");
_logger.LogInformation($"入库完BC自动推送状态到API订舱列表 mblno={info.Main.BCInfo.MBLNo} synRlt={JSON.Serialize(synRlt)}");
}
if (info.Main.TaskType == TaskBaseTypeEnum.BC_MODIFY) if (info.Main.TaskType == TaskBaseTypeEnum.BC_MODIFY)
{ {
var name = _namedTaskManageBCServiceProvider var name = _namedTaskManageBCServiceProvider

Loading…
Cancel
Save