From 1b35bdee40dcc90aa7da9ad9fea74b947db01405 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Wed, 22 Mar 2023 15:21:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=B1=E5=9E=8Bcode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Application/Service/DataSync/DataSyncService.cs | 5 +++++ 1 file changed, 5 insertions(+) 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) {