马士基API订舱

master
jianghaiqing 8 months ago
parent 637276fea9
commit bbc49d5389

@ -440,6 +440,8 @@ namespace Myshipping.Application.Service.BookingOrder
var id = InnerSave(model, isSendApi: true).GetAwaiter().GetResult(); var id = InnerSave(model, isSendApi: true).GetAwaiter().GetResult();
result.id = id;
MSKAPIBookingResultDto resultInfo = null; MSKAPIBookingResultDto resultInfo = null;
_logger.LogInformation($"开始请求MSK API订舱JSON={JSON.Serialize(bookingDto)}"); _logger.LogInformation($"开始请求MSK API订舱JSON={JSON.Serialize(bookingDto)}");
@ -504,12 +506,17 @@ namespace Myshipping.Application.Service.BookingOrder
throw Oops.Bah(resultInfo.msg); throw Oops.Bah(resultInfo.msg);
} }
result.succ = true;
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError($"MSK API订舱异常req={JSON.Serialize(model)} 原因:{ex.Message}"); _logger.LogError($"MSK API订舱异常req={JSON.Serialize(model)} 原因:{ex.Message}");
throw Oops.Bah($"MSK API订舱失败{ex.Message}"); //throw Oops.Bah($"MSK API订舱失败{ex.Message}");
result.succ = false;
result.msg = $"MSK API订舱失败{ex.Message}";
} }
return result; return result;

@ -11,5 +11,24 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public class MSKBookingResultDto public class MSKBookingResultDto
{ {
/// <summary>
/// 是否成功 true=成功 false=失败
/// </summary>
public bool succ { get; set; } = false;
/// <summary>
/// 状态 0-成功
/// </summary>
public int status { get; set; } = 0;
/// <summary>
/// 返回消息
/// </summary>
public string msg { get; set; }
/// <summary>
/// 马士基API订舱主键
/// </summary>
public Nullable<long> id { get; set; }
} }
} }

Loading…
Cancel
Save