|
|
@ -256,17 +256,14 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
await dbScope.Ado.BeginTranAsync();
|
|
|
|
await dbScope.Ado.BeginTranAsync();
|
|
|
|
foreach (var item in list)
|
|
|
|
foreach (var item in list)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!string.IsNullOrWhiteSpace(item.MBLNO))
|
|
|
|
|
|
|
|
|
|
|
|
if (item.Id == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var et = await tenantDb.Queryable<SeaExportShippingBill>().Where(x => x.MBLNO == item.MBLNO && x.HBLNO == item.HBLNO && x.Id != item.Id).FirstAsync();
|
|
|
|
|
|
|
|
if (et != null)
|
|
|
|
if (!string.IsNullOrEmpty(item.MBLNO) && tenantDb.Queryable<SeaExportShippingBill>().Where(x => x.MBLNO == item.MBLNO && x.HBLNO == item.HBLNO).Any())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await Task.FromResult(DataResult.Failed("当前提单号已存在,请勿重复录入!"));
|
|
|
|
return await Task.FromResult(DataResult.Failed("当前提单号已存在,请勿重复录入!"));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (item.Id == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var data = item.Adapt<SeaExportShippingBill>();
|
|
|
|
var data = item.Adapt<SeaExportShippingBill>();
|
|
|
|
data.State = "已录入";
|
|
|
|
data.State = "已录入";
|
|
|
|
|
|
|
|
|
|
|
@ -295,6 +292,10 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(item.MBLNO) && tenantDb.Queryable<SeaExportShippingBill>().Where(x => x.Id != item.Id && x.MBLNO == item.MBLNO && x.HBLNO == item.HBLNO).Any())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return await Task.FromResult(DataResult.Failed("当前提单号已存在,请勿重复录入!"));
|
|
|
|
|
|
|
|
}
|
|
|
|
var info = await tenantDb.Queryable<SeaExportShippingBill>().Where(x => x.Id == item.Id).FirstAsync();
|
|
|
|
var info = await tenantDb.Queryable<SeaExportShippingBill>().Where(x => x.Id == item.Id).FirstAsync();
|
|
|
|
|
|
|
|
|
|
|
|
if (info.State != "已录入")
|
|
|
|
if (info.State != "已录入")
|
|
|
|