From 049043bff6c2cccd5c4579b5920f2e2fd90c77c4 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 22 May 2024 09:56:31 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E7=94=A9?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskManagePlat/TaskManageRollingNominationService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs index de60a40a..da1fafbc 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs @@ -1278,7 +1278,7 @@ namespace Myshipping.Application model.LoadDetailList = list.Select(a => a.Adapt()).ToList(); - if (model.From != null && model.From.Count > 0) + if (model.From != null && model.From.Count > 1) { var firstLoadDetail = model.LoadDetailList.FirstOrDefault(); From 5b77d7937d35d14a03a3fe734ff3238e079a8947 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 22 May 2024 11:04:36 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E7=94=A9?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ITaskManageRollingNominationService.cs | 4 ++-- .../TaskManageRollingNominationService.cs | 17 ++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageRollingNominationService.cs b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageRollingNominationService.cs index 4874ca84..ded0caf3 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageRollingNominationService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageRollingNominationService.cs @@ -42,9 +42,9 @@ namespace Myshipping.Application /// /// 刷新预甩货对应订舱 /// - /// 预甩货主键 + /// 预甩货主任务主键 /// 返回回执 - Task RefreshBookingOrder(string nominationId); + Task RefreshBookingOrder(string taskPkId); /// /// 查看分享链接 diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs index da1fafbc..fcc70f5f 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs @@ -602,10 +602,10 @@ namespace Myshipping.Application /// /// 刷新预甩货对应订舱 /// - /// 预甩货主键 + /// 预甩货主键 /// 返回回执 [HttpGet("/TaskManageRollingNomination/RefreshBookingOrder")] - public async Task RefreshBookingOrder(string nominationId) + public async Task RefreshBookingOrder(string taskPkId) { TaskManageOrderResultDto result = new TaskManageOrderResultDto(); @@ -616,17 +616,17 @@ namespace Myshipping.Application */ var list = _taskRollingNominationInfoRepository.AsQueryable().Filter(null, true) .InnerJoin((nom, detail) => nom.PK_ID == detail.NOM_ID) - .Where((nom, detail) => nom.PK_ID == nominationId + .Where((nom, detail) => nom.TASK_ID == taskPkId && detail.IsDeleted == false && !detail.BOOKING_ID.HasValue) .Select((nom, detail) => detail).ToList(); if (list.Count > 0) { - var mblNoArg = list.Select(a=>a.SHIPMENT).Distinct().ToList(); + var mblNoArg = list.Select(a => a.SHIPMENT?.Trim()).Distinct().ToList(); var orderList = _bookingOrderRepository.AsQueryable() - .Where(a => mblNoArg.Contains(a.MBLNO) && !a.ParentId.HasValue && a.IsDeleted == false).ToList(); + .Where(a => mblNoArg.Contains(a.MBLNO) && (a.ParentId == null || a.ParentId == 0) && a.IsDeleted == false).ToList(); DateTime nowDate = DateTime.Now; @@ -659,6 +659,9 @@ namespace Myshipping.Application } } + + result.succ = true; + result.msg = "对应订舱完成"; } catch (Exception ex) { @@ -1566,7 +1569,7 @@ namespace Myshipping.Application //原船 if (!string.IsNullOrWhiteSpace(fromShipInfo.VESSEL) && !string.IsNullOrWhiteSpace(fromShipInfo.VOYNO)) { - baseHtml = baseHtml.Replace("#VesselVoyno#", $"{fromShipInfo.VESSEL} / {fromShipInfo.VOYNO}"); + baseHtml = baseHtml.Replace("#VesselVoyno#", $"{fromShipInfo.VESSEL}/{fromShipInfo.VOYNO}"); } else { @@ -1585,7 +1588,7 @@ namespace Myshipping.Application //换船 if (!string.IsNullOrWhiteSpace(toShipInfo.VESSEL) && !string.IsNullOrWhiteSpace(toShipInfo.VOYNO)) { - baseHtml = baseHtml.Replace("#newVesselVoyno#", $"{toShipInfo.VESSEL} / {toShipInfo.VOYNO}"); + baseHtml = baseHtml.Replace("#newVesselVoyno#", $"{toShipInfo.VESSEL}/{toShipInfo.VOYNO}"); } else { From 57589e668f1a7f6a457aa342d0235849db9d367e Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 22 May 2024 12:50:26 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E7=8A=B6=E6=80=81=20=E6=96=B0=E5=A2=9E=E8=AE=A2=E8=88=B1?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Event/CautionNoticeTaskSubscriber.cs | 5 ++ .../BookingOrder/BookingOrderService.cs | 63 +++++++++++++++++++ .../Service/BookingOrder/Dto/BatchUpdate.cs | 5 ++ .../BookingOrder/IBookingOrderService.cs | 7 ++- .../CautionNoitce/CautionNoticeTaskDto.cs | 2 + .../ServiceWorkFlowManageService.cs | 5 +- 6 files changed, 84 insertions(+), 3 deletions(-) diff --git a/Myshipping.Application/Event/CautionNoticeTaskSubscriber.cs b/Myshipping.Application/Event/CautionNoticeTaskSubscriber.cs index 9fa4cd04..58eda83e 100644 --- a/Myshipping.Application/Event/CautionNoticeTaskSubscriber.cs +++ b/Myshipping.Application/Event/CautionNoticeTaskSubscriber.cs @@ -135,6 +135,11 @@ namespace Myshipping.Application.Event messageInfo.Main.TaskTitle = $"重要提醒-计费周发生变更 {vesselVoyno} {etd} BLNo:{mblNo}"; messageInfo.Main.TaskDesp = $"重要提醒-计费周发生变更 {vesselVoyno} {etd} BLNo:{mblNo}"; + messageInfo.Main.CautionNoticeInfo = new TaskManageOrderCautionNoticeInfo + { + + }; + var rlt = await service.CreateTaskJob(messageInfo); } } diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index ce016f51..0cb64577 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -12758,5 +12758,68 @@ namespace Myshipping.Application } #endregion + #region 批量更新订舱的详情 + /// + /// 批量更新订舱的详情 + /// + /// 请求参数 + /// + [HttpPost("/BookingOrder/BatchUpdateOrder")] + public async Task BatchUpdateOrder(BatchUpdate dto) + { + if (dto == null) + { + throw Oops.Bah("请求参数不能为空"); + } + + if(dto.Id.Count == 0) + throw Oops.Bah("未选中需要更新的订舱数据,请重新选择"); + + string version = Guid.NewGuid().ToString(); + + // 记录日志 + var oldOrderList = await _rep.AsQueryable().Filter(null, true).Where(x => dto.Id.Contains(x.Id) && x.IsDeleted == false).ToListAsync(); + + if(dto.Id.Count != oldOrderList.Count) + throw Oops.Bah("订舱数据获取失败,部分订舱数据未获取到,订舱数据为空或已作废"); + + //oldOrderList.ForEach() + + foreach (var oldOrder in oldOrderList) + { + var newOrder = oldOrder.Adapt(); + + newOrder.VERSION = version; + newOrder.VESSEL = dto.VESSEL; + newOrder.VOYNOINNER = dto.VOYNOINNER; + newOrder.ETD = dto.ETD; + newOrder.VOYNO = dto.VOYNO; + newOrder.PORTDISCHARGEID = dto.PORTDISCHARGEID; + newOrder.PORTDISCHARGE = dto.PORTDISCHARGE; + newOrder.DESTINATIONID = dto.DESTINATIONID; + newOrder.DESTINATION = dto.DESTINATION; + newOrder.CLOSINGDATE = dto.CLOSINGDATE; + newOrder.CLOSEDOCDATE = dto.CLOSEDOCDATE; + + await SaveLog(newOrder, oldOrder, "批量编辑台账"); + } + + await _rep.UpdateAsync(x => dto.Id.Contains(x.Id), x => new BookingOrder + { + VERSION = version, + VESSEL = dto.VESSEL, + VOYNOINNER = dto.VOYNOINNER, + ETD = dto.ETD, + VOYNO = dto.VOYNO, + PORTDISCHARGEID = dto.PORTDISCHARGEID, + PORTDISCHARGE = dto.PORTDISCHARGE, + DESTINATIONID = dto.DESTINATIONID, + DESTINATION = dto.DESTINATION, + CLOSINGDATE = dto.CLOSINGDATE, + CLOSEDOCDATE = dto.CLOSEDOCDATE + }); + await SendBookingOrder(dto.Id.ToArray()); + } + #endregion } } diff --git a/Myshipping.Application/Service/BookingOrder/Dto/BatchUpdate.cs b/Myshipping.Application/Service/BookingOrder/Dto/BatchUpdate.cs index a92721b4..34696930 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/BatchUpdate.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/BatchUpdate.cs @@ -62,6 +62,11 @@ namespace Myshipping.Application.Service.BookingOrder.Dto /// 截单日期 /// public DateTime? CLOSEDOCDATE { get; set; } + + /// + /// 强制更新字段列表(默认只更新有值的字段,如果需要强制更新为空请将字段填写到此列表) + /// + public List enforceUpdateField { get; set; } } /// diff --git a/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs index 54879701..34658a64 100644 --- a/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs @@ -149,6 +149,11 @@ namespace Myshipping.Application /// 返回回执 Task Save(SaveBookingOrderInput input); - + /// + /// 批量更新订舱的详情 + /// + /// 请求参数 + /// + Task BatchUpdateOrder(BatchUpdate dto); } } \ No newline at end of file diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/CautionNoitce/CautionNoticeTaskDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/CautionNoitce/CautionNoticeTaskDto.cs index 475fd8d1..8ffd2895 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/CautionNoitce/CautionNoticeTaskDto.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/CautionNoitce/CautionNoticeTaskDto.cs @@ -57,5 +57,7 @@ namespace Myshipping.Application /// 用户名称 /// public string userName { get; set; } + + } } diff --git a/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs b/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs index 6a37b5c7..a9bb597c 100644 --- a/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs +++ b/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs @@ -1604,7 +1604,8 @@ namespace Myshipping.Application if (b.StatusSKUCode.Equals(st.StatusCode, StringComparison.OrdinalIgnoreCase)) return true; - if (b.SubStatusList != null && b.SubStatusList.Any(c => c.StatusSKUCode.Equals(st.StatusCode, StringComparison.OrdinalIgnoreCase))) + if (b.SubStatusList != null && b.SubStatusList.Any(c => !string.IsNullOrWhiteSpace(c.StatusSKUCode) + && c.StatusSKUCode.Equals(st.StatusCode, StringComparison.OrdinalIgnoreCase))) return true; return false; @@ -1617,7 +1618,7 @@ namespace Myshipping.Application => a.Main.SERVICE_WF_ID == rt.WFPKId).ToList(); if(runList.Any(b - =>b.Detail.STATUS_SKU_CODE.Equals(st.StatusCode,StringComparison.OrdinalIgnoreCase))) + => b.Detail != null && !string.IsNullOrWhiteSpace(b.Detail.STATUS_SKU_CODE) && b.Detail.STATUS_SKU_CODE.Equals(st.StatusCode,StringComparison.OrdinalIgnoreCase))) { var detail = runList.FirstOrDefault(b => b.Detail.STATUS_SKU_CODE.Equals(st.StatusCode, StringComparison.OrdinalIgnoreCase)); From 3c11cce4268dd76a74ec70287113d7d14183947e Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 22 May 2024 14:26:10 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9INTTRA=E8=AE=A2=E8=88=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Application/EDI/InttraEdiHelper.cs | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/Myshipping.Application/EDI/InttraEdiHelper.cs b/Myshipping.Application/EDI/InttraEdiHelper.cs index ed7fded6..4ebfb312 100644 --- a/Myshipping.Application/EDI/InttraEdiHelper.cs +++ b/Myshipping.Application/EDI/InttraEdiHelper.cs @@ -827,6 +827,9 @@ namespace Myshipping.Application.EDI r.WriteLine("TSR+30+2'"); } + //2024-05-22 少了一行计数追加上 JHQ + //icount = icount + 1; + var str_pay = ""; if (bill.BLFRT.IndexOf("PREPAID") >= 0) str_pay = bill.PREPARDAT; @@ -869,9 +872,9 @@ namespace Myshipping.Application.EDI } /*件重尺*/ - r.WriteLine("CNT+7:" + Math.Round(bill.KGS,3) + ":KGM'");//按照四舍五入的国际标准 + r.WriteLine("CNT+7:" + Math.Round(bill.KGS, 3) + ":KGM'");//按照四舍五入的国际标准 r.WriteLine("CNT+11:" + bill.PKGS.ToString() + "'"); - r.WriteLine("CNT+15:" + Math.Round(bill.CBM,3) + ":MTQ'"); + r.WriteLine("CNT+15:" + Math.Round(bill.CBM, 3) + ":MTQ'"); icount = icount + 3; @@ -906,23 +909,31 @@ namespace Myshipping.Application.EDI } - if (InttrEdi.UseForWarderCode) + if (bill.CARRIEREDICODE == "ANNU" || bill.CARRIEREDICODE == "CMDU" || bill.CARRIEREDICODE == "CHNL") { r.WriteLine("RFF+FF:" + bill.ORDERNO.Trim() + "'"); - r.WriteLine("RFF+ON:" + bill.ORDERNO.Trim() + "'"); - icount = icount + 2; + icount = icount + 1; } else { - if (bill.ORDERNO.Trim() != "") + if (InttrEdi.UseForWarderCode) { r.WriteLine("RFF+FF:" + bill.ORDERNO.Trim() + "'"); r.WriteLine("RFF+ON:" + bill.ORDERNO.Trim() + "'"); icount = icount + 2; } + else + { + if (bill.ORDERNO.Trim() != "") + { + r.WriteLine("RFF+FF:" + bill.ORDERNO.Trim() + "'"); + r.WriteLine("RFF+ON:" + bill.ORDERNO.Trim() + "'"); + icount = icount + 2; + } + } } - if (bill.CARRIEREDICODE != "COSU") + if (bill.CARRIEREDICODE != "COSU" && !string.IsNullOrWhiteSpace(bill.MBLNO)) { if (bill.CARRIEREDICODE == "HLCU") { @@ -936,6 +947,7 @@ namespace Myshipping.Application.EDI } icount = icount + 2; } + r.WriteLine("RFF+CT:" + bill.CONTRACTNO + "'"); if (bill.BLFRT.IndexOf("PREPAID") >= 0) From 2fec2937544d4f14fb6f45187d3ceb467930f864 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 22 May 2024 14:49:03 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9INTTRA=20=E8=AE=A2?= =?UTF-8?q?=E8=88=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Application/EDI/InttraEdiHelper.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Myshipping.Application/EDI/InttraEdiHelper.cs b/Myshipping.Application/EDI/InttraEdiHelper.cs index 4ebfb312..88003c0f 100644 --- a/Myshipping.Application/EDI/InttraEdiHelper.cs +++ b/Myshipping.Application/EDI/InttraEdiHelper.cs @@ -1268,6 +1268,7 @@ namespace Myshipping.Application.EDI else r.WriteLine("NAD+FW+++" + formatEdiStr("txt", bill.WEITUO) + "'"); + icount = icount + 1; } else { @@ -1275,7 +1276,7 @@ namespace Myshipping.Application.EDI if (InttrEdi.UseForWarderCode) { r.WriteLine("NAD+FW+" + InttrEdi.ForWarderCode + ":160:86++" + InttrEdi.ForWarderName + "'"); - icount++; + icount = icount + 1; } else { @@ -1283,6 +1284,8 @@ namespace Myshipping.Application.EDI r.WriteLine("NAD+FW+" + InttrEdi.SENDCODE + ":160:86++" + InttrEdi.SENDNAME.Substring(0, 35) + "+" + InttrEdi.SENDNAME.Substring(35) + "'"); else r.WriteLine("NAD+FW+" + InttrEdi.SENDCODE + ":160:86++" + InttrEdi.SENDNAME + "'"); + + icount = icount + 1; } }