From 5bd0ebe79f92a5546fdafe2bc6a0c306a3d9353c Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 19 Nov 2024 09:41:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B0=E5=A2=9ESITC?= =?UTF-8?q?=E4=B8=AD=E8=BD=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EDI/Dtos/EDIBaseModel.cs | 198 ++++++++++++++++++ Myshipping.Application/EDI/SITCEdiHelper.cs | 40 ++++ .../Entity/BookingMultiLineSplitRecord.cs | 190 +++++++++++++++++ .../BookingOrder/BookingOrderService.cs | 10 + .../BookingMultiLineSplitDto.cs | 190 +++++++++++++++++ 5 files changed, 628 insertions(+) diff --git a/Myshipping.Application/EDI/Dtos/EDIBaseModel.cs b/Myshipping.Application/EDI/Dtos/EDIBaseModel.cs index 85f74849..1e84fe4a 100644 --- a/Myshipping.Application/EDI/Dtos/EDIBaseModel.cs +++ b/Myshipping.Application/EDI/Dtos/EDIBaseModel.cs @@ -91,5 +91,203 @@ namespace Myshipping.Application /// 付费方式代码 /// public string PAYABLE { get; set; } + + /// + /// 海丰扩展信息 + /// + public SITCExtInfo SITCExt { get; set; } + } + + public class SITCExtInfo + { + /// + /// 运程类型(DIRECT-直达,SECOND-二程,THIRD-三程) + /// + public string TransferType { get; set; } + + /// + /// 运程类型名称(DIRECT-直达,SECOND-二程,THIRD-三程) + /// + public string TransferTypeName { get; set; } + + /// + /// 一程运力类型(MAIN-干线,BRANCH-支线) + /// + public string FstShipCapacity { get; set; } + + /// + /// 一程运力类型名称(MAIN-干线,BRANCH-支线) + /// + public string FstShipCapacityName { get; set; } + + /// + /// 一程ETD + /// + public Nullable FstETD { get; set; } + + /// + /// 一程船名 + /// + public string FstVessel { get; set; } + + /// + /// 一程航次号 + /// + public string FstVoyno { get; set; } + + /// + /// 一程装货港代码 + /// + public string FstPortLoadCode { get; set; } + + /// + /// 一程装货港名称 + /// + public string FstPortLoad { get; set; } + + /// + /// 一程卸货港代码 + /// + public string FstPortDischargeCode { get; set; } + + /// + /// 一程卸货港名称 + /// + public string FstPortDischarge { get; set; } + + /// + /// 一程港属类型(LOCATION-本港) + /// + public string FstTransferLocType { get; set; } + + /// + /// 一程港属类型名称(LOCATION-本港) + /// + public string FstTransferLogTypeName { get; set; } + + /// + /// 一程航线 + /// + public string FstLaneName { get; set; } + + /// + /// 二程运力类型(MAIN-干线,BRANCH-支线) + /// + public string SecShipCapacity { get; set; } + + /// + /// 二程运力类型名称(MAIN-干线,BRANCH-支线) + /// + public string SecShipCapacityName { get; set; } + + /// + /// 二程ETD + /// + public Nullable SecETD { get; set; } + + /// + /// 二程船名 + /// + public string SecVessel { get; set; } + + /// + /// 二程航次号 + /// + public string SecVoyno { get; set; } + + /// + /// 二程装货港代码 + /// + public string SecPortLoadCode { get; set; } + + /// + /// 二程装货港名称 + /// + public string SecPortLoad { get; set; } + + /// + /// 二程卸货港代码 + /// + public string SecPortDischargeCode { get; set; } + + /// + /// 二程卸货港名称 + /// + public string SecPortDischarge { get; set; } + + /// + /// 二程港属类型(LOCATION-本港) + /// + public string SecTransferLocType { get; set; } + + /// + /// 二程港属类型名称(LOCATION-本港) + /// + public string SecTransferLogTypeName { get; set; } + + /// + /// 二程航线 + /// + public string SecLaneName { get; set; } + + /// + /// 三程运力类型(MAIN-干线,BRANCH-支线) + /// + public string ThdShipCapacity { get; set; } + + /// + /// 三程运力类型名称(MAIN-干线,BRANCH-支线) + /// + public string ThdShipCapacityName { get; set; } + + /// + /// 三程ETD + /// + public Nullable ThdETD { get; set; } + + /// + /// 三程船名 + /// + public string ThdVessel { get; set; } + + /// + /// 三程航次号 + /// + public string ThdVoyno { get; set; } + + /// + /// 三程装货港代码 + /// + public string ThdPortLoadCode { get; set; } + + /// + /// 三程装货港名称 + /// + public string ThdPortLoad { get; set; } + + /// + /// 三程卸货港代码 + /// + public string ThdPortDischargeCode { get; set; } + + /// + /// 三程卸货港名称 + /// + public string ThdPortDischarge { get; set; } + + /// + /// 三程港属类型(LOCATION-本港) + /// + public string ThdTransferLocType { get; set; } + + /// + /// 三程港属类型名称(LOCATION-本港) + /// + public string ThdTransferLogTypeName { get; set; } + + /// + /// 三程航线 + /// + public string ThdLaneName { get; set; } } } diff --git a/Myshipping.Application/EDI/SITCEdiHelper.cs b/Myshipping.Application/EDI/SITCEdiHelper.cs index 5ce06f6f..17e2e0db 100644 --- a/Myshipping.Application/EDI/SITCEdiHelper.cs +++ b/Myshipping.Application/EDI/SITCEdiHelper.cs @@ -1,5 +1,6 @@ using DocumentFormat.OpenXml.ExtendedProperties; using Google.Protobuf.WellKnownTypes; +using Mapster.Utils; using Myshipping.Application.EDI.ESL; using MySqlX.XDevAPI.Common; using Newtonsoft.Json; @@ -203,6 +204,30 @@ namespace Myshipping.Application.EDI.SITC }); } + /* + 1.直达无需处理 OUT特殊设置TRA + 2.若有中转,根据一程 二程 三程 处理 json中 clen的值‘1-3’ + 3.干线支线的选择,如接口文档中 支线:0 干线:1 + 4.港口及代码的处理,均按照映射中 船公司为SITC的港口代码进行处理 + 5.运输类型 cCommodity 默认为0 + */ + if (InttrEdi.SITCExt != null && !string.IsNullOrWhiteSpace(InttrEdi.SITCExt.TransferType) && !InttrEdi.SITCExt.TransferType.Equals("DIRECT",StringComparison.OrdinalIgnoreCase)) + { + //if (InttrEdi.SITCExt.TransferType.Equals("SECOND", StringComparison.OrdinalIgnoreCase)) + //{ + // postModel.extras.Add(new SitcApiPostModelExtra + // { + // ctype = "TRA", + // clen = 1, + // cnum = InttrEdi.SITCExt.FstShipCapacity == "MAIN" ? 1 : 0, + // vent = InttrEdi.SITCExt.FstVessel?.Trim(), + // humdity = InttrEdi.SITCExt.FstVoyno?.Trim(), + // soc = InttrEdi.SITCExt.FstLaneName?.Trim(), + // unit = + // }); + //} + } + string json = JsonConvert.SerializeObject(postModel, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore @@ -573,6 +598,21 @@ namespace Myshipping.Application.EDI.SITC /// 类型 /// public string ctype { get; set; } + + /// + /// 程次(TRA) + /// + public Nullable clen { get; set; } + + /// + /// 支线:0;干线:1(TRA) + /// + public Nullable cnum { get; set; } + + /// + /// 航线代码 + /// + public string soc { get; set; } } public class SitcApiPostModelDangerInfo diff --git a/Myshipping.Application/Entity/BookingMultiLineSplitRecord.cs b/Myshipping.Application/Entity/BookingMultiLineSplitRecord.cs index 6081a167..f56d313d 100644 --- a/Myshipping.Application/Entity/BookingMultiLineSplitRecord.cs +++ b/Myshipping.Application/Entity/BookingMultiLineSplitRecord.cs @@ -75,5 +75,195 @@ namespace Myshipping.Application.Entity /// 付费方式代码 /// public string PAYABLE { get; set; } + + /// + /// 运程类型(DIRECT-直达,SECOND-二程,THIRD-三程) + /// + public string TransferType { get; set; } + + /// + /// 运程类型名称(DIRECT-直达,SECOND-二程,THIRD-三程) + /// + public string TransferTypeName { get; set; } + + /// + /// 一程运力类型(MAIN-干线,BRANCH-支线) + /// + public string FstShipCapacity { get; set; } + + /// + /// 一程运力类型名称(MAIN-干线,BRANCH-支线) + /// + public string FstShipCapacityName { get; set; } + + /// + /// 一程ETD + /// + public Nullable FstETD { get; set; } + + /// + /// 一程船名 + /// + public string FstVessel { get; set; } + + /// + /// 一程航次号 + /// + public string FstVoyno { get; set; } + + /// + /// 一程装货港代码 + /// + public string FstPortLoadCode { get; set; } + + /// + /// 一程装货港名称 + /// + public string FstPortLoad { get; set; } + + /// + /// 一程卸货港代码 + /// + public string FstPortDischargeCode { get; set; } + + /// + /// 一程卸货港名称 + /// + public string FstPortDischarge { get; set; } + + /// + /// 一程港属类型(LOCATION-本港) + /// + public string FstTransferLocType { get; set; } + + /// + /// 一程港属类型名称(LOCATION-本港) + /// + public string FstTransferLogTypeName { get; set; } + + /// + /// 一程航线 + /// + public string FstLaneName { get; set; } + + /// + /// 二程运力类型(MAIN-干线,BRANCH-支线) + /// + public string SecShipCapacity { get; set; } + + /// + /// 二程运力类型名称(MAIN-干线,BRANCH-支线) + /// + public string SecShipCapacityName { get; set; } + + /// + /// 二程ETD + /// + public Nullable SecETD { get; set; } + + /// + /// 二程船名 + /// + public string SecVessel { get; set; } + + /// + /// 二程航次号 + /// + public string SecVoyno { get; set; } + + /// + /// 二程装货港代码 + /// + public string SecPortLoadCode { get; set; } + + /// + /// 二程装货港名称 + /// + public string SecPortLoad { get; set; } + + /// + /// 二程卸货港代码 + /// + public string SecPortDischargeCode { get; set; } + + /// + /// 二程卸货港名称 + /// + public string SecPortDischarge { get; set; } + + /// + /// 二程港属类型(LOCATION-本港) + /// + public string SecTransferLocType { get; set; } + + /// + /// 二程港属类型名称(LOCATION-本港) + /// + public string SecTransferLogTypeName { get; set; } + + /// + /// 二程航线 + /// + public string SecLaneName { get; set; } + + /// + /// 三程运力类型(MAIN-干线,BRANCH-支线) + /// + public string ThdShipCapacity { get; set; } + + /// + /// 三程运力类型名称(MAIN-干线,BRANCH-支线) + /// + public string ThdShipCapacityName { get; set; } + + /// + /// 三程ETD + /// + public Nullable ThdETD { get; set; } + + /// + /// 三程船名 + /// + public string ThdVessel { get; set; } + + /// + /// 三程航次号 + /// + public string ThdVoyno { get; set; } + + /// + /// 三程装货港代码 + /// + public string ThdPortLoadCode { get; set; } + + /// + /// 三程装货港名称 + /// + public string ThdPortLoad { get; set; } + + /// + /// 三程卸货港代码 + /// + public string ThdPortDischargeCode { get; set; } + + /// + /// 三程卸货港名称 + /// + public string ThdPortDischarge { get; set; } + + /// + /// 三程港属类型(LOCATION-本港) + /// + public string ThdTransferLocType { get; set; } + + /// + /// 三程港属类型名称(LOCATION-本港) + /// + public string ThdTransferLogTypeName { get; set; } + + /// + /// 三程航线 + /// + public string ThdLaneName { get; set; } } } diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index e7c64160..033aad25 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -8246,6 +8246,10 @@ namespace Myshipping.Application primaryModel.FEETYPE = multiline.FEETYPE; primaryModel.PAYABLEEXT = multiline.PAYABLE; + + ediModel.SITCExt = multiline.Adapt(); + + //这里做个检查 } } @@ -12386,6 +12390,12 @@ namespace Myshipping.Application result.succ = true; result.extra = sitcModel; + var record = _repBookingMultiLineSplitRecord.AsQueryable().Where(a => a.BOOKING_ID == model.Id).OrderByDescending(a => a.CreatedTime).First(); + if (record != null) + { + result.extra2 = record; + } + return result; } diff --git a/Myshipping.Application/Service/BookingOrder/Dto/MultilineSplit/BookingMultiLineSplitDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/MultilineSplit/BookingMultiLineSplitDto.cs index 9ffff857..5037d13f 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/MultilineSplit/BookingMultiLineSplitDto.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/MultilineSplit/BookingMultiLineSplitDto.cs @@ -70,5 +70,195 @@ namespace Myshipping.Application /// 付费方式代码 /// public string PAYABLE { get; set; } + + /// + /// 运程类型(DIRECT-直达,SECOND-二程,THIRD-三程) + /// + public string TransferType { get; set; } + + /// + /// 运程类型名称(DIRECT-直达,SECOND-二程,THIRD-三程) + /// + public string TransferTypeName { get; set; } + + /// + /// 一程运力类型(MAIN-干线,BRANCH-支线) + /// + public string FstShipCapacity { get; set; } + + /// + /// 一程运力类型名称(MAIN-干线,BRANCH-支线) + /// + public string FstShipCapacityName { get; set; } + + /// + /// 一程ETD + /// + public Nullable FstETD { get; set; } + + /// + /// 一程船名 + /// + public string FstVessel { get; set; } + + /// + /// 一程航次号 + /// + public string FstVoyno { get; set; } + + /// + /// 一程装货港代码 + /// + public string FstPortLoadCode { get; set; } + + /// + /// 一程装货港名称 + /// + public string FstPortLoad { get; set; } + + /// + /// 一程卸货港代码 + /// + public string FstPortDischargeCode { get; set; } + + /// + /// 一程卸货港名称 + /// + public string FstPortDischarge { get; set; } + + /// + /// 一程港属类型(LOCATION-本港) + /// + public string FstTransferLocType { get; set; } + + /// + /// 一程港属类型名称(LOCATION-本港) + /// + public string FstTransferLogTypeName { get; set; } + + /// + /// 一程航线 + /// + public string FstLaneName { get; set; } + + /// + /// 二程运力类型(MAIN-干线,BRANCH-支线) + /// + public string SecShipCapacity { get; set; } + + /// + /// 二程运力类型名称(MAIN-干线,BRANCH-支线) + /// + public string SecShipCapacityName { get; set; } + + /// + /// 二程ETD + /// + public Nullable SecETD { get; set; } + + /// + /// 二程船名 + /// + public string SecVessel { get; set; } + + /// + /// 二程航次号 + /// + public string SecVoyno { get; set; } + + /// + /// 二程装货港代码 + /// + public string SecPortLoadCode { get; set; } + + /// + /// 二程装货港名称 + /// + public string SecPortLoad { get; set; } + + /// + /// 二程卸货港代码 + /// + public string SecPortDischargeCode { get; set; } + + /// + /// 二程卸货港名称 + /// + public string SecPortDischarge { get; set; } + + /// + /// 二程港属类型(LOCATION-本港) + /// + public string SecTransferLocType { get; set; } + + /// + /// 二程港属类型名称(LOCATION-本港) + /// + public string SecTransferLogTypeName { get; set; } + + /// + /// 二程航线 + /// + public string SecLaneName { get; set; } + + /// + /// 三程运力类型(MAIN-干线,BRANCH-支线) + /// + public string ThdShipCapacity { get; set; } + + /// + /// 三程运力类型名称(MAIN-干线,BRANCH-支线) + /// + public string ThdShipCapacityName { get; set; } + + /// + /// 三程ETD + /// + public Nullable ThdETD { get; set; } + + /// + /// 三程船名 + /// + public string ThdVessel { get; set; } + + /// + /// 三程航次号 + /// + public string ThdVoyno { get; set; } + + /// + /// 三程装货港代码 + /// + public string ThdPortLoadCode { get; set; } + + /// + /// 三程装货港名称 + /// + public string ThdPortLoad { get; set; } + + /// + /// 三程卸货港代码 + /// + public string ThdPortDischargeCode { get; set; } + + /// + /// 三程卸货港名称 + /// + public string ThdPortDischarge { get; set; } + + /// + /// 三程港属类型(LOCATION-本港) + /// + public string ThdTransferLocType { get; set; } + + /// + /// 三程港属类型名称(LOCATION-本港) + /// + public string ThdTransferLogTypeName { get; set; } + + /// + /// 三程航线 + /// + public string ThdLaneName { get; set; } } }