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] 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)"); } }