功能调整:运踪接收接口,接收的运踪信息主键从long改为string

optimize
zhangxiaofeng 1 year ago
parent 2f30078c73
commit 4c6d3fd531

@ -12,9 +12,15 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
public long Id { get; set; } public long Id { get; set; }
/// <summary> /// <summary>
/// 业务id /// 订舱记录主键
/// </summary> /// </summary>
public long BookingId { get; set; } public long BookingId { get; set; }
/// <summary>
/// 业务id
/// </summary>
public string BusinessId { get; set; }
/// <summary> /// <summary>
/// 状态 /// 状态
/// </summary> /// </summary>
@ -38,13 +44,13 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
public List<BookingStatusLogDetailDto> detail { get; set; } public List<BookingStatusLogDetailDto> detail { get; set; }
} }
public class BookingStatusLogDetailDto public class BookingStatusLogDetailDto
{ {
/// <summary> /// <summary>
/// 主单id /// 主单id
/// </summary> /// </summary>
public long? PId { get; set; } public long? PId { get; set; }
/// <summary> /// <summary>
/// 状态 /// 状态
@ -54,7 +60,7 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
/// 箱号 /// 箱号
/// </summary> /// </summary>
public string CNTRNO { get; set; } public string CNTRNO { get; set; }
/// <summary> /// <summary>
/// 状态时间 /// 状态时间
/// </summary> /// </summary>
@ -63,7 +69,8 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
public class CNTRNODto { public class CNTRNODto
{
/// <summary> /// <summary>
@ -76,7 +83,7 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
/// </summary> /// </summary>
public string CNTRNO { get; set; } public string CNTRNO { get; set; }
/// <summary> /// <summary>
/// 提箱时间 /// 提箱时间
@ -89,7 +96,7 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
public DateTime? FCOPTime { get; set; } public DateTime? FCOPTime { get; set; }
} }

@ -2096,6 +2096,20 @@ namespace Myshipping.Application
{ {
try try
{ {
// 当BusinessId不为空时将BusinessId的值转为订舱主键否则仍然使用BookingId作为订舱记录主键
if (!string.IsNullOrEmpty(all[0].BusinessId))
{
if (long.TryParse(all[0].BusinessId, out long businessId))
{
all[0].BookingId = businessId;
}
else
{
_logger.LogError($"在将BusinessId转为BookingId时发生异常货运动态插入失败BusinessId的值为{all[0].BusinessId}");
return;
}
}
var old = await _repStatuslog.AsQueryable().Filter(null, true).Where(x => x.BookingId == all[0].BookingId && x.Category == "yunzong" && x.IsDeleted == false).ToListAsync(); var old = await _repStatuslog.AsQueryable().Filter(null, true).Where(x => x.BookingId == all[0].BookingId && x.Category == "yunzong" && x.IsDeleted == false).ToListAsync();
await _repStatuslog.DeleteAsync(x => x.BookingId == all[0].BookingId && x.Category == "yunzong"); await _repStatuslog.DeleteAsync(x => x.BookingId == all[0].BookingId && x.Category == "yunzong");
foreach (var ot in old) foreach (var ot in old)
@ -2115,6 +2129,20 @@ namespace Myshipping.Application
bool flag = false; bool flag = false;
foreach (var item in all) foreach (var item in all)
{ {
// 当BusinessId不为空时将BusinessId的值转为订舱主键否则仍然使用BookingId作为订舱记录主键
if (!string.IsNullOrEmpty(item.BusinessId))
{
if (long.TryParse(item.BusinessId, out long itemBusinessId))
{
item.BookingId = itemBusinessId;
}
else
{
_logger.LogError($"在将item.BusinessId转为BookingId时发生异常货运动态插入失败item.BusinessId的值为{item.BusinessId}");
continue;
}
}
#region 日志 #region 日志
//新增数据 //新增数据
var bookingStatusLog = new BookingStatusLog(); var bookingStatusLog = new BookingStatusLog();

Loading…
Cancel
Save