optimize
wet 2 years ago
parent 656a0bfd25
commit 9edee588fb

@ -133,12 +133,18 @@ namespace Myshipping.Application
{ {
throw Oops.Bah("BSNO未录入"); 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 m = await _vesselinfo.AsQueryable().Filter(null, true).Where(x => x.BSNO == model.BSNO).FirstAsync();
var entity = model.Adapt<DjyVesselInfo>(); var entity = model.Adapt<DjyVesselInfo>();
entity.Vessel = model.Vessel.ToUpper().Trim(); 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) 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(); 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 = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == entity.CARRIERID).Select(x => x.CnName).FirstOrDefault();
entity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
} }
entity.BOOKINGNO = Yitter.IdGenerator.YitIdHelper.NextId().ToString(); entity.BOOKINGNO = Yitter.IdGenerator.YitIdHelper.NextId().ToString();
entity.CreatedUserId = user.Result.Id; 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(); 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.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == fdentity.CARRIERID).Select(x => x.CnName).FirstOrDefault();
fdentity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
} }
fdentity.BOOKINGNO = Yitter.IdGenerator.YitIdHelper.NextId().ToString(); fdentity.BOOKINGNO = Yitter.IdGenerator.YitIdHelper.NextId().ToString();
fdentity.MBLNO = entity.MBLNO; 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(); 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.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == entity.CARRIERID).Select(x => x.CnName).FirstOrDefault();
entity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
} }
await _rep.AsUpdateable(entity).IgnoreColumns(it => new 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(); 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.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == fdentity.CARRIERID).Select(x => x.CnName).FirstOrDefault();
fdentity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
} }
await _rep.AsUpdateable(fdentity).IgnoreColumns(it => new await _rep.AsUpdateable(fdentity).IgnoreColumns(it => new
{ {

@ -90,6 +90,19 @@ namespace Myshipping.Application.Entity
/// 东胜id /// 东胜id
/// </summary> /// </summary>
public string BSNO { get; set; } 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> /// </summary>
public string VoynoInside { get; set; } public string VoynoInside { get; set; }
/// <summary>
/// 创建人名称
/// </summary>
public string CreatedUserName { get; set; }
} }
} }

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

Loading…
Cancel
Save