From 3cd243dc91a10375c40aba713ab6b46690619251 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 23 May 2023 15:37:45 +0800 Subject: [PATCH 1/7] 1 --- .../Service/BookingOrder/BookingOrderService.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index a86b4d45..8a78c244 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -2704,7 +2704,7 @@ namespace Myshipping.Application } } - if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_PKGS"&& _name== "_PKGS") + if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_pkgs" && _name== "pkgs") { ICell cell = row.GetCell(_cellNum - 1); @@ -2718,7 +2718,7 @@ namespace Myshipping.Application } } - if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_KGS"&& _name == "_KGS") + if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_kgs" && _name == "kgs") { ICell cell = row.GetCell(_cellNum - 1); if (cell != null) @@ -2733,7 +2733,7 @@ namespace Myshipping.Application } - if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_CBM" && _name == "_CBM") + if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_cbm" && _name == "cbm") { ICell cell = row.GetCell(_cellNum - 1); if (cell != null) @@ -2840,6 +2840,7 @@ namespace Myshipping.Application } srow.CreateCell(_cellNum - 1).SetCellValue(value); } + } } if (name.Split('.')[0].ToLower() == "edi") From 3aab632e7ed145e85c4472cdd50336f575665596 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 23 May 2023 16:48:03 +0800 Subject: [PATCH 2/7] 1 --- .../Service/BookingOrder/BookingOrderService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 8a78c244..48be300a 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -579,6 +579,7 @@ namespace Myshipping.Application it.TenantName, it.IsDeleted, it.BOOKINGNO, + it.BSSTATUSNAME, it.YgtETD, it.LstShipOrderCompareId, it.LstShipOrderCompareDate, From 296058b9c6ce3dbb837377a7aeba0f2910028aec Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 23 May 2023 16:54:26 +0800 Subject: [PATCH 3/7] 1 --- .../BookingOrder/BookingOrderService.cs | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 48be300a..7d002542 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -1618,20 +1618,21 @@ namespace Myshipping.Application } - return t; - } - List tslist = new List(); - tslist.Add((long)input.BookingId); - var itemcode = _cache.GetAllTenantParam().Result.Where(x => x.ParaCode == "BOOKING_DATA_PUSH" && x.TenantId == UserManager.TENANT_ID).Select(x => x.ItemCode).FirstOrDefault(); - if (!string.IsNullOrEmpty(itemcode)) - { - if (itemcode == "true") - await SendBookingOrder(tslist.ToArray()); - _logger.LogInformation(input.BookingId + "货物状态推送成功!"); + + + List tslist = new List(); + tslist.Add((long)input.BookingId); + var itemcode = _cache.GetAllTenantParam().Result.Where(x => x.ParaCode == "BOOKING_DATA_PUSH" && x.TenantId == UserManager.TENANT_ID).Select(x => x.ItemCode).FirstOrDefault(); + if (!string.IsNullOrEmpty(itemcode)) + { + if (itemcode == "true") + await SendBookingOrder(tslist.ToArray()); + _logger.LogInformation(input.BookingId + "货物状态推送成功!"); + } + return t; } return null; - } @@ -2705,7 +2706,7 @@ namespace Myshipping.Application } } - if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_pkgs" && _name== "pkgs") + if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_pkgs" && _name == "pkgs") { ICell cell = row.GetCell(_cellNum - 1); @@ -4292,7 +4293,7 @@ namespace Myshipping.Application //这里除了TSL,订舱编号默认都对应到业务编号(订舱保存时自动生成) if (ediRouteEnum == EDIRouteEnum.TSL) { - if(string.IsNullOrWhiteSpace(order.CUSTNO)) + if (string.IsNullOrWhiteSpace(order.CUSTNO)) throw Oops.Bah($"船公司是{order.CARRIERID} 订舱编号不能为空"); primaryModel.ORDERNO = order.CUSTNO; @@ -4301,7 +4302,7 @@ namespace Myshipping.Application { primaryModel.ORDERNO = order.BOOKINGNO; } - + var curBasePkgs = basePkgsList.FirstOrDefault(p => p.Name.Equals(order.KINDPKGS, StringComparison.OrdinalIgnoreCase)); From 2fad550ade86f579774b062945a8ed6150e80d26 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 23 May 2023 17:47:55 +0800 Subject: [PATCH 4/7] 1 --- .../BookingOrder/BookingOrderService.cs | 54 ++++++++++++++++--- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 7d002542..f7c9cd3a 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -1601,7 +1601,7 @@ namespace Myshipping.Application var t = list.Union(config).OrderBy(x => x.Sort).DistinctBy(x => x.StatusName).ToList(); if (t != null) { - var StatusName = t.OrderByDescending(x => x.FinishTime).Select(x => x.StatusName).First(); + var StatusName = t.Where(x=>x.FinishTime!=null).OrderByDescending(x => x.FinishTime).Select(x => x.StatusName).First(); order.BSSTATUSNAME = StatusName; await _rep.AsUpdateable(order).IgnoreColumns(it => new @@ -1618,6 +1618,7 @@ namespace Myshipping.Application } + @@ -2708,28 +2709,54 @@ namespace Myshipping.Application if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_pkgs" && _name == "pkgs") { + var value = string.Empty; + if (order.PKGS!=null) { + if (Convert.ToInt32(order.PKGS.ToString().Split('.')[1]) == 0) { + value = order.PKGS.ToString().Split('.')[0]; + } + else { + value = string.Format("{0:F2}", order.PKGS); + + } + } + + ICell cell = row.GetCell(_cellNum - 1); if (cell != null) { - row.Cells[_cellNum - 1].SetCellValue(order.PKGS + "(" + order.KINDPKGS + ")"); + + row.Cells[_cellNum - 1].SetCellValue(value + "(" + order.KINDPKGS + ")"); } else { - row.CreateCell(_cellNum - 1).SetCellValue(order.PKGS + "(" + order.KINDPKGS + ")"); + row.CreateCell(_cellNum - 1).SetCellValue(value + "(" + order.KINDPKGS + ")"); } } if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_kgs" && _name == "kgs") { + var value = string.Empty; + if (order.KGS != null) + { + if (Convert.ToInt32(order.KGS.ToString().Split('.')[1]) == 0) + { + value = order.KGS.ToString().Split('.')[0]; + } + else + { + value = string.Format("{0:F2}", order.KGS); + + } + } ICell cell = row.GetCell(_cellNum - 1); if (cell != null) { - row.Cells[_cellNum - 1].SetCellValue(order.KGS + "(KGS)"); + row.Cells[_cellNum - 1].SetCellValue(value + "(KGS)"); } else { - row.CreateCell(_cellNum - 1).SetCellValue(order.KGS + "(KGS)"); + row.CreateCell(_cellNum - 1).SetCellValue(value + "(KGS)"); } @@ -2737,14 +2764,27 @@ namespace Myshipping.Application } if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_cbm" && _name == "cbm") { + var value = string.Empty; + if (order.CBM != null) + { + if (Convert.ToInt32(order.CBM.ToString().Split('.')[1]) == 0) + { + value = order.CBM.ToString().Split('.')[0]; + } + else + { + value = string.Format("{0:F2}", order.CBM); + + } + } ICell cell = row.GetCell(_cellNum - 1); if (cell != null) { - row.Cells[_cellNum - 1].SetCellValue(order.CBM + "(CBM)"); + row.Cells[_cellNum - 1].SetCellValue(value + "(CBM)"); } else { - row.CreateCell(_cellNum - 1).SetCellValue(order.CBM + "(CBM)"); + row.CreateCell(_cellNum - 1).SetCellValue(value + "(CBM)"); } } From 2051c65ce32f49308364273c87c3d58acea5ef4e Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 23 May 2023 17:53:35 +0800 Subject: [PATCH 5/7] 1 --- .../BookingOrder/BookingOrderService.cs | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index f7c9cd3a..731cd0a3 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -2711,17 +2711,15 @@ namespace Myshipping.Application { var value = string.Empty; if (order.PKGS!=null) { - if (Convert.ToInt32(order.PKGS.ToString().Split('.')[1]) == 0) { - value = order.PKGS.ToString().Split('.')[0]; + if (order.PKGS.ToString().Split('.').Count() > 1) + { + value = string.Format("{0:F2}", order.PKGS); } else { - value = string.Format("{0:F2}", order.PKGS); - + value = order.PKGS.ToString().Split('.')[0]; } + } - - - ICell cell = row.GetCell(_cellNum - 1); if (cell != null) { @@ -2739,15 +2737,15 @@ namespace Myshipping.Application var value = string.Empty; if (order.KGS != null) { - if (Convert.ToInt32(order.KGS.ToString().Split('.')[1]) == 0) + if (order.KGS.ToString().Split('.').Count() > 1) { - value = order.KGS.ToString().Split('.')[0]; + value = string.Format("{0:F2}", order.KGS); } else { - value = string.Format("{0:F2}", order.KGS); - + value = order.KGS.ToString().Split('.')[0]; } + } ICell cell = row.GetCell(_cellNum - 1); if (cell != null) @@ -2767,15 +2765,15 @@ namespace Myshipping.Application var value = string.Empty; if (order.CBM != null) { - if (Convert.ToInt32(order.CBM.ToString().Split('.')[1]) == 0) + if (order.CBM.ToString().Split('.').Count() > 1) { - value = order.CBM.ToString().Split('.')[0]; + value = string.Format("{0:F2}", order.CBM); } else { - value = string.Format("{0:F2}", order.CBM); - + value = order.CBM.ToString().Split('.')[0]; } + } ICell cell = row.GetCell(_cellNum - 1); if (cell != null) From 9e0b3c08f54d51d3bbc168fe51bd7f222998a5ff Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 23 May 2023 17:58:55 +0800 Subject: [PATCH 6/7] 1 --- .../BookingOrder/BookingOrderService.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 731cd0a3..55ba949d 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -2711,7 +2711,7 @@ namespace Myshipping.Application { var value = string.Empty; if (order.PKGS!=null) { - if (order.PKGS.ToString().Split('.').Count() > 1) + if (order.PKGS.ToString().Split('.').Count() > 1&&Convert.ToInt32(order.PKGS.ToString().Split('.')[1])>0) { value = string.Format("{0:F2}", order.PKGS); } @@ -2724,11 +2724,11 @@ namespace Myshipping.Application if (cell != null) { - row.Cells[_cellNum - 1].SetCellValue(value + "(" + order.KINDPKGS + ")"); + row.Cells[_cellNum - 1].SetCellValue(value + order.KINDPKGS ); } else { - row.CreateCell(_cellNum - 1).SetCellValue(value + "(" + order.KINDPKGS + ")"); + row.CreateCell(_cellNum - 1).SetCellValue(value + order.KINDPKGS ); } } @@ -2737,7 +2737,7 @@ namespace Myshipping.Application var value = string.Empty; if (order.KGS != null) { - if (order.KGS.ToString().Split('.').Count() > 1) + if (order.KGS.ToString().Split('.').Count() > 1 && Convert.ToInt32(order.KGS.ToString().Split('.')[1]) > 0) { value = string.Format("{0:F2}", order.KGS); } @@ -2750,11 +2750,11 @@ namespace Myshipping.Application ICell cell = row.GetCell(_cellNum - 1); if (cell != null) { - row.Cells[_cellNum - 1].SetCellValue(value + "(KGS)"); + row.Cells[_cellNum - 1].SetCellValue(value + "KGS"); } else { - row.CreateCell(_cellNum - 1).SetCellValue(value + "(KGS)"); + row.CreateCell(_cellNum - 1).SetCellValue(value + "KGS"); } @@ -2765,7 +2765,7 @@ namespace Myshipping.Application var value = string.Empty; if (order.CBM != null) { - if (order.CBM.ToString().Split('.').Count() > 1) + if (order.CBM.ToString().Split('.').Count() > 1 && Convert.ToInt32(order.CBM.ToString().Split('.')[1]) > 0) { value = string.Format("{0:F2}", order.CBM); } @@ -2778,11 +2778,11 @@ namespace Myshipping.Application ICell cell = row.GetCell(_cellNum - 1); if (cell != null) { - row.Cells[_cellNum - 1].SetCellValue(value + "(CBM)"); + row.Cells[_cellNum - 1].SetCellValue(value + "CBM"); } else { - row.CreateCell(_cellNum - 1).SetCellValue(value + "(CBM)"); + row.CreateCell(_cellNum - 1).SetCellValue(value + "CBM"); } } From 677ce92734454168e563dcebf390ecd2ad346f0c Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 23 May 2023 18:03:45 +0800 Subject: [PATCH 7/7] 1 --- .../Service/BookingOrder/BookingOrderService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 55ba949d..f708f994 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -2713,7 +2713,7 @@ namespace Myshipping.Application if (order.PKGS!=null) { if (order.PKGS.ToString().Split('.').Count() > 1&&Convert.ToInt32(order.PKGS.ToString().Split('.')[1])>0) { - value = string.Format("{0:F2}", order.PKGS); + value = string.Format("{0:F3}", order.PKGS); } else { value = order.PKGS.ToString().Split('.')[0]; @@ -2739,7 +2739,7 @@ namespace Myshipping.Application { if (order.KGS.ToString().Split('.').Count() > 1 && Convert.ToInt32(order.KGS.ToString().Split('.')[1]) > 0) { - value = string.Format("{0:F2}", order.KGS); + value = string.Format("{0:F3}", order.KGS); } else { @@ -2767,7 +2767,7 @@ namespace Myshipping.Application { if (order.CBM.ToString().Split('.').Count() > 1 && Convert.ToInt32(order.CBM.ToString().Split('.')[1]) > 0) { - value = string.Format("{0:F2}", order.CBM); + value = string.Format("{0:F3}", order.CBM); } else {