Browse Source

收款账单 下载文档Zip Bug 调整

leiy 11 months ago
parent
commit
ea42e12fd8
1 changed files with 4 additions and 4 deletions
  1. 4 4
      OASystem/OASystem.Api/Controllers/FinancialController.cs

+ 4 - 4
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -1113,8 +1113,8 @@ namespace OASystem.API.Controllers
                             }
                         }
                         //MemoryStream outSteam = new MemoryStream();
-                        string filsPath = $"ForeignReceivables/File/{ClientItem.Key}.docx";
-                        doc.Save(AppSettingsHelper.Get("WordBasePath") + filsPath);
+                        string filsPath = AppSettingsHelper.Get("WordBasePath") + $"ForeignReceivables/File/{ClientItem.Key}.docx";
+                        doc.Save(filsPath);
                         filesToZip.Add(filsPath);
                         //streams.Add(ClientItem.Key + ".docx", outSteam.ToArray());
                     }
@@ -1124,7 +1124,7 @@ namespace OASystem.API.Controllers
                     string zipPath =  $"ForeignReceivables/File/{_DelegationInfo.TeamName}-收款账单{DateTime.Now.ToString("yyyyMMddHHmmss")}.zip";
                     try
                     {
-                        using (var zip = ZipFile.Open(zipPath, ZipArchiveMode.Create))
+                        using (var zip = ZipFile.Open(AppSettingsHelper.Get("WordBasePath") + zipPath, ZipArchiveMode.Create))
                         {
                             foreach (var file in filesToZip)
                             {
@@ -1137,7 +1137,7 @@ namespace OASystem.API.Controllers
                         return Ok(JsonView(false, ex.Message));
                     }
 
-                    string url = AppSettingsHelper.Get("WordBasePath") + $"{zipPath}";
+                    string url = AppSettingsHelper.Get("WordBaseUrl") + $"Office/Word/{zipPath}";
 
                     return Ok(JsonView(true, "成功", new { Url = url }));
                 }