diff --git a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs index 7061ee79..48ef14d0 100644 --- a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs @@ -1169,6 +1169,8 @@ namespace Myshipping.Application var result = response.Content.ReadAsStringAsync().Result; model = JSON.Deserialize(result); + + _logger.LogInformation($"推送BC比返回结果:{JSON.Serialize(model)}"); } } catch (Exception ex) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs index c95b21a0..2bebe9de 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs @@ -1683,7 +1683,18 @@ namespace Myshipping.Application if (bookingOrderEntity == null) { - throw Oops.Oh($"订舱详情获取失败,请确认订舱是否存在或已删除"); + var checkInfo =_bookingOrderRepository.AsQueryable().Filter(null, true) + .First(a => a.MBLNO == taskBCInfo.MBL_NO && a.IsDeleted == false && (a.ParentId == null || a.ParentId == 0)); + + if(checkInfo != null) + { + throw Oops.Oh($"订舱详情获取失败,用提单号能检索到,但是没有ID关系,需要人工看看问题"); + } + else + { + throw Oops.Oh($"订舱详情获取失败,请确认订舱是否存在或已删除"); + } + } _logger.LogInformation($"获取订舱详情完成,bookid={bookingOrderEntity.Id}"); @@ -2567,6 +2578,72 @@ namespace Myshipping.Application } } + if (bcOrder.BOOKING_ORDER_ID != null && bcOrder.BOOKING_ORDER_ID.HasValue && bcOrder.BOOKING_ORDER_ID.Value > 0) + { + SaveBookingOrderInput bkModel = new SaveBookingOrderInput + { + MBLNO = bcOrder.MBL_NO.ToUpper().Trim(), + CONTRACTNO = !string.IsNullOrWhiteSpace(bcOrder.CONTRACTNO) ? bcOrder.CONTRACTNO : "", + VESSEL = bcOrder.VESSEL.ToUpper().Trim(), + VOYNO = bcOrder.VOYNO.ToUpper().Trim(), + VOYNOINNER = bcOrder.VOYNO.ToUpper().Trim(), + ETD = bcOrder.ETD, + ETA = bcOrder.ETA, + CLOSEVGMDATE = bcOrder.VGM_CUTOFF_TIME, + CLOSINGDATE = bcOrder.CY_CUTOFF_TIME, + CLOSEDOCDATE = bcOrder.CUT_SINGLE_TIME, + + ctnInputs = new List() + }; + + bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.CONTRACTNO)); + bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.VESSEL)); + bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.VOYNO)); + bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.VOYNOINNER)); + bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.ETD)); + bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.ETA)); + bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.CLOSEVGMDATE)); + bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.CLOSINGDATE)); + bkModel.ChangedFields.Add(nameof(SaveBookingOrderInput.CLOSEDOCDATE)); + + var taskBCCtnList = _taskBCCTNInfoRepository.AsQueryable().Filter(null, true).Where(a => a.P_ID == bcOrder.PK_ID && a.TenantId == tenantId).ToList(); + + var ctnCodeList = _cache.GetAllCodeCtn().GetAwaiter().GetResult().ToList(); + + if (taskBCCtnList.Count > 0) + { + taskBCCtnList.ForEach(t => + { + var ctnCode = ctnCodeList.FirstOrDefault(a => !string.IsNullOrWhiteSpace(a.Name) && + a.Name.Equals(t.CTNALL, StringComparison.OrdinalIgnoreCase)); + + BookingCtnDto ctn = new BookingCtnDto + { + CTNCODE = ctnCode?.Code, + CTNALL = t.CTNALL, + CTNNUM = t.CTNNUM.HasValue ? t.CTNNUM.Value : 1 + }; + + bkModel.ctnInputs.Add(ctn); + }); + } + + var bkRlt = await _bookingOrderService.Save(bkModel); + + if (bkRlt.Id != null && bkRlt.Id > 0) + { + _logger.LogInformation($"taskPKId={taskPKId} 更新订舱详情完成"); + } + else + { + _logger.LogInformation($"taskPKId={taskPKId} 更新订舱详情失败没有对应舱位ID"); + } + } + else + { + _logger.LogInformation($"taskPKId={taskPKId} 更新订舱详情失败没有对应舱位ID"); + } + DjyTenantParamValueOutput paramConfig = null; DjyTenantParamValueOutput dingdingConfig = null; diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageDRAFTService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageDRAFTService.cs index 3032264b..589bb19f 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageDRAFTService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageDRAFTService.cs @@ -257,7 +257,17 @@ namespace Myshipping.Application if (bookingOrderEntity == null) { - throw Oops.Oh($"订舱详情获取失败,请确认订舱是否存在或已删除"); + var checkInfo = _bookingOrderRepository.AsQueryable().Filter(null, true) + .First(a => a.MBLNO == taskDraftInfo.MBL_NO && a.IsDeleted == false && (a.ParentId == null || a.ParentId == 0)); + + if (checkInfo != null) + { + throw Oops.Oh($"订舱详情获取失败,用提单号能检索到,但是没有ID关系,需要人工看看问题"); + } + else + { + throw Oops.Oh($"订舱详情获取失败,请确认订舱是否存在或已删除"); + } } _logger.LogInformation($"获取订舱详情完成,bookid={bookingOrderEntity.Id}");