订舱编号重复问题

master
zhangxiaofeng 6 months ago
parent 0c8a0fcd13
commit e019040265

@ -1056,7 +1056,7 @@ namespace Myshipping.Application.Entity
/// <summary>
/// 是否为舱位拆票后生成的订舱
/// </summary>
public bool IsSplit { get; set; }
public bool? IsSplit { get; set; }
/// <summary>
/// 分单操作ID

@ -1545,7 +1545,14 @@ namespace Myshipping.Application
//陈冠宇提订舱编号不允许重复
if (!string.IsNullOrWhiteSpace(input.CUSTNO))
{
var et = await _rep.AsQueryable().Filter(null, true).AnyAsync(x => x.IsDeleted == false && x.IsSplit == false && x.CUSTNO == input.CUSTNO && x.TenantId == UserManager.TENANT_ID && x.ParentId == 0 && x.Id != input.Id);
var et = await _rep.AsQueryable()
.Filter(null, true)
.AnyAsync(x => x.IsDeleted == false
&& (x.IsSplit == false || x.IsSplit == null) // 自用订舱模式下,因存在舱位拆票产生多票订舱的情况,所以拆票的舱位是能够重复的
&& x.CUSTNO == input.CUSTNO
&& x.TenantId == UserManager.TENANT_ID
&& x.ParentId == 0
&& x.Id != input.Id);
if (et)
{
throw Oops.Bah("当前订舱编号已存在,请勿重复录入!");
@ -10743,7 +10750,7 @@ namespace Myshipping.Application
extModel.TxxpEndTime = date;
await _repextendstate.InsertAsync(extModel);
}
await SendBookingOrder(new long[] { bookId });
await SendBookingOrder(new long[] { bookId });
}
#endregion

Loading…
Cancel
Save