From e0190402659762da1391166583e9636800a3f136 Mon Sep 17 00:00:00 2001
From: zhangxiaofeng <1939543722@qq.com>
Date: Wed, 29 May 2024 12:05:02 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E8=88=B1=E7=BC=96=E5=8F=B7=E9=87=8D?=
=?UTF-8?q?=E5=A4=8D=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Myshipping.Application/Entity/BookingOrder.cs | 2 +-
.../Service/BookingOrder/BookingOrderService.cs | 11 +++++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/Myshipping.Application/Entity/BookingOrder.cs b/Myshipping.Application/Entity/BookingOrder.cs
index 4ad8c9ee..c172e6f6 100644
--- a/Myshipping.Application/Entity/BookingOrder.cs
+++ b/Myshipping.Application/Entity/BookingOrder.cs
@@ -1056,7 +1056,7 @@ namespace Myshipping.Application.Entity
///
/// 是否为舱位拆票后生成的订舱
///
- public bool IsSplit { get; set; }
+ public bool? IsSplit { get; set; }
///
/// 分单操作ID
diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
index 97c61b20..e6a9760f 100644
--- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
+++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
@@ -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