From 814dc35a0c66e286e2ccc2728f6003a9e750a578 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 26 Mar 2024 09:54:42 +0800 Subject: [PATCH 1/8] =?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=EF=BC=8C=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=88=B9=E6=9C=9F=E8=A1=A8=E7=9A=84=E8=B5=B7?= =?UTF-8?q?=E5=A7=8B=E5=9C=B0=E5=92=8C=E7=9B=AE=E7=9A=84=E5=9C=B0=E7=9A=84?= =?UTF-8?q?=E6=B8=AF=E5=8F=A3=E4=BB=A3=E7=A0=81=EF=BC=8C=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E6=A3=80=E7=B4=A2=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingMSKAPIService.cs | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs index beb099d0..dfdd5c1f 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs @@ -18,6 +18,7 @@ using Microsoft.Extensions.Logging; using Myshipping.Application.Helper; using System.Text.RegularExpressions; using System.Globalization; +using Myshipping.Core.Const; namespace Myshipping.Application.Service.BookingOrder { @@ -327,14 +328,14 @@ namespace Myshipping.Application.Service.BookingOrder { placeOfReceipt = new MSKAPIBookingRouteDetailsBase { - UNLocationCode = model.isSendNoSchedule ? model.userPlaceOfReceiptUnLocCode - : model.placeOfReceiptUnLocCode, + UNLocationCode = model.userPlaceOfReceiptUnLocCode + //: model.placeOfReceiptUnLocCode, //cityName = model.placeOfReceiptCityName, }, placeOfDelivery = new MSKAPIBookingRouteDetailsBase { - UNLocationCode = model.isSendNoSchedule ? model.userPlaceOfDeliveryUnLocCode - : model.placeOfDeliveryUnLocCode, + UNLocationCode = model.userPlaceOfDeliveryUnLocCode + //: model.placeOfDeliveryUnLocCode, //cityName = model.placeOfDeliveryCityName, }, selectedRoute = new MSKAPIBookingRoute @@ -356,14 +357,14 @@ namespace Myshipping.Application.Service.BookingOrder startLocation = new MSKAPIBookingRouteDetailsBase { //cityName = model.placeOfReceiptCityName, - UNLocationCode = model.isSendNoSchedule ? model.userPlaceOfReceiptUnLocCode - : model.placeOfReceiptUnLocCode + UNLocationCode = model.userPlaceOfReceiptUnLocCode + //: model.placeOfReceiptUnLocCode }, endLocation = new MSKAPIBookingRouteDetailsBase { //cityName = model.placeOfDeliveryCityName, - UNLocationCode = model.isSendNoSchedule ? model.userPlaceOfDeliveryUnLocCode - : model.placeOfDeliveryUnLocCode + UNLocationCode = model.userPlaceOfDeliveryUnLocCode + //: model.placeOfDeliveryUnLocCode }, transportModeCode = model.transportMode } @@ -977,6 +978,18 @@ namespace Myshipping.Application.Service.BookingOrder //这里因为返回给前端的台账数据是DTO,所以这里排序时候需要转换成Entity对应的字段 if (!string.IsNullOrWhiteSpace(QuerySearch.SortField)) entityOrderCol = MapsterExtHelper.GetAdaptProperty(QuerySearch.SortField); + /* + //菜单375504048771141=我的任务台账 + List userlist = await _sysDataUserMenuService.GetDataScopeList(MenuConst.MenuTaskManage); + + if (userlist == null) + userlist = new List { UserManager.UserId }; + + if (userlist.Count > 0) + userlist = userlist.Distinct().ToList(); + + _logger.LogInformation("任务台账权限范围 {list}", userlist); + */ var entities = await _bookingDeliveryRecordRep.AsQueryable() .WhereIF(createBegin != DateTime.MinValue, t => t.CreatedTime.HasValue && t.CreatedTime.Value >= createBegin) From e2878eb358ed9c4611348958a8657e419fafd97b Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 26 Mar 2024 09:58:56 +0800 Subject: [PATCH 2/8] =?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=E5=A2=9E=E5=8A=A0=E5=BF=85?= =?UTF-8?q?=E5=A1=AB=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingMSKAPIService.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs index dfdd5c1f..d196931b 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs @@ -636,8 +636,14 @@ namespace Myshipping.Application.Service.BookingOrder if(!model.earliestDepartureDate.HasValue) throw Oops.Bah($"预计离港日期必填"); - if (!model.isSendNoSchedule && string.IsNullOrWhiteSpace(model.carrierProductId)) - throw Oops.Bah($"船期信息不能为空,请查询船期信息"); + if(string.IsNullOrWhiteSpace(model.userPlaceOfReceiptUnLocCode)) + throw Oops.Bah($"始发地必填"); + + if (string.IsNullOrWhiteSpace(model.userPlaceOfDeliveryUnLocCode)) + throw Oops.Bah($"目的地必填"); + + //if (!model.isSendNoSchedule && string.IsNullOrWhiteSpace(model.carrierProductId)) + // throw Oops.Bah($"船期信息不能为空,请查询船期信息"); if (model.isReefer) { From 8b5cde70151c424e8f172106a450889cf09fa3bb Mon Sep 17 00:00:00 2001 From: zhangxiaofeng <1939543722@qq.com> Date: Tue, 26 Mar 2024 10:10:43 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E8=88=B1=E5=8D=95=E5=8F=91=E9=80=81?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrderSeaeEdiService.cs | 145 +++++++++--------- 1 file changed, 74 insertions(+), 71 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrderSeaeEdi/BookingOrderSeaeEdiService.cs b/Myshipping.Application/Service/BookingOrderSeaeEdi/BookingOrderSeaeEdiService.cs index 16aab6f2..a6eb9e8d 100644 --- a/Myshipping.Application/Service/BookingOrderSeaeEdi/BookingOrderSeaeEdiService.cs +++ b/Myshipping.Application/Service/BookingOrderSeaeEdi/BookingOrderSeaeEdiService.cs @@ -377,93 +377,96 @@ namespace Myshipping.Application // 舱单主单 var mainSeaOrder = waitCheckSeaList.FirstOrDefault(x => string.IsNullOrWhiteSpace(x.HBLNO)); - // 舱单分单 - var subSeaOrderList = waitCheckSeaList.Where(x => !string.IsNullOrWhiteSpace(x.HBLNO)).ToList(); - - // 校验1:船名航次,唛头,货描 ,起运港,卸货港,主单提单号 - if (bkOrder.MBLNO != mainSeaOrder.MBLNO) checkResult.Add("舱单主单与订舱【提单号】不一致"); - if (bkOrder.VESSEL != mainSeaOrder.VESSEL) checkResult.Add("舱单主单与订舱【船名】不一致"); - if (bkOrder.VOYNO != mainSeaOrder.VOYNO) checkResult.Add("舱单主单与订舱【航次】不一致"); - if (bkOrder.MARKS != mainSeaOrder.MARKS) checkResult.Add("舱单主单与订舱【唛头】不一致"); - if (bkOrder.DESCRIPTION != mainSeaOrder.DESCRIPTION) checkResult.Add("舱单主单与订舱【货描】不一致"); - if (bkOrder.PORTLOADID != mainSeaOrder.PORTLOADID || bkOrder.PORTLOAD != mainSeaOrder.PORTLOAD) checkResult.Add("舱单主单与订舱【起运港】不一致"); - if (bkOrder.PORTDISCHARGEID != mainSeaOrder.PORTDISCHARGEID || bkOrder.PORTDISCHARGE != mainSeaOrder.PORTDISCHARGE) checkResult.Add("舱单主单与订舱【卸货港】不一致"); - subSeaOrderList.ForEach(x => + if (mainSeaOrder != null) { - if (bkOrder.VESSEL != x.VESSEL) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【船名】不一致"); - if (bkOrder.VOYNO != x.VOYNO) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【航次】不一致"); - if (bkOrder.MARKS != x.MARKS) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【唛头】不一致"); - if (bkOrder.DESCRIPTION != x.DESCRIPTION) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【货描】不一致"); - if (bkOrder.PORTLOADID != x.PORTLOADID || bkOrder.PORTLOAD != x.PORTLOAD) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【起运港】不一致"); - if (bkOrder.PORTDISCHARGEID != x.PORTDISCHARGEID || bkOrder.PORTDISCHARGE != x.PORTDISCHARGE) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【卸货港】不一致"); - }); + // 舱单分单 + var subSeaOrderList = waitCheckSeaList.Where(x => !string.IsNullOrWhiteSpace(x.HBLNO)).ToList(); + + // 校验1:船名航次,唛头,货描 ,起运港,卸货港,主单提单号 + if (bkOrder.MBLNO != mainSeaOrder.MBLNO) checkResult.Add("舱单主单与订舱【提单号】不一致"); + if (bkOrder.VESSEL != mainSeaOrder.VESSEL) checkResult.Add("舱单主单与订舱【船名】不一致"); + if (bkOrder.VOYNO != mainSeaOrder.VOYNO) checkResult.Add("舱单主单与订舱【航次】不一致"); + if (bkOrder.MARKS != mainSeaOrder.MARKS) checkResult.Add("舱单主单与订舱【唛头】不一致"); + if (bkOrder.DESCRIPTION != mainSeaOrder.DESCRIPTION) checkResult.Add("舱单主单与订舱【货描】不一致"); + if (bkOrder.PORTLOADID != mainSeaOrder.PORTLOADID || bkOrder.PORTLOAD != mainSeaOrder.PORTLOAD) checkResult.Add("舱单主单与订舱【起运港】不一致"); + if (bkOrder.PORTDISCHARGEID != mainSeaOrder.PORTDISCHARGEID || bkOrder.PORTDISCHARGE != mainSeaOrder.PORTDISCHARGE) checkResult.Add("舱单主单与订舱【卸货港】不一致"); + subSeaOrderList.ForEach(x => + { + if (bkOrder.VESSEL != x.VESSEL) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【船名】不一致"); + if (bkOrder.VOYNO != x.VOYNO) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【航次】不一致"); + if (bkOrder.MARKS != x.MARKS) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【唛头】不一致"); + if (bkOrder.DESCRIPTION != x.DESCRIPTION) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【货描】不一致"); + if (bkOrder.PORTLOADID != x.PORTLOADID || bkOrder.PORTLOAD != x.PORTLOAD) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【起运港】不一致"); + if (bkOrder.PORTDISCHARGEID != x.PORTDISCHARGEID || bkOrder.PORTDISCHARGE != x.PORTDISCHARGE) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【卸货港】不一致"); + }); - // 校验2:件重尺 - var 主单箱子列表 = waitCheckSeaCtnList.Where(x => x.PId == mainSeaOrder.Id).ToList(); - var 分单箱子列表 = waitCheckSeaCtnList.Where(x => x.PId != mainSeaOrder.Id).ToList(); + // 校验2:件重尺 + var 主单箱子列表 = waitCheckSeaCtnList.Where(x => x.PId == mainSeaOrder.Id).ToList(); + var 分单箱子列表 = waitCheckSeaCtnList.Where(x => x.PId != mainSeaOrder.Id).ToList(); - foreach (var item in 主单箱子列表.GroupBy(x => x.CNTRNO)) - { - if (item.Sum(x => x.PKGS) != 订舱箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.PKGS)) + foreach (var item in 主单箱子列表.GroupBy(x => x.CNTRNO)) { - checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单主单中的【件数】与订舱中同箱号箱子的【件数】不一致"); + if (item.Sum(x => x.PKGS) != 订舱箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.PKGS)) + { + checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单主单中的【件数】与订舱中同箱号箱子的【件数】不一致"); + } + if (item.Sum(x => x.KGS) != 订舱箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.KGS)) + { + checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单主单中的【重量】与订舱中同箱号箱子的【重量】不一致"); + } + if (item.Sum(x => x.CBM) != 订舱箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.CBM)) + { + checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单主单中的【尺码】与订舱中同箱号箱子的【尺码】不一致"); + } } - if (item.Sum(x => x.KGS) != 订舱箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.KGS)) - { - checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单主单中的【重量】与订舱中同箱号箱子的【重量】不一致"); - } - if (item.Sum(x => x.CBM) != 订舱箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.CBM)) - { - checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单主单中的【尺码】与订舱中同箱号箱子的【尺码】不一致"); - } - } - foreach (var item in 分单箱子列表.GroupBy(x => x.CNTRNO)) - { - if (item.Sum(x => x.PKGS) > 主单箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.PKGS)) - { - checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单各分单中的【总件数】大于主单中同箱号箱子的件数"); - } - if (item.Sum(x => x.KGS) > 主单箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.KGS)) + foreach (var item in 分单箱子列表.GroupBy(x => x.CNTRNO)) { - checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单各分单中的【总重量】大于主单中同箱号箱子的重量"); + if (item.Sum(x => x.PKGS) > 主单箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.PKGS)) + { + checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单各分单中的【总件数】大于主单中同箱号箱子的件数"); + } + if (item.Sum(x => x.KGS) > 主单箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.KGS)) + { + checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单各分单中的【总重量】大于主单中同箱号箱子的重量"); + } + if (item.Sum(x => x.CBM) > 主单箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.CBM)) + { + checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单各分单中的【总尺码】大于主单中同箱号箱子的尺码"); + } } - if (item.Sum(x => x.CBM) > 主单箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.CBM)) - { - checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单各分单中的【总尺码】大于主单中同箱号箱子的尺码"); - } - } - // 校验3:箱号+封号+箱型 - var 订舱箱封号箱型列表 = 订舱箱子列表.Select(x => $"箱号[{x.CNTRNO}] 封号[{x.SEALNO}] 箱型[{x.CTNALL.Replace("'", "")}]").ToList(); - var 主单箱封号箱型列表 = 主单箱子列表.Select(x => $"箱号[{x.CNTRNO}] 封号[{x.SEALNO}] 箱型[{x.CTNALL.Replace("'", "")}]").ToList(); - var 分单箱封号箱型列表 = 分单箱子列表.Select(x => $"箱号[{x.CNTRNO}] 封号[{x.SEALNO}] 箱型[{x.CTNALL.Replace("'", "")}]").Distinct().ToList(); + // 校验3:箱号+封号+箱型 + var 订舱箱封号箱型列表 = 订舱箱子列表.Select(x => $"箱号[{x.CNTRNO}] 封号[{x.SEALNO}] 箱型[{x.CTNALL.Replace("'", "")}]").ToList(); + var 主单箱封号箱型列表 = 主单箱子列表.Select(x => $"箱号[{x.CNTRNO}] 封号[{x.SEALNO}] 箱型[{x.CTNALL.Replace("'", "")}]").ToList(); + var 分单箱封号箱型列表 = 分单箱子列表.Select(x => $"箱号[{x.CNTRNO}] 封号[{x.SEALNO}] 箱型[{x.CTNALL.Replace("'", "")}]").Distinct().ToList(); - var list1 = 订舱箱封号箱型列表.Except(主单箱封号箱型列表); - if (list1.Any()) - { - checkResult.Add($"订舱中的下列箱信息在舱单主单中不存在:{string.Join(",", list1)}"); - } - else - { - var list2 = 主单箱封号箱型列表.Except(订舱箱封号箱型列表); - if (list2.Any()) + var list1 = 订舱箱封号箱型列表.Except(主单箱封号箱型列表); + if (list1.Any()) { - checkResult.Add($"舱单主单中的下列箱信息在订舱中不存在:{string.Join(",", list2)}"); + checkResult.Add($"订舱中的下列箱信息在舱单主单中不存在:{string.Join(",", list1)}"); } - - var list3 = 分单箱封号箱型列表.Except(主单箱封号箱型列表); - if (list3.Any()) + else { - checkResult.Add($"舱单分单中存在未知的箱信息:{string.Join(",", list3)}"); + var list2 = 主单箱封号箱型列表.Except(订舱箱封号箱型列表); + if (list2.Any()) + { + checkResult.Add($"舱单主单中的下列箱信息在订舱中不存在:{string.Join(",", list2)}"); + } + + var list3 = 分单箱封号箱型列表.Except(主单箱封号箱型列表); + if (list3.Any()) + { + checkResult.Add($"舱单分单中存在未知的箱信息:{string.Join(",", list3)}"); + } } - } - if (checkResult.Count > 0) - { - UnifyContext.Fill(new { checkResult }); - throw new Exception("校验不通过"); + if (checkResult.Count > 0) + { + UnifyContext.Fill(new { checkResult }); + throw new Exception("校验不通过"); + } } } #endregion From 82019b6327a7d1077c7dfd7fe8ca69865b043a7f Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 26 Mar 2024 10:44:48 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A9=AC=E5=A3=AB?= =?UTF-8?q?=E5=9F=BAAPI=E7=9A=84=E4=BF=9D=E5=AD=98=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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs index d196931b..89b123df 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs @@ -1172,6 +1172,7 @@ namespace Myshipping.Application.Service.BookingOrder x.TenantId, x.STUFFING_MEASUREMENT_TYPE, x.STUFFING_MEASUREMENT_UNIT, + x.CTN_SUFFER_WEIGHT }).ExecuteCommand(); } else @@ -1180,7 +1181,8 @@ namespace Myshipping.Application.Service.BookingOrder { CTN_CODE = ctn.ctnCode, CTN_NAME = ctn.ctnName, - CTN_NUM = ctn.ctnNum.Value + CTN_NUM = ctn.ctnNum.Value, + CTN_SUFFER_WEIGHT = (int)ctn.ctnSufferWeight.Value, }; ctnEntity.RECORD_ID = entity.Id; @@ -1237,7 +1239,8 @@ namespace Myshipping.Application.Service.BookingOrder var ctnEntity = new BookingDeliveryRecordCtn { CTN_CODE = ctn.ctnCode, CTN_NAME = ctn.ctnName, - CTN_NUM = ctn.ctnNum.Value + CTN_NUM = ctn.ctnNum.Value, + CTN_SUFFER_WEIGHT = (int)ctn.ctnSufferWeight.Value, }; ctnEntity.RECORD_ID = entity.Id; From 03c11a61ed300850da1ba69a42e5c0d6aeb6507e Mon Sep 17 00:00:00 2001 From: zhangxiaofeng <1939543722@qq.com> Date: Tue, 26 Mar 2024 11:22:40 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E8=88=B1=E5=8D=95=E5=8F=91=E9=80=81?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrderSeaeEdiService.cs | 103 ++++++++++-------- 1 file changed, 59 insertions(+), 44 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrderSeaeEdi/BookingOrderSeaeEdiService.cs b/Myshipping.Application/Service/BookingOrderSeaeEdi/BookingOrderSeaeEdiService.cs index a6eb9e8d..ff0644cd 100644 --- a/Myshipping.Application/Service/BookingOrderSeaeEdi/BookingOrderSeaeEdiService.cs +++ b/Myshipping.Application/Service/BookingOrderSeaeEdi/BookingOrderSeaeEdiService.cs @@ -377,12 +377,20 @@ namespace Myshipping.Application // 舱单主单 var mainSeaOrder = waitCheckSeaList.FirstOrDefault(x => string.IsNullOrWhiteSpace(x.HBLNO)); - if (mainSeaOrder != null) + + // 是否检验舱单主单 + var isCheckMainSea = true; + if (mainSeaOrder == null) { - // 舱单分单 - var subSeaOrderList = waitCheckSeaList.Where(x => !string.IsNullOrWhiteSpace(x.HBLNO)).ToList(); + isCheckMainSea = false; + mainSeaOrder = await _seaeedi.AsQueryable().Filter(null, true).Where(x => x.BookingId == bkOrderId && string.IsNullOrWhiteSpace(x.HBLNO)).FirstAsync(); + } + // 舱单分单 + var subSeaOrderList = waitCheckSeaList.Where(x => !string.IsNullOrWhiteSpace(x.HBLNO)).ToList(); - // 校验1:船名航次,唛头,货描 ,起运港,卸货港,主单提单号 + // 校验1:船名航次,唛头,货描 ,起运港,卸货港,主单提单号 + if (isCheckMainSea) + { if (bkOrder.MBLNO != mainSeaOrder.MBLNO) checkResult.Add("舱单主单与订舱【提单号】不一致"); if (bkOrder.VESSEL != mainSeaOrder.VESSEL) checkResult.Add("舱单主单与订舱【船名】不一致"); if (bkOrder.VOYNO != mainSeaOrder.VOYNO) checkResult.Add("舱单主单与订舱【航次】不一致"); @@ -390,21 +398,25 @@ namespace Myshipping.Application if (bkOrder.DESCRIPTION != mainSeaOrder.DESCRIPTION) checkResult.Add("舱单主单与订舱【货描】不一致"); if (bkOrder.PORTLOADID != mainSeaOrder.PORTLOADID || bkOrder.PORTLOAD != mainSeaOrder.PORTLOAD) checkResult.Add("舱单主单与订舱【起运港】不一致"); if (bkOrder.PORTDISCHARGEID != mainSeaOrder.PORTDISCHARGEID || bkOrder.PORTDISCHARGE != mainSeaOrder.PORTDISCHARGE) checkResult.Add("舱单主单与订舱【卸货港】不一致"); - subSeaOrderList.ForEach(x => - { - if (bkOrder.VESSEL != x.VESSEL) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【船名】不一致"); - if (bkOrder.VOYNO != x.VOYNO) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【航次】不一致"); - if (bkOrder.MARKS != x.MARKS) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【唛头】不一致"); - if (bkOrder.DESCRIPTION != x.DESCRIPTION) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【货描】不一致"); - if (bkOrder.PORTLOADID != x.PORTLOADID || bkOrder.PORTLOAD != x.PORTLOAD) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【起运港】不一致"); - if (bkOrder.PORTDISCHARGEID != x.PORTDISCHARGEID || bkOrder.PORTDISCHARGE != x.PORTDISCHARGE) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【卸货港】不一致"); - }); + } + subSeaOrderList.ForEach(x => + { + if (bkOrder.VESSEL != x.VESSEL) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【船名】不一致"); + if (bkOrder.VOYNO != x.VOYNO) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【航次】不一致"); + if (bkOrder.MARKS != x.MARKS) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【唛头】不一致"); + if (bkOrder.DESCRIPTION != x.DESCRIPTION) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【货描】不一致"); + if (bkOrder.PORTLOADID != x.PORTLOADID || bkOrder.PORTLOAD != x.PORTLOAD) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【起运港】不一致"); + if (bkOrder.PORTDISCHARGEID != x.PORTDISCHARGEID || bkOrder.PORTDISCHARGE != x.PORTDISCHARGE) checkResult.Add($"舱单分单【{x.HBLNO}】与订舱【卸货港】不一致"); + }); - // 校验2:件重尺 - var 主单箱子列表 = waitCheckSeaCtnList.Where(x => x.PId == mainSeaOrder.Id).ToList(); - var 分单箱子列表 = waitCheckSeaCtnList.Where(x => x.PId != mainSeaOrder.Id).ToList(); + // 校验2:件重尺 + var 主单箱子列表 = waitCheckSeaCtnList.Where(x => x.PId == mainSeaOrder.Id).ToList(); + var 分单箱子列表 = waitCheckSeaCtnList.Where(x => x.PId != mainSeaOrder.Id).ToList(); + + if (isCheckMainSea) + { foreach (var item in 主单箱子列表.GroupBy(x => x.CNTRNO)) { if (item.Sum(x => x.PKGS) != 订舱箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.PKGS)) @@ -420,28 +432,31 @@ namespace Myshipping.Application checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单主单中的【尺码】与订舱中同箱号箱子的【尺码】不一致"); } } + } - foreach (var item in 分单箱子列表.GroupBy(x => x.CNTRNO)) + foreach (var item in 分单箱子列表.GroupBy(x => x.CNTRNO)) + { + if (item.Sum(x => x.PKGS) > 订舱箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.PKGS)) { - if (item.Sum(x => x.PKGS) > 主单箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.PKGS)) - { - checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单各分单中的【总件数】大于主单中同箱号箱子的件数"); - } - if (item.Sum(x => x.KGS) > 主单箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.KGS)) - { - checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单各分单中的【总重量】大于主单中同箱号箱子的重量"); - } - if (item.Sum(x => x.CBM) > 主单箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.CBM)) - { - checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单各分单中的【总尺码】大于主单中同箱号箱子的尺码"); - } + checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单各分单中的【总件数】大于订舱中同箱号箱子的件数"); } + if (item.Sum(x => x.KGS) > 订舱箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.KGS)) + { + checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单各分单中的【总重量】大于订舱中同箱号箱子的重量"); + } + if (item.Sum(x => x.CBM) > 订舱箱子列表.Where(x => x.CNTRNO == item.Key).Sum(x => x.CBM)) + { + checkResult.Add($"箱号为【{item.Key}】的箱子,在舱单各分单中的【总尺码】大于订舱中同箱号箱子的尺码"); + } + } - // 校验3:箱号+封号+箱型 - var 订舱箱封号箱型列表 = 订舱箱子列表.Select(x => $"箱号[{x.CNTRNO}] 封号[{x.SEALNO}] 箱型[{x.CTNALL.Replace("'", "")}]").ToList(); - var 主单箱封号箱型列表 = 主单箱子列表.Select(x => $"箱号[{x.CNTRNO}] 封号[{x.SEALNO}] 箱型[{x.CTNALL.Replace("'", "")}]").ToList(); - var 分单箱封号箱型列表 = 分单箱子列表.Select(x => $"箱号[{x.CNTRNO}] 封号[{x.SEALNO}] 箱型[{x.CTNALL.Replace("'", "")}]").Distinct().ToList(); + // 校验3:箱号+封号+箱型 + var 订舱箱封号箱型列表 = 订舱箱子列表.Select(x => $"箱号[{x.CNTRNO}] 封号[{x.SEALNO}] 箱型[{x.CTNALL.Replace("'", "")}]").ToList(); + var 主单箱封号箱型列表 = 主单箱子列表.Select(x => $"箱号[{x.CNTRNO}] 封号[{x.SEALNO}] 箱型[{x.CTNALL.Replace("'", "")}]").ToList(); + var 分单箱封号箱型列表 = 分单箱子列表.Select(x => $"箱号[{x.CNTRNO}] 封号[{x.SEALNO}] 箱型[{x.CTNALL.Replace("'", "")}]").Distinct().ToList(); + if (isCheckMainSea) + { var list1 = 订舱箱封号箱型列表.Except(主单箱封号箱型列表); if (list1.Any()) { @@ -454,19 +469,19 @@ namespace Myshipping.Application { checkResult.Add($"舱单主单中的下列箱信息在订舱中不存在:{string.Join(",", list2)}"); } - - var list3 = 分单箱封号箱型列表.Except(主单箱封号箱型列表); - if (list3.Any()) - { - checkResult.Add($"舱单分单中存在未知的箱信息:{string.Join(",", list3)}"); - } } + } + var list3 = 分单箱封号箱型列表.Except(订舱箱封号箱型列表); + if (list3.Any()) + { + checkResult.Add($"舱单分单中存在未知的箱信息:{string.Join(",", list3)}"); + } - if (checkResult.Count > 0) - { - UnifyContext.Fill(new { checkResult }); - throw new Exception("校验不通过"); - } + + if (checkResult.Count > 0) + { + UnifyContext.Fill(new { checkResult }); + throw new Exception("校验不通过"); } } #endregion From d3d5250329b359549224019beceae14cda39613c Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 26 Mar 2024 11:55:55 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A9=AC=E5=A3=AB?= =?UTF-8?q?=E5=9F=BAAPI=E5=8F=B0=E8=B4=A6=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingMSKAPIService.cs | 2 ++ .../Service/BookingOrder/Dto/BookingDeliveryRecordPageDto.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs index 89b123df..ce4c5f9b 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs @@ -33,6 +33,7 @@ namespace Myshipping.Application.Service.BookingOrder private readonly ISysCacheService _cache; private readonly IDjyWebsiteAccountConfigService _webAccountConfig; private readonly ILogger _logger; + private readonly ISysDataUserMenu _sysDataUserMenuService; const string CONST_MSK_API_COMMODITY_URL = "MSKApiCommodity"; const string CONST_MSK_API_BOOKING_URL = "MSKApiBooking"; @@ -41,6 +42,7 @@ namespace Myshipping.Application.Service.BookingOrder public BookingMSKAPIService(ILogger logger, ISysCacheService cache, IDjyWebsiteAccountConfigService webAccountConfig, SqlSugarRepository bookingDeliveryRecordRep, + ISysDataUserMenu sysDataUserMenuService, SqlSugarRepository bookingDeliveryRecordCtnRep) { _logger = logger; diff --git a/Myshipping.Application/Service/BookingOrder/Dto/BookingDeliveryRecordPageDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/BookingDeliveryRecordPageDto.cs index a47f389e..74417e0f 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/BookingDeliveryRecordPageDto.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/BookingDeliveryRecordPageDto.cs @@ -433,7 +433,7 @@ namespace Myshipping.Application /// /// 最后BC接收时间 /// - public bool LstRecvBCDate { get; set; } + public Nullable LstRecvBCDate { get; set; } /// /// 是否已有BookingCancellation @@ -443,7 +443,7 @@ namespace Myshipping.Application /// /// 最后BookingCancellation接收时间 /// - public bool LstRecvBKCancelDate { get; set; } + public Nullable LstRecvBKCancelDate { get; set; } /// /// 预计航行天数 From 9542b850ba75115b12e991029a1c388e1493d31e Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 26 Mar 2024 12:04:16 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A9=AC=E5=A3=AB?= =?UTF-8?q?=E5=9F=BAAPI=E5=8F=B0=E8=B4=A6=E5=A2=9E=E5=8A=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingMSKAPIService.cs | 7 ++++--- Myshipping.Core/Const/MenuConst.cs | 5 +++++ Myshipping.Core/Myshipping.Core.xml | 5 +++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs index ce4c5f9b..ebdcbbfe 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs @@ -986,9 +986,9 @@ namespace Myshipping.Application.Service.BookingOrder //这里因为返回给前端的台账数据是DTO,所以这里排序时候需要转换成Entity对应的字段 if (!string.IsNullOrWhiteSpace(QuerySearch.SortField)) entityOrderCol = MapsterExtHelper.GetAdaptProperty(QuerySearch.SortField); - /* + //菜单375504048771141=我的任务台账 - List userlist = await _sysDataUserMenuService.GetDataScopeList(MenuConst.MenuTaskManage); + List userlist = await _sysDataUserMenuService.GetDataScopeList(MenuConst.MenuMSKApi); if (userlist == null) userlist = new List { UserManager.UserId }; @@ -997,9 +997,10 @@ namespace Myshipping.Application.Service.BookingOrder userlist = userlist.Distinct().ToList(); _logger.LogInformation("任务台账权限范围 {list}", userlist); - */ + var entities = await _bookingDeliveryRecordRep.AsQueryable() + .Where(t => userlist.Contains(t.CreatedUserId.Value)) .WhereIF(createBegin != DateTime.MinValue, t => t.CreatedTime.HasValue && t.CreatedTime.Value >= createBegin) .WhereIF(createEnd != DateTime.MinValue, t => t.CreatedTime.HasValue && t.CreatedTime.Value < createEnd) .WhereIF(updateBegin != DateTime.MinValue, t => t.UpdatedTime.HasValue && t.UpdatedTime.Value >= updateBegin) diff --git a/Myshipping.Core/Const/MenuConst.cs b/Myshipping.Core/Const/MenuConst.cs index 145a136c..5d3b5735 100644 --- a/Myshipping.Core/Const/MenuConst.cs +++ b/Myshipping.Core/Const/MenuConst.cs @@ -16,5 +16,10 @@ namespace Myshipping.Core.Const /// 我的任务台账 /// public const long MenuTaskManage = 375504048771141; + + /// + /// 马士基API订舱 + /// + public const long MenuMSKApi = 526643045195845; } } diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index c7412b4f..e7eb3e4d 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -842,6 +842,11 @@ 我的任务台账 + + + 马士基API订舱 + + 租户参数Code常量 From bea8eb0c76c68f868956d4ba78a459493d4c85fd Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 26 Mar 2024 12:09:36 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=B0=E8=B4=A6?= 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 ebdcbbfe..964ea006 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs @@ -50,7 +50,7 @@ namespace Myshipping.Application.Service.BookingOrder _webAccountConfig = webAccountConfig; _bookingDeliveryRecordRep = bookingDeliveryRecordRep; _bookingDeliveryRecordCtnRep = bookingDeliveryRecordCtnRep; - + _sysDataUserMenuService = sysDataUserMenuService; } #region 检索海运船期详情