BC相关字段客户订舱同步调整

master
zhangxiaofeng 8 months ago
parent fed891df42
commit 9c65a4eeb4

@ -44,7 +44,12 @@ namespace Myshipping.Application.Event
public async Task SendToCustomer(EventHandlerExecutingContext context)
{
_logger.LogInformation($"收到订舱同步客户订舱系统请求:{context.Source.Payload}");
var bookId = (long)context.Source.Payload;
var paraObj = context.Source.Payload as dynamic;
var bookId = (long)paraObj.Id;
var syncType = (string)paraObj.SyncType;
using var scope = _services.CreateScope();
var repoCutomerOrder = scope.ServiceProvider.GetRequiredService<SqlSugarRepository<BookingCustomerOrder>>();
var repoOrder = scope.ServiceProvider.GetRequiredService<SqlSugarRepository<BookingOrder>>();
@ -136,6 +141,7 @@ namespace Myshipping.Application.Event
var feedbackObj = new BookingFeedbackDto(BookingFeedbackType.BookingAll.ToString());
feedbackObj.JsonContent = sendObj.ToJsonString();
feedbackObj.SyncType = syncType;
//回推回执
_logger.LogInformation($"准备发送客户订舱数据同步:{feedbackObj.ToJsonString()}URL{custOrder.FeedbackUrl}");

@ -12,11 +12,17 @@ namespace Myshipping.Application.Helper
/// 推送订舱数据到客户订舱系统
/// </summary>
/// <param name="id"></param>
public async static void SendCustomerBookingSync(long id)
/// <param name="syncType"></param>
public async static void SendCustomerBookingSync(long id, string syncType = null)
{
Log.Information($"发送推送订舱数据到客户订舱系统事件:{id}");
var evtPub = App.GetService<IEventPublisher>();
await evtPub.PublishAsync(new ChannelEventSource("SendToCustomer:Book", id));
var param = new
{
Id = id,
SyncType = syncType
};
await evtPub.PublishAsync(new ChannelEventSource("SendToCustomer:Book", param));
}
/// <summary>

@ -56,6 +56,7 @@ namespace Myshipping.Application
private readonly IEventPublisher _publisher;
private readonly SqlSugarRepository<DjyApiAuth> _repApiAuth;
private readonly SqlSugarRepository<DjyMessage> _repMessage;
private readonly IBookingOrderService bookingOrderService;
public BookingCustomerOrderService(SqlSugarRepository<BookingCustomerOrder> rep, SqlSugarRepository<BookingCtn> repCtn,
ILogger<BookingOrderService> logger, ISysCacheService cache, SqlSugarRepository<BookingFile> repFile,
@ -63,7 +64,7 @@ namespace Myshipping.Application
SqlSugarRepository<BookingOrder> repOrder, SqlSugarRepository<BookingStatusLogDetail> repStatuslogDetail,
SqlSugarRepository<BookingCustomerOrderTemplate> repOrderTempl,
SqlSugarRepository<BookingEDIExt> repEdiExt, SqlSugarRepository<BookingGoodsStatus> goodsStatus, SqlSugarRepository<BookingGoodsStatusConfig> goodsStatusConfig,
IEventPublisher publisher, SqlSugarRepository<DjyApiAuth> repApiAuth, SqlSugarRepository<DjyMessage> repMessage)
IEventPublisher publisher, SqlSugarRepository<DjyApiAuth> repApiAuth, SqlSugarRepository<DjyMessage> repMessage, IBookingOrderService bookingOrderService)
{
this._logger = logger;
this._rep = rep;
@ -81,6 +82,7 @@ namespace Myshipping.Application
this._publisher = publisher;
this._repApiAuth = repApiAuth;
this._repMessage = repMessage;
this.bookingOrderService = bookingOrderService;
}
#region 订舱草稿及附件
@ -876,9 +878,9 @@ namespace Myshipping.Application
/// </summary>
/// <returns></returns>
[HttpPost("/BookingCustomerOrder/RecBookingFeedback"), AllowAnonymous, ApiUser(ApiCode = "RecBookingFeedback")]
public async Task<dynamic> RecBookingFeedback(string feedbackType, string jsonContent)
public async Task<dynamic> RecBookingFeedback(string feedbackType, string jsonContent, string syncType)
{
_logger.LogInformation($"收到订舱回推数据feedbackType{feedbackType}jsonContent{jsonContent}");
_logger.LogInformation($"收到订舱回推数据feedbackType{feedbackType}jsonContent{jsonContent}syncType{syncType}");
if (string.IsNullOrEmpty(feedbackType) || string.IsNullOrEmpty(jsonContent))
{
@ -1134,7 +1136,14 @@ namespace Myshipping.Application
}
}
BookingOrderSyncTypeEnum syncTypeEnum = syncType switch
{
"ALL" => BookingOrderSyncTypeEnum.ALL,
"BC" => BookingOrderSyncTypeEnum.BC,
_ => BookingOrderSyncTypeEnum.ALL,
};
await bookingOrderService.SendBookingOrder(new long[] { dbOrder.Id }, syncTypeEnum);
}
#endregion

@ -749,6 +749,11 @@ namespace Myshipping.Application
/// </summary>
public string JsonContent { get; set; }
/// <summary>
/// 订舱记录同步类型 ALL或空更新全部 BC只更新BC相关字段
/// </summary>
public string SyncType { get; set; }
}
/// <summary>

@ -2181,7 +2181,7 @@ namespace Myshipping.Application
// 客户订舱:运营端发送订舱数据给客户端
if (App.Configuration["RunType"] == CommonConst.RUN_TYPE_DJY)
{
CustomerBookingSyncHelper.SendCustomerBookingSync(Id);
CustomerBookingSyncHelper.SendCustomerBookingSync(Id, "ALL");
}
return ordOut;
@ -11719,7 +11719,7 @@ namespace Myshipping.Application
if (App.Configuration["RunType"] == CommonConst.RUN_TYPE_DJY)
{
//推送订舱数据到客户订舱系统
CustomerBookingSyncHelper.SendCustomerBookingSync(bookingId);
CustomerBookingSyncHelper.SendCustomerBookingSync(bookingId, "ALL");
}
}
/// <summary>
@ -11957,10 +11957,14 @@ namespace Myshipping.Application
{
var oldOrder = oldOrderList.FirstOrDefault(x => x.Id == item.Id);
await SaveLog(item, oldOrder, "接收BC后更新订舱");
}
var orderIdArr = list.Select(x => x.Id).ToArray();
await SendBookingOrder(orderIdArr, BookingOrderSyncTypeEnum.BC);
// 客户订舱:运营端发送订舱数据给客户端
if (App.Configuration["RunType"] == CommonConst.RUN_TYPE_DJY)
{
CustomerBookingSyncHelper.SendCustomerBookingSync(item.Id, BookingOrderSyncTypeEnum.BC.ToString());
}
}
return new ReceiveBcInfoResultDto(true, $"接收成功,共更新{changeNum}条订舱记录");
}

@ -250,6 +250,11 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
/// 第三付款地
/// </summary>
public string THIRDPAYADDR { get; set; }
/// <summary>
/// 订舱编号
/// </summary>
public string CUSTNO { get; set; }
}
/// <summary>

@ -16921,13 +16921,7 @@
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysUserService.ImportUser(Microsoft.AspNetCore.Http.IFormFile)">
<summary>
用户导入
</summary>
<param name="file"></param>
<returns></returns>
</member>
<!-- Badly formed XML comment ignored for member "M:Myshipping.Core.Service.SysUserService.ImportUser(Microsoft.AspNetCore.Http.IFormFile)" -->
<member name="M:Myshipping.Core.Service.SysUserService.GetUserById(System.Int64)">
<summary>
根据用户Id获取用户

Loading…
Cancel
Save