diff --git a/Myshipping.Application/Service/DataSync/DataSyncService.cs b/Myshipping.Application/Service/DataSync/DataSyncService.cs index aa14755e..19abc15d 100644 --- a/Myshipping.Application/Service/DataSync/DataSyncService.cs +++ b/Myshipping.Application/Service/DataSync/DataSyncService.cs @@ -959,6 +959,7 @@ namespace Myshipping.Application [HttpPost("/DataSync/SyncBookingList"), ApiUser(ApiCode = "SyncBookingList")] public async void SyncBookingList(List list) { + List ctncode = await _cache.GetAllCodeCtn(); foreach (var model in list) { if (string.IsNullOrWhiteSpace(model.BSNO)) @@ -1044,6 +1045,7 @@ namespace Myshipping.Application ctnentity.BILLID = entity.Id; ctnentity.CreatedUserId = user.Result.Id; ctnentity.CreatedUserName = user.Result.Name; + ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).First(); await _repCtn.InsertAsync(ctnentity); //这里保存有可能没有添加多品名,所有箱下没有货物信息 @@ -1162,6 +1164,7 @@ namespace Myshipping.Application ctnentity.BILLID = fdentity.Id; ctnentity.CreatedUserId = user.Result.Id; ctnentity.CreatedUserName = user.Result.Name; + ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).First(); await _repCtn.InsertAsync(ctnentity); //这里保存有可能没有添加多品名,所有箱下没有货物信息 @@ -1292,6 +1295,7 @@ namespace Myshipping.Application ctnentity.BILLID = main.Id; ctnentity.CreatedUserId = user.Result.Id; ctnentity.CreatedUserName = user.Result.Name; + ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).First(); await _repCtn.InsertAsync(ctnentity); if (item.ctnDetailInputs != null) { @@ -1472,6 +1476,7 @@ namespace Myshipping.Application ctnentity.BILLID = fdmain.Id; ctnentity.CreatedUserId = user.Result.Id; ctnentity.CreatedUserName = user.Result.Name; + ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).First(); await _repCtn.InsertAsync(ctnentity); if (it.ctnDetailInputs != null) {