yuanrf před 20 hodinami
rodič
revize
9e77eb4b47

+ 19 - 5
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -3,6 +3,7 @@ using Aspose.Words;
 using Aspose.Words.Drawing;
 using Aspose.Words.Tables;
 using DiffMatchPatch;
+using Dm.util;
 using Microsoft.AspNetCore.SignalR;
 using NPOI.SS.Formula.Functions;
 using NPOI.SS.UserModel;
@@ -28211,15 +28212,28 @@ ORDER BY
                     cells.Merge(mergeStart, col, tailCount, 1);
             }
 
-            byte[] bytes = null;
+            // byte[] bytes = null;
 
-            using (MemoryStream stream = new MemoryStream())
+            // using (MemoryStream stream = new MemoryStream())
+            // {
+            //     designer.Workbook.Save(stream, Aspose.Cells.SaveFormat.Xlsx);
+            //     bytes = stream.ToArray();
+            // }
+
+            // return File(bytes, "application/excel", $"{groupInfo.TeamName}_会务流程.xlsx");
+
+
+            string savePath = $"{AppSettingsHelper.Get("ExcelBasePath")}ConferenceProcedures";
+
+            if (!System.IO.Directory.Exists(savePath))
             {
-                designer.Workbook.Save(stream, Aspose.Cells.SaveFormat.Xlsx);
-                bytes = stream.ToArray();
+                System.IO.Directory.CreateDirectory(savePath);
             }
 
-            return File(bytes, "application/excel", $"{groupInfo.TeamName}_会务流程.xlsx");
+            designer.Workbook.Save($"{savePath}/{groupInfo.TeamName}_会务流程.xlsx");
+            string rst = savePath.replace(AppSettingsHelper.Get("ExcelBasePath"),
+            AppSettingsHelper.Get("ExcelBaseUrl") + AppSettingsHelper.Get("ExcelFtpPath"));
+            return Ok(JsonView(true, "SUCCESS", $"{rst}/{groupInfo.TeamName}_会务流程.xlsx"));
         }
 
         #endregion