From 6e99fe9b82d12efcfbbe1ba596e1d20d8f50d4fe Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Fri, 2 Jun 2023 16:37:59 +0800 Subject: [PATCH] 1 --- .../BookingOrder/BookingOrderService.cs | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 650908d7..878ab6f9 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -4557,11 +4557,11 @@ namespace Myshipping.Application ICell cell4 = row.GetCell(4); if (cell3 != null) { - row.Cells[4].SetCellValue(order.KGS.ToSqlValue()); + row.Cells[4].SetCellValue(order.KGS.ToString()); } else { - row.CreateCell(4).SetCellValue(order.KGS.ToSqlValue()); + row.CreateCell(4).SetCellValue(order.KGS.ToString()); } } if (order.CBM != null) @@ -4570,11 +4570,11 @@ namespace Myshipping.Application ICell cell5 = row.GetCell(5); if (cell5 != null) { - row.Cells[5].SetCellValue(order.CBM.ToSqlValue()); + row.Cells[5].SetCellValue(order.CBM.ToString()); } else { - row.CreateCell(5).SetCellValue(order.CBM.ToSqlValue()); + row.CreateCell(5).SetCellValue(order.CBM.ToString()); } } } @@ -6011,11 +6011,11 @@ namespace Myshipping.Application ICell cell4 = row.GetCell(4); if (cell3 != null) { - row.Cells[4].SetCellValue(order.KGS.ToSqlValue()); + row.Cells[4].SetCellValue(order.KGS.ToString()); } else { - row.CreateCell(4).SetCellValue(order.KGS.ToSqlValue()); + row.CreateCell(4).SetCellValue(order.KGS.ToString()); } } if (order.CBM != null) @@ -6024,11 +6024,11 @@ namespace Myshipping.Application ICell cell5 = row.GetCell(5); if (cell5!= null) { - row.Cells[5].SetCellValue(order.CBM.ToSqlValue()); + row.Cells[5].SetCellValue(order.CBM.ToString()); } else { - row.CreateCell(5).SetCellValue(order.CBM.ToSqlValue()); + row.CreateCell(5).SetCellValue(order.CBM.ToString()); } } } @@ -6188,9 +6188,12 @@ namespace Myshipping.Application _logger.LogInformation("导出excel:" + Path.Combine(fileFullPath, fileName)); var filestream = new FileStream(Path.Combine(fileFullPath, fileName), FileMode.OpenOrCreate, FileAccess.ReadWrite); excelwork.Write(filestream); + filestream.Close(); + filestream.Dispose(); #endregion - return new FileStreamResult( filestream, "application/octet-stream") { FileDownloadName = fileName }; - + //return new FileStreamResult( filestream, "application/octet-stream") { FileDownloadName = fileName }; + return new FileStreamResult(new FileStream(Path.Combine(fileFullPath, fileName), FileMode.Open), "application/octet-stream") { FileDownloadName = fileName }; + ; }