From 5d8d093d428e6b29b10402dc3e4180638a4ec39c Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Thu, 14 Mar 2024 15:34:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A9=AC=E5=A3=AB=E5=9F=BAAP?= =?UTF-8?q?I=E8=AE=A2=E8=88=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingMSKAPIService.cs | 18 +++++++++-- .../Dto/BookingDeliveryRecordPageDto.cs | 30 +++++++++++++++++++ 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs index 01e3988b..5fd74e57 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs @@ -269,6 +269,11 @@ namespace Myshipping.Application.Service.BookingOrder var recordInfo = model.Adapt(); var recordCtnList = model.ctns.Adapt>(); + var ctnCodeMappingList = _cache.GetAllMappingCtn().GetAwaiter().GetResult().ToList(); + + if (ctnCodeMappingList.Count > 0) + ctnCodeMappingList = ctnCodeMappingList.Where(x => x.CarrierCode == "MSK" && x.Module == "BOOK_OR_CLOSING").ToList(); + MSKAPIBookingDto bookingDto = new MSKAPIBookingDto { userKey = App.Configuration["MSKAPIDjyUserKey"], @@ -382,13 +387,18 @@ namespace Myshipping.Application.Service.BookingOrder { model.ctns.ForEach(ctn => { + var ctnMapping = ctnCodeMappingList.FirstOrDefault(t => t.Code.Equals(ctn.ctnCode)); + + if(ctnMapping == null) + throw Oops.Oh("未配置发送订舱请求接口地址,请联系管理员"); + MSKAPIBookingEquipmentAndHaulage haulage = new MSKAPIBookingEquipmentAndHaulage { equipmentDetails = new MSKAPIBookingEquipmentAndHaulageItem(), stuffingDetails = new List() }; - haulage.equipmentDetails.ISOEquipmentCode = ctn.ctnCode; + haulage.equipmentDetails.ISOEquipmentCode = ctnMapping.MapCode; haulage.equipmentDetails.equipmentQuantity = ctn.ctnNum; haulage.stuffingDetails.Add(new MSKAPIBookingStuffingdetails @@ -446,7 +456,7 @@ namespace Myshipping.Application.Service.BookingOrder } else { - entity.STATUS = "SUCC"; + entity.STATUS = "FAILURE"; entity.NOTES = resultInfo.msg.Length > 500 ? resultInfo.msg.Substring(0, 500) : resultInfo.msg; await _bookingDeliveryRecordRep.AsUpdateable(entity).UpdateColumns(x => new @@ -935,7 +945,7 @@ namespace Myshipping.Application.Service.BookingOrder .WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PriceOwnerCompanyPartyCode), t => t.PRICE_OWNER_COMPANY_PARTYCODE.Contains(QuerySearch.PriceOwnerCompanyPartyCode)) .WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PlaceReceiptCity), t => t.PLACERECEIPT_CITY.Contains(QuerySearch.PlaceReceiptCity) || t.PLACERECEIPT_UNLOC_CODE.Contains(QuerySearch.PlaceReceiptCity)) .WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PlaceDeliveryCity), t => t.PLACEDELIVERY_CITY.Contains(QuerySearch.PlaceDeliveryCity) || t.PLACEDELIVERY_UNLOC_CODE.Contains(QuerySearch.PlaceDeliveryCity)) - .OrderBy(entityOrderCol + (QuerySearch.descSort ? " asc " : " desc ")) + .OrderBy(entityOrderCol + (QuerySearch.descSort ? " desc " : " asc ")) .ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize); @@ -1002,7 +1012,9 @@ namespace Myshipping.Application.Service.BookingOrder ctnStat = string.Join(",", model.ctns.GroupBy(a => a.ctnCode) .Select(a => $"{a.Key}*{a.ToList().Sum(b => b.ctnNum.HasValue ? b.ctnNum.Value : 0)}").ToArray()); } + + if (model.id.HasValue && model.id.Value > 0) { BookingDeliveryRecord entity = model.Adapt(); diff --git a/Myshipping.Application/Service/BookingOrder/Dto/BookingDeliveryRecordPageDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/BookingDeliveryRecordPageDto.cs index cbada386..d7eb4a19 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/BookingDeliveryRecordPageDto.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/BookingDeliveryRecordPageDto.cs @@ -384,5 +384,35 @@ namespace Myshipping.Application /// 合约号名称 /// public string priceReferenceName { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreatedTime { get; set; } + + /// + /// 修改时间 + /// + public Nullable UpdatedTime { get; set; } + + /// + /// 创建人ID + /// + public long CreatedUserId { get; set; } + + /// + /// 创建人名称 + /// + public string CreatedUserName { get; set; } + + /// + /// 修改人ID + /// + public long UpdatedUserId { get; set; } + + /// + /// 修改人名称 + /// + public string UpdatedUserName { get; set; } } }