|
|
|
@ -133,12 +133,18 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("BSNO未录入");
|
|
|
|
|
}
|
|
|
|
|
var userlist = _repUser.AsQueryable().Filter(null, true).ToListAsync();
|
|
|
|
|
var m = await _vesselinfo.AsQueryable().Filter(null, true).Where(x => x.BSNO == model.BSNO).FirstAsync();
|
|
|
|
|
var entity = model.Adapt<DjyVesselInfo>();
|
|
|
|
|
entity.Vessel = model.Vessel.ToUpper().Trim();
|
|
|
|
|
if (!string.IsNullOrEmpty( entity.CARRIER)) {
|
|
|
|
|
if (!string.IsNullOrEmpty( model.CARRIERID)) {
|
|
|
|
|
|
|
|
|
|
entity.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == entity.CARRIERID).Select(x => x.CnName).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(model.CreatedUserName))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
entity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
|
|
|
|
|
entity.CreatedUserId = userlist.Result.Where(x => x.Name == model.CreatedUserName).Select(x => x.Id).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
if (m == null)
|
|
|
|
|
{
|
|
|
|
@ -1014,10 +1020,9 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
entity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == entity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(entity.CARRIER))
|
|
|
|
|
if (!string.IsNullOrEmpty(entity.CARRIERID))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
entity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
|
|
|
|
|
entity.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == entity.CARRIERID).Select(x => x.CnName).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
entity.BOOKINGNO = Yitter.IdGenerator.YitIdHelper.NextId().ToString();
|
|
|
|
|
entity.CreatedUserId = user.Result.Id;
|
|
|
|
@ -1143,10 +1148,10 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
fdentity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == fdentity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(entity.CARRIER))
|
|
|
|
|
if (!string.IsNullOrEmpty(fdentity.CARRIERID))
|
|
|
|
|
{
|
|
|
|
|
fdentity.CARRIER = entity.CARRIER;
|
|
|
|
|
fdentity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
|
|
|
|
|
fdentity.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == fdentity.CARRIERID).Select(x => x.CnName).FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
fdentity.BOOKINGNO = Yitter.IdGenerator.YitIdHelper.NextId().ToString();
|
|
|
|
|
fdentity.MBLNO = entity.MBLNO;
|
|
|
|
@ -1284,10 +1289,9 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
entity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == entity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(entity.CARRIER))
|
|
|
|
|
if (!string.IsNullOrEmpty(entity.CARRIERID))
|
|
|
|
|
{
|
|
|
|
|
entity.CARRIER = entity.CARRIER;
|
|
|
|
|
entity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
|
|
|
|
|
entity.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == entity.CARRIERID).Select(x => x.CnName).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
await _rep.AsUpdateable(entity).IgnoreColumns(it => new
|
|
|
|
|
{
|
|
|
|
@ -1480,10 +1484,9 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
fdentity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == fdentity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(entity.CARRIER))
|
|
|
|
|
if (!string.IsNullOrEmpty(fdentity.CARRIERID))
|
|
|
|
|
{
|
|
|
|
|
fdentity.CARRIER = entity.CARRIER;
|
|
|
|
|
fdentity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
|
|
|
|
|
fdentity.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == fdentity.CARRIERID).Select(x => x.CnName).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
await _rep.AsUpdateable(fdentity).IgnoreColumns(it => new
|
|
|
|
|
{
|
|
|
|
|