optimize
wet 1 year ago
parent 74b98408dd
commit 47f4689044

@ -986,6 +986,15 @@ namespace Myshipping.Application
throw Oops.Bah("当前订舱编号已存在,请勿重复录入!");
}
}
//孙晓飞提PONO不允许重复
if (!string.IsNullOrWhiteSpace(input.PONO))
{
var et = await _rep.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.PONO == input.PONO && x.TenantId == UserManager.TENANT_ID && x.HBLNO == input.HBLNO && x.ParentId == input.ParentId && x.Id != input.Id).FirstAsync();
if (et != null)
{
throw Oops.Bah("当前PONO已存在,请勿重复录入!");
}
}
var entity = input.Adapt<BookingOrder>();
if (!string.IsNullOrEmpty(input.VESSEL) && !string.IsNullOrEmpty(input.VOYNO))
{

@ -495,14 +495,14 @@ namespace Myshipping.Application
{
it.ETD = item.ETD;
//if (it.ATD != item.ATD && item.ATD != null)
//{
// it.ATD = item.ATD;
//}
//if (it.YgtETD != item.YgtETD && item.YgtETD != null)
//{
// it.YgtETD = item.YgtETD;
//}
if (it.ATD != item.ATD && item.ATD != null)
{
it.ATD = item.ATD;
}
if (it.YgtETD != item.YgtETD && item.YgtETD != null)
{
it.YgtETD = item.YgtETD;
}
await _rep.AsUpdateable(it).IgnoreColumns(it => new
{
it.ParentId,
@ -546,26 +546,26 @@ namespace Myshipping.Application
NewValue = item.ETD != null ? item.ETD.ToSqlValue() : null,
});
}
//if (it.ATD != item.ATD)
//{
// await _bookinglogdetail.InsertReturnSnowflakeIdAsync(new BookingLogDetail
// {
// PId = bid,
// Field = "ATD",
// OldValue = it.ATD != null ? it.ATD.ToSqlValue() : null,
// NewValue = item.ATD != null ? item.ATD.ToSqlValue() : null,
// });
//}
//if (it.YgtETD != item.YgtETD)
//{
// await _bookinglogdetail.InsertReturnSnowflakeIdAsync(new BookingLogDetail
// {
// PId = bid,
// Field = "ETD",
// OldValue = it.YgtETD != null ? it.YgtETD.ToSqlValue() : null,
// NewValue = item.YgtETD != null ? item.YgtETD.ToSqlValue() : null,
// });
//}
if (it.ATD != item.ATD)
{
await _bookinglogdetail.InsertReturnSnowflakeIdAsync(new BookingLogDetail
{
PId = bid,
Field = "ATD",
OldValue = it.ATD != null ? it.ATD.ToSqlValue() : null,
NewValue = item.ATD != null ? item.ATD.ToSqlValue() : null,
});
}
if (it.YgtETD != item.YgtETD)
{
await _bookinglogdetail.InsertReturnSnowflakeIdAsync(new BookingLogDetail
{
PId = bid,
Field = "ETD",
OldValue = it.YgtETD != null ? it.YgtETD.ToSqlValue() : null,
NewValue = item.YgtETD != null ? item.YgtETD.ToSqlValue() : null,
});
}
}
}

Loading…
Cancel
Save