瀏覽代碼

Merge branch 'master' of https://git.dev.tencent.com/xuhuo1234/saga

xulisong 5 年之前
父節點
當前提交
71f681457f

+ 12 - 0
MBI/SAGA.MBI/DataArrange/DalProjectTree.cs

@@ -52,6 +52,18 @@ namespace SAGA.MBI.DataArrange
             MFloor floor = tree?.Item as MFloor;
             return floor;
         }
+        /// <summary>
+        /// 获取包含Building名称的楼层名
+        /// buildingName.floorName
+        /// </summary>
+        /// <param name="floorId"></param>
+        /// <returns></returns>
+        public static string GetBuildingFloorName(string floorId)
+        {
+            var floorName = DalProjectTree.GetFloorByFloorId(floorId)?.ToString();
+            var buildingName = DalProjectTree.GetBuildingByFloor(floorId)?.ToString();
+            return  $"{buildingName}.{floorName}";
+        }
 
         /// <summary>
         /// 由楼层id获取楼层的名称

+ 1 - 1
MBI/SAGA.MBI/Test/CopyParameterValue.cs

@@ -44,7 +44,7 @@ namespace SAGA.MBI.Test
 
             m_parameterDic = dic;
             m_copyFamilyRange = copyRange;
-            return (dic == null || m_copyFamilyRange == null);
+            return (dic.Any()&&!string.IsNullOrWhiteSpace(m_copyFamilyRange));
         }
 
         public string Execute(MFloor floor)

+ 2 - 4
MBI/SAGA.MBI/ToolsData/ExportAllDuty.cs

@@ -100,9 +100,7 @@ namespace SAGA.MBI.ToolsData
                 foreach (var context in contexts)
                 {
                     int index = 0;
-                    var floorName = context.MFloor.ToString();
-                    var floorPath = context.MFloor.FullPath;
-                    ISheet sheet = book.CreateSheet(floorName);
+                    ISheet sheet = book.CreateSheet(DalProjectTree.GetBuildingFloorName(context.FloorId));
 
                     #region 添加表头
 
@@ -140,7 +138,7 @@ namespace SAGA.MBI.ToolsData
                          row = sheet.CreateRow(index);
 
                          ICell cell = row.CreateCell(0, NPOI.SS.UserModel.CellType.String);
-                         cell.SetCellValue(floorName);
+                         cell.SetCellValue(context.MFloor.ToString());
 
                          cell = row.CreateCell(1, NPOI.SS.UserModel.CellType.String);
                          cell.SetCellValue(type);

+ 7 - 6
MBI/SAGA.MBI/ToolsData/ExportMEPSystem.cs

@@ -71,8 +71,7 @@ namespace SAGA.MBI.ToolsData
         {
             string fullPah = floor.FullPath;
             Document doc = ExternalDataWrapper.Current.UiApp.Application.OpenDocumentFile(fullPah);
-
-            ExportItemGroup group =new ExportItemGroup(floor.ToString());
+            ExportItemGroup group =new ExportItemGroup(floor.ToString(),DalProjectTree.GetBuildingFloorName(floor.Id));
             var systems = doc.GetElements<MEPSystem>();
             foreach (var mepSystem in systems)
             {
@@ -112,9 +111,9 @@ namespace SAGA.MBI.ToolsData
 
                 foreach (var context in contexts)
                 {
+                    
                     int index = 0;
-                    var floorName = context.FloorName;
-                    ISheet sheet = book.CreateSheet(floorName);
+                    ISheet sheet = book.CreateSheet(context.BuildingFloorName);
 
                     #region 添加表头
 
@@ -147,7 +146,7 @@ namespace SAGA.MBI.ToolsData
                         row = sheet.CreateRow(index);
 
                         ICell cell = row.CreateCell(0, NPOI.SS.UserModel.CellType.String);
-                        cell.SetCellValue(floorName);
+                        cell.SetCellValue(context.FloorName);
 
                         cell = row.CreateCell(1, NPOI.SS.UserModel.CellType.String);
                         cell.SetCellValue(type);
@@ -272,12 +271,14 @@ namespace SAGA.MBI.ToolsData
 
         class ExportItemGroup
         {
-            public ExportItemGroup(string floorName)
+            public ExportItemGroup(string floorName,string buildingFloorName)
             {
                 FloorName = floorName;
+                BuildingFloorName = buildingFloorName;
                 Items = new List<ExportItem>();
             }
             public List<ExportItem> Items { get; set; }
+            public string BuildingFloorName { get; set; }
             public string FloorName { get; set; }
         }
         class ExportItem