订舱编号重复问题

master
zhangxiaofeng 6 months ago
parent 0c8a0fcd13
commit e019040265

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

@ -1545,7 +1545,14 @@ namespace Myshipping.Application
//陈冠宇提订舱编号不允许重复 //陈冠宇提订舱编号不允许重复
if (!string.IsNullOrWhiteSpace(input.CUSTNO)) 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) if (et)
{ {
throw Oops.Bah("当前订舱编号已存在,请勿重复录入!"); throw Oops.Bah("当前订舱编号已存在,请勿重复录入!");
@ -10743,7 +10750,7 @@ namespace Myshipping.Application
extModel.TxxpEndTime = date; extModel.TxxpEndTime = date;
await _repextendstate.InsertAsync(extModel); await _repextendstate.InsertAsync(extModel);
} }
await SendBookingOrder(new long[] { bookId }); await SendBookingOrder(new long[] { bookId });
} }
#endregion #endregion

Loading…
Cancel
Save