optimize
wet 2 years ago
parent 656a0bfd25
commit 9edee588fb

@ -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
{

@ -90,6 +90,19 @@ namespace Myshipping.Application.Entity
/// 东胜id
/// </summary>
public string BSNO { get; set; }
/// <summary>
/// 创建人名称
/// </summary>
public string CreatedUserName { get; set; }
/// <summary>
/// 创建者Id
/// </summary>
//[SugarColumn(ColumnDescription = "创建者Id")]
public long? CreatedUserId { get; set; }
}
@ -172,5 +185,12 @@ namespace Myshipping.Application.Entity
/// </summary>
public string VoynoInside { get; set; }
/// <summary>
/// 创建人名称
/// </summary>
public string CreatedUserName { get; set; }
}
}

@ -12788,7 +12788,7 @@
</member>
<member name="P:Myshipping.Core.Service.OpLogInput.Name">
<summary>
名称
操作人名称
</summary>
</member>
<member name="P:Myshipping.Core.Service.OpLogInput.Success">
@ -12863,7 +12863,7 @@
</member>
<member name="P:Myshipping.Core.Service.OpLogInput.Account">
<summary>
操作人
操作人账号
</summary>
</member>
<member name="T:Myshipping.Core.Service.OpLogOutput">

Loading…
Cancel
Save