optimize
wet 2 years ago
parent eb4678cae8
commit 5b328cf8ed

@ -109,7 +109,10 @@ namespace Myshipping.Application
entity.State = "已录入"; entity.State = "已录入";
if (input.Id == 0) if (input.Id == 0)
{ {
if (!string.IsNullOrEmpty(entity.CARRIERID)) {
entity.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == entity.CARRIERID).Select(x => x.EdiCode).FirstOrDefault(); entity.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == entity.CARRIERID).Select(x => x.EdiCode).FirstOrDefault();
}
await _seaeedi.InsertAsync(entity); await _seaeedi.InsertAsync(entity);
if (input.EdiCtn != null) if (input.EdiCtn != null)
{ {
@ -128,8 +131,11 @@ namespace Myshipping.Application
} }
else else
{
if (!string.IsNullOrEmpty(entity.CARRIERID))
{ {
entity.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == entity.CARRIERID).Select(x => x.EdiCode).FirstOrDefault(); entity.CARRIER = _cache.GetAllCodeCarrier().Result.Where(x => x.Code == entity.CARRIERID).Select(x => x.EdiCode).FirstOrDefault();
}
await _seaeedi.AsUpdateable(entity).IgnoreColumns(it => new await _seaeedi.AsUpdateable(entity).IgnoreColumns(it => new
{ {
it.MBLNO, it.MBLNO,

Loading…
Cancel
Save