diff --git a/Myshipping.Application/Service/DataSync/DataSyncService.cs b/Myshipping.Application/Service/DataSync/DataSyncService.cs index 34a3a73f..a3553731 100644 --- a/Myshipping.Application/Service/DataSync/DataSyncService.cs +++ b/Myshipping.Application/Service/DataSync/DataSyncService.cs @@ -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(); 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 { diff --git a/Myshipping.Core/Entity/DJY/DjyVesselInfo.cs b/Myshipping.Core/Entity/DJY/DjyVesselInfo.cs index 5afef001..96318b3f 100644 --- a/Myshipping.Core/Entity/DJY/DjyVesselInfo.cs +++ b/Myshipping.Core/Entity/DJY/DjyVesselInfo.cs @@ -90,6 +90,19 @@ namespace Myshipping.Application.Entity /// 东胜id /// public string BSNO { get; set; } + + + /// + /// 创建人名称 + /// + public string CreatedUserName { get; set; } + + + /// + /// 创建者Id + /// + //[SugarColumn(ColumnDescription = "创建者Id")] + public long? CreatedUserId { get; set; } } @@ -172,5 +185,12 @@ namespace Myshipping.Application.Entity /// public string VoynoInside { get; set; } + /// + /// 创建人名称 + /// + public string CreatedUserName { get; set; } + + + } } \ No newline at end of file diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index 23a7ed79..786176b9 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -12788,7 +12788,7 @@ - 名称 + 操作人名称 @@ -12863,7 +12863,7 @@ - 操作人 + 操作人账号