浏览代码

导出时空数据文件提示

Jimmy 2 年之前
父节点
当前提交
12ca50243a
共有 1 个文件被更改,包括 24 次插入10 次删除
  1. 24 10
      fis/Managers/FileExporterManager.cs

+ 24 - 10
fis/Managers/FileExporterManager.cs

@@ -48,6 +48,7 @@ namespace fis.Win.Dev.Managers
                 {
                     NotifyTheProgress(progress, _exportStatus);
                     DoPackaging();
+                    return;
                 }
                 if (_exportStatus == ExportStatus.Finished)
                 {
@@ -102,8 +103,7 @@ namespace fis.Win.Dev.Managers
             _fileCount = accessFileCount;
             fileName = String.Join("+",dataObj.SubFolders.ToArray())+DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");
            _destnationName =Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop),fileName+".zip");
-            _downloadFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,fileName);
-        
+            _downloadFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,fileName);        
             if (!Directory.Exists(_downloadFolder))
             {  
                 Directory.CreateDirectory(_downloadFolder);
@@ -149,6 +149,12 @@ namespace fis.Win.Dev.Managers
                         {
                             patientPath = patientPath.Replace("*", "");
                             Directory.CreateDirectory(patientPath);
+                            if (c.ReportItemList.Count == 0)
+                            {
+                                var fileName = Path.Combine(patientPath, "nodata.txt");
+                                File.WriteAllText(fileName, "nodata");
+                                return;
+                            }
                         }
                       
                         foreach (var d in c.ReportItemList)
@@ -201,6 +207,12 @@ namespace fis.Win.Dev.Managers
                         {
                             patientPath = patientPath.Replace("*", "");
                             Directory.CreateDirectory(patientPath);
+                            if (c.RemedicalItemList.Count == 0)
+                            {
+                                var fileName = Path.Combine(patientPath, "nodata.txt");
+                                File.WriteAllText(fileName, "nodata");
+                                return;
+                            }
                         }
 
                         foreach (var d in c.RemedicalItemList)
@@ -228,10 +240,6 @@ namespace fis.Win.Dev.Managers
                             finally
                             {
                                 _fileFinishCount++;
-                                if (_fileFinishCount == 41)
-                                {
-                                    ;
-                                }
                             }
 
                         }
@@ -244,12 +252,18 @@ namespace fis.Win.Dev.Managers
             //刷新进度条
             Task.Run(() =>
             {
-                while (ExportStatus!=ExportStatus.Finished)
+                if (_fileCount > 0)
                 {
-                    Thread.Sleep(1000);                   
-                    ExportStatus=_fileFinishCount==_fileCount? ExportStatus.Packaging:ExportStatus.Downloading;
+                    while (ExportStatus != ExportStatus.Finished)
+                    {
+                        Thread.Sleep(1000);
+                        ExportStatus = _fileFinishCount == _fileCount ? ExportStatus.Packaging : ExportStatus.Downloading;
+                    }
+                }
+                else {
+                    Thread.Sleep(2000);
+                    ExportStatus = ExportStatus.Packaging;
                 }
-
             });
         }