From 0bfb35c562db00e130ac21b800bc4cc636fa5d41 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 25 Mar 2024 15:18:39 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A9=AC=E5=A3=AB?= =?UTF-8?q?=E5=9F=BAAPI=E8=AE=A2=E8=88=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entity/BookingDeliveryRecord.cs | 80 +++++++++++++++++++ .../TaskPODDischargeGateoutFullDetailInfo.cs | 2 +- .../BookingOrder/BookingMSKAPIService.cs | 16 +++- .../BookingOrder/Dto/BookingEDIMapper.cs | 39 ++++++++- .../Service/BookingOrder/Dto/MSKBookingDto.cs | 80 +++++++++++++++++++ 5 files changed, 213 insertions(+), 4 deletions(-) diff --git a/Myshipping.Application/Entity/BookingDeliveryRecord.cs b/Myshipping.Application/Entity/BookingDeliveryRecord.cs index b6024eee..937b7447 100644 --- a/Myshipping.Application/Entity/BookingDeliveryRecord.cs +++ b/Myshipping.Application/Entity/BookingDeliveryRecord.cs @@ -451,5 +451,85 @@ namespace Myshipping.Application.Entity /// 最后BookingCancellation接收时间 /// public Nullable LST_RECV_BK_CANCEL_DATE { get; set; } + + /// + /// 船期ID + /// + public string CARRIER_PRODUCT_ID { get; set; } + + /// + /// 是否不使用船期表订舱 + /// + public bool IS_SEND_NO_SCHEDULE { get; set; } + + /// + /// 收货地国家名称 + /// + public string PLACERECEIPT_COUNTRY_NAME { get; set; } + + /// + /// 收货地行政名称 + /// + public string PLACERECEIPT_REGION_NAME { get; set; } + + /// + /// 用户录入收货地城市英文名称 + /// + public string USER_PLACERECEIPT_CITY { get; set; } + + /// + /// 用户录入收货地UN地点代码 + /// + public string USER_PLACERECEIPT_UNLOC_CODE { get; set; } + + /// + /// 用户录入收货地国家代码 + /// + public string USER_PLACERECEIPT_COUNTRY_CODE { get; set; } + + /// + /// 用户录入收货地国家名称 + /// + public string USER_PLACERECEIPT_COUNTRY_NAME { get; set; } + + /// + /// 用户录入收货地行政名称 + /// + public string USER_PLACERECEIPT_REGION_NAME { get; set; } + + /// + /// 交货地国家名称 + /// + public string PLACEDELIVERY_COUNTRY_NAME { get; set; } + + /// + /// 交货地行政名称 + /// + public string PLACEDELIVERY_REGION_NAME { get; set; } + + /// + /// 用户录入交货地城市英文名称 + /// + public string USER_PLACEDELIVERY_CITY { get; set; } + + /// + /// 用户录入交货地UN地点代码 + /// + public string USER_PLACEDELIVERY_UNLOC_CODE { get; set; } + + /// + /// 用户录入交货地国家代码 + /// + public string USER_PLACEDELIVERY_COUNTRY_CODE { get; set; } + + /// + /// 用户录入交货地国家名称 + /// + public string USER_PLACEDELIVERY_COUNTRY_NAME { get; set; } + + /// + /// 用户录入交货地行政名称 + /// + public string USER_PLACEDELIVERY_REGION_NAME { get; set; } } } diff --git a/Myshipping.Application/Entity/TaskManagePlat/TaskPODDischargeGateoutFullDetailInfo.cs b/Myshipping.Application/Entity/TaskManagePlat/TaskPODDischargeGateoutFullDetailInfo.cs index a94de594..34845de9 100644 --- a/Myshipping.Application/Entity/TaskManagePlat/TaskPODDischargeGateoutFullDetailInfo.cs +++ b/Myshipping.Application/Entity/TaskManagePlat/TaskPODDischargeGateoutFullDetailInfo.cs @@ -17,7 +17,7 @@ namespace Myshipping.Application public class TaskPODDischargeGateoutFullDetailInfo : TaskManageDbEntity { /// - /// VGM任务主键 + /// 父主键 /// public string P_ID { get; set; } diff --git a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs index bcde2f9d..58f6b05f 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs @@ -311,6 +311,12 @@ namespace Myshipping.Application.Service.BookingOrder }, }; + //排查怀疑这里是导致BC没有合约号胡的问题,开启这个值看看 + //if (model.isBookingPartOwnPrice) + //{ + // bookingDto.bookingBody.mandatoryParties.isPriceOwnerFromServiceContractAccepted = true; + //} + bookingDto.bookingBody.transport = new MSKAPIBookingTransport { carrierCode = model.carrierCode, @@ -362,6 +368,11 @@ namespace Myshipping.Application.Service.BookingOrder } }; + if(!model.isSendNoSchedule) + { + bookingDto.bookingBody.transport.routeDetails.selectedRoute.routeScheduleId = model.carrierProductId; + } + bookingDto.bookingBody.cargo = new MSKAPIBookingCargo { commodityCode = model.commodityCode, @@ -611,7 +622,10 @@ namespace Myshipping.Application.Service.BookingOrder throw Oops.Bah($"货物标志必填"); if(!model.earliestDepartureDate.HasValue) - throw Oops.Bah($"预计离港日期必填"); + throw Oops.Bah($"预计离港日期必填"); + + if (!model.isSendNoSchedule && !string.IsNullOrWhiteSpace(model.carrierProductId)) + throw Oops.Bah($"船期信息不能为空,请查询船期信息"); if (model.isReefer) { diff --git a/Myshipping.Application/Service/BookingOrder/Dto/BookingEDIMapper.cs b/Myshipping.Application/Service/BookingOrder/Dto/BookingEDIMapper.cs index a05a3107..13459089 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/BookingEDIMapper.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/BookingEDIMapper.cs @@ -139,7 +139,26 @@ namespace Myshipping.Application .Map(dest => dest.PRICE_OWNER_REFERENCE_NAME, src => src.priceOwnerReferenceName) .Map(dest => dest.IS_REEFER, src => src.isReefer) .Map(dest => dest.IS_SHIPPER_OWNED, src => src.isShipperOwned) - .Map(dest => dest.IS_IMPORT_RETURNED, src => src.isImportReturned); + .Map(dest => dest.IS_IMPORT_RETURNED, src => src.isImportReturned) + .Map(dest => dest.CARRIER_PRODUCT_ID, src => src.carrierProductId) + .Map(dest => dest.IS_SEND_NO_SCHEDULE, src => src.isSendNoSchedule) + .Map(dest => dest.PLACERECEIPT_COUNTRY_NAME, src => src.placeOfReceiptCountryName) + .Map(dest => dest.PLACERECEIPT_REGION_NAME, src => src.placeOfReceiptRegionName) + .Map(dest => dest.PLACEDELIVERY_COUNTRY_NAME, src => src.placeOfDeliveryCountryName) + .Map(dest => dest.PLACEDELIVERY_REGION_NAME, src => src.placeOfDeliveryRegionName) + .Map(dest => dest.USER_PLACEDELIVERY_CITY, src => src.userPlaceOfDeliveryCityName) + .Map(dest => dest.USER_PLACEDELIVERY_COUNTRY_CODE, src => src.userPlaceOfDeliveryCountryCode) + .Map(dest => dest.USER_PLACEDELIVERY_COUNTRY_NAME, src => src.userPlaceOfDeliveryCountryName) + .Map(dest => dest.USER_PLACEDELIVERY_UNLOC_CODE, src => src.userPlaceOfDeliveryUnLocCode) + .Map(dest => dest.USER_PLACEDELIVERY_REGION_NAME, src => src.userPlaceOfDeliveryRegionName) + .Map(dest => dest.USER_PLACERECEIPT_CITY, src => src.userPlaceOfReceiptCityName) + .Map(dest => dest.USER_PLACERECEIPT_COUNTRY_CODE, src => src.userPlaceOfReceiptCountryCode) + .Map(dest => dest.USER_PLACERECEIPT_COUNTRY_NAME, src => src.userPlaceOfReceiptCountryName) + .Map(dest => dest.USER_PLACERECEIPT_UNLOC_CODE, src => src.userPlaceOfReceiptUnLocCode) + .Map(dest => dest.USER_PLACERECEIPT_REGION_NAME, src => src.userPlaceOfReceiptRegionName); + + + config.ForType() .Map(dest => dest.id, src => src.Id) @@ -189,7 +208,23 @@ namespace Myshipping.Application .Map(dest => dest.priceOwnerReference, src => src.PRICE_OWNER_REFERENCE) .Map(dest => dest.priceOwnerReferenceName, src => src.PRICE_OWNER_REFERENCE_NAME) .Map(dest => dest.isShipperOwned, src => src.IS_SHIPPER_OWNED) - .Map(dest => dest.isImportReturned, src => src.IS_IMPORT_RETURNED); + .Map(dest => dest.isImportReturned, src => src.IS_IMPORT_RETURNED) + .Map(dest => dest.carrierProductId, src => src.CARRIER_PRODUCT_ID) + .Map(dest => dest.isSendNoSchedule, src => src.IS_SEND_NO_SCHEDULE) + .Map(dest => dest.placeOfReceiptCountryName, src => src.PLACERECEIPT_COUNTRY_NAME) + .Map(dest => dest.placeOfReceiptRegionName, src => src.PLACERECEIPT_REGION_NAME) + .Map(dest => dest.placeOfDeliveryCountryName, src => src.PLACEDELIVERY_COUNTRY_NAME) + .Map(dest => dest.placeOfDeliveryRegionName, src => src.PLACEDELIVERY_REGION_NAME) + .Map(dest => dest.userPlaceOfDeliveryCityName, src => src.USER_PLACEDELIVERY_CITY) + .Map(dest => dest.userPlaceOfDeliveryCountryCode, src => src.USER_PLACEDELIVERY_COUNTRY_CODE) + .Map(dest => dest.userPlaceOfDeliveryCountryName, src => src.USER_PLACEDELIVERY_COUNTRY_NAME) + .Map(dest => dest.userPlaceOfDeliveryUnLocCode, src => src.USER_PLACEDELIVERY_UNLOC_CODE) + .Map(dest => dest.userPlaceOfDeliveryRegionName, src => src.USER_PLACEDELIVERY_REGION_NAME) + .Map(dest => dest.userPlaceOfReceiptCityName, src => src.USER_PLACERECEIPT_CITY) + .Map(dest => dest.userPlaceOfReceiptCountryCode, src => src.USER_PLACERECEIPT_COUNTRY_CODE) + .Map(dest => dest.userPlaceOfReceiptCountryName, src => src.USER_PLACERECEIPT_COUNTRY_NAME) + .Map(dest => dest.userPlaceOfReceiptUnLocCode, src => src.USER_PLACERECEIPT_UNLOC_CODE) + .Map(dest => dest.userPlaceOfReceiptRegionName, src => src.USER_PLACERECEIPT_REGION_NAME); config.ForType() diff --git a/Myshipping.Application/Service/BookingOrder/Dto/MSKBookingDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/MSKBookingDto.cs index 18b1e006..25ccd7ec 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/MSKBookingDto.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/MSKBookingDto.cs @@ -276,6 +276,86 @@ namespace Myshipping.Application /// public bool isImportReturned { get; set; } + /// + /// 查询船期ID + /// + public string carrierProductId { get; set; } + + /// + /// 是否不使用船期表订舱 + /// + public bool isSendNoSchedule { get; set; } = false; + + /// + /// 收货地国家名称 + /// + public string placeOfReceiptCountryName { get; set; } + + /// + /// 收货地行政名称 + /// + public string placeOfReceiptRegionName { get; set; } + + /// + /// 交货地国家名称 + /// + public string placeOfDeliveryCountryName { get; set; } + + /// + /// 交货地行政名称 + /// + public string placeOfDeliveryRegionName { get; set; } + + /// + /// 用户录入收货地UN地点代码 + /// + public string userPlaceOfReceiptUnLocCode { get; set; } + + /// + /// 用户录入收货地城市英文名称 + /// + public string userPlaceOfReceiptCityName { get; set; } + + /// + /// 用户录入收货地国家代码 + /// + public string userPlaceOfReceiptCountryCode { get; set; } + + // + /// 用户录入收货地国家名称 + /// + public string userPlaceOfReceiptCountryName { get; set; } + + /// + /// 用户录入收货地行政名称 + /// + public string userPlaceOfReceiptRegionName { get; set; } + + /// + /// 用户录入交货地国家名称 + /// + public string userPlaceOfDeliveryCountryName { get; set; } + + /// + /// 用户录入交货地行政名称 + /// + public string userPlaceOfDeliveryRegionName { get; set; } + + /// + /// 用户录入交货地UN地点代码 + /// + public string userPlaceOfDeliveryUnLocCode { get; set; } + + /// + /// 用户录入交货地城市英文名称 + /// + public string userPlaceOfDeliveryCityName { get; set; } + + /// + /// 用户录入交货地国家代码 + /// + public string userPlaceOfDeliveryCountryCode { get; set; } + /// /// 箱型箱量列表 /// From 4040d2d715797fc5c589466d5213d5b5024ff17f Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 25 Mar 2024 17:37:39 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A9=AC=E5=A3=AB?= =?UTF-8?q?=E5=9F=BAAPI=E8=AE=A2=E8=88=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingMSKAPIService.cs | 59 +++++++++++++++---- .../Dto/QueryBookingDeliveryRecordDto.cs | 10 ++++ .../BookingOrder/IBookingMSKAPIService.cs | 15 +++++ 3 files changed, 74 insertions(+), 10 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs index 58f6b05f..8c07aa2d 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs @@ -327,17 +327,19 @@ namespace Myshipping.Application.Service.BookingOrder { placeOfReceipt = new MSKAPIBookingRouteDetailsBase { - UNLocationCode = model.placeOfReceiptUnLocCode, - cityName = model.placeOfReceiptCityName, + UNLocationCode = model.isSendNoSchedule ? model.userPlaceOfReceiptUnLocCode + : model.placeOfReceiptUnLocCode, + //cityName = model.placeOfReceiptCityName, }, placeOfDelivery = new MSKAPIBookingRouteDetailsBase { - UNLocationCode = model.placeOfDeliveryUnLocCode, - cityName = model.placeOfDeliveryCityName, + UNLocationCode = model.isSendNoSchedule ? model.userPlaceOfDeliveryUnLocCode + : model.placeOfDeliveryUnLocCode, + //cityName = model.placeOfDeliveryCityName, }, selectedRoute = new MSKAPIBookingRoute { - bookingSchedules = new List { + bookingSchedules = new List { new MSKAPIBookingSchedules { originDepartureDateTimeLocal = model.originDepartureDateTimeLocal.Value.ToString("yyyy-MM-ddTHH:mm:ss"), @@ -353,16 +355,18 @@ namespace Myshipping.Application.Service.BookingOrder }, startLocation = new MSKAPIBookingRouteDetailsBase { - cityName = model.placeOfReceiptCityName, - UNLocationCode = model.placeOfReceiptUnLocCode + //cityName = model.placeOfReceiptCityName, + UNLocationCode = model.isSendNoSchedule ? model.userPlaceOfReceiptUnLocCode + : model.placeOfReceiptUnLocCode }, endLocation = new MSKAPIBookingRouteDetailsBase { - cityName = model.placeOfDeliveryCityName, - UNLocationCode = model.placeOfDeliveryUnLocCode + //cityName = model.placeOfDeliveryCityName, + UNLocationCode = model.isSendNoSchedule ? model.userPlaceOfDeliveryUnLocCode + : model.placeOfDeliveryUnLocCode }, transportModeCode = model.transportMode - } + } } }, } @@ -987,6 +991,8 @@ 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)) + .WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.BookingReference), t => t.BOOKING_REFERENCE.Contains(QuerySearch.BookingReference)) + .WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.BookingCreator), t => t.CreatedUserName.Contains(QuerySearch.BookingCreator) || t.UpdatedUserName.Contains(QuerySearch.BookingCreator)) .OrderBy(entityOrderCol + (QuerySearch.descSort ? " desc " : " asc ")) .ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize); @@ -1251,5 +1257,38 @@ namespace Myshipping.Application.Service.BookingOrder }).ExecuteCommandAsync(); } #endregion + + #region 批量发送 + /// + /// 批量发送 + /// + /// 马士基API订舱ID组 + /// 返回执行结果消息 + public async Task BatchSend(long[] ids) + { + var list = await _bookingDeliveryRecordRep.AsQueryable() + .Where(a => ids.Contains(a.Id)).ToListAsync(); + + if (list.Count != ids.Length) + throw Oops.Oh("订舱数据获取失败,请确认选中的记录是否存在"); + + + return string.Empty; + } + #endregion + + #region 批量发送 + /// + /// 批量发送 + /// + /// 马士基API订舱ID + /// 需要复制生成记录 + /// 返回执行结果消息 + public async Task BatchCopy(long id, int copyNum) + { + + return string.Empty; + } + #endregion } } diff --git a/Myshipping.Application/Service/BookingOrder/Dto/QueryBookingDeliveryRecordDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/QueryBookingDeliveryRecordDto.cs index a963f3d2..dd4808e2 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/QueryBookingDeliveryRecordDto.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/QueryBookingDeliveryRecordDto.cs @@ -142,5 +142,15 @@ namespace Myshipping.Application /// 目的地 /// public string PlaceDeliveryCity { get; set; } + + /// + /// 订舱号 + /// + public string BookingReference { get; set; } + + /// + /// 订舱人 + /// + public string BookingCreator { get; set; } } } diff --git a/Myshipping.Application/Service/BookingOrder/IBookingMSKAPIService.cs b/Myshipping.Application/Service/BookingOrder/IBookingMSKAPIService.cs index 36e2bd49..f934d933 100644 --- a/Myshipping.Application/Service/BookingOrder/IBookingMSKAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/IBookingMSKAPIService.cs @@ -65,5 +65,20 @@ namespace Myshipping.Application /// 请求订舱ID /// Task Delete(long id); + + /// + /// 批量发送 + /// + /// 马士基API订舱ID组 + /// 返回执行结果消息 + Task BatchSend(long[] ids); + + /// + /// 批量发送 + /// + /// 马士基API订舱ID + /// 需要复制生成记录 + /// 返回执行结果消息 + Task BatchCopy(long id,int copyNum); } } From b050481ed3f714bc6f948dff7ee0be74f5ba3b06 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 25 Mar 2024 17:47:45 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A9=AC=E5=A3=AB?= =?UTF-8?q?=E5=9F=BA=E8=AE=A2=E8=88=B1=E5=88=A4=E6=96=AD=E8=88=B9=E6=9C=9F?= =?UTF-8?q?ID=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingMSKAPIService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs index 8c07aa2d..61fbe7b6 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs @@ -628,7 +628,7 @@ namespace Myshipping.Application.Service.BookingOrder if(!model.earliestDepartureDate.HasValue) throw Oops.Bah($"预计离港日期必填"); - if (!model.isSendNoSchedule && !string.IsNullOrWhiteSpace(model.carrierProductId)) + if (!model.isSendNoSchedule && string.IsNullOrWhiteSpace(model.carrierProductId)) throw Oops.Bah($"船期信息不能为空,请查询船期信息"); if (model.isReefer)