瀏覽代碼

xls:修改信息

xls 6 年之前
父節點
當前提交
9083f94c75

+ 25 - 18
MBI/SAGA.GplotManage/Command.cs

@@ -31,13 +31,15 @@ namespace SAGA.GplotManage
             {
                 DistributionRelationshipHandler handler = new DistributionRelationshipHandler();
                 var re = handler.GetViewData(new PowerComputerContext());
-                if (re[0].Childrens.Any())
+
+                if (re[0].Childrens.Count == 0 && re[1].Childrens.Count == 0)
                 {
-                    WinEquipmentRelation_Web window =
-                        new WinEquipmentRelation_Web(re[0].Childrens, re[1].Childrens);
-                    window.Title = "配电拓扑图:配电柜--配电柜";
-                    window.Show();
+                    MessageShow.Infomation("不存在相关拓扑数据");
                 }
+                WinEquipmentRelation_Web window =
+                    new WinEquipmentRelation_Web(re[0].Childrens, re[1].Childrens);
+                window.Title = "配电拓扑图:配电柜--配电柜";
+                window.Show();
 
             }
             catch (Exception ex)
@@ -69,16 +71,18 @@ namespace SAGA.GplotManage
             #region 核心处理
             EquipPowerRelationshipHandler handler = new EquipPowerRelationshipHandler();
             var re = handler.GetViewData(new PowerComputerContext());
-            if (re[0].Childrens.Any())
+            if (re[0].Childrens.Count == 0 && re[1].Childrens.Count == 0)
             {
-                WinEquipmentRelation_Web window =
-                    new WinEquipmentRelation_Web(re[0].Childrens, re[1].Childrens);
-                window.Title = "配电拓扑图:配电柜--末端";
-                window.Show();
-            } 
+                MessageShow.Infomation("不存在相关拓扑数据");
+            }
+
+            WinEquipmentRelation_Web window =
+                new WinEquipmentRelation_Web(re[0].Childrens, re[1].Childrens);
+            window.Title = "配电拓扑图:配电柜--末端";
+            window.Show();
             #endregion
             return Result.Succeeded;
-        }    
+        }  
         public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
         {
             return true;
@@ -99,13 +103,16 @@ namespace SAGA.GplotManage
             #region 核心处理
             ObjectControlRelationshipHandler handler = new ObjectControlRelationshipHandler();
             var re = handler.GetViewData(new PowerComputerContext());
-            if (re[0].Childrens.Any())
+            if (re[0].Childrens.Count == 0 && re[1].Childrens.Count == 0)
             {
-                WinControlRelation_Web window =
-                    new WinControlRelation_Web(re[0].Childrens, re[1].Childrens);
-                window.Title = "对象受控关系图";
-                window.Show();
-            } 
+                MessageShow.Infomation("不存在相关拓扑数据");
+            }
+
+            WinControlRelation_Web window =
+                new WinControlRelation_Web(re[0].Childrens, re[1].Childrens);
+            window.Title = "对象受控关系图";
+            window.Show();
+
             #endregion
 
             return Result.Succeeded;

文件差異過大導致無法顯示
+ 83 - 26
MBI/SAGA.GplotManage/GplotCommand.cs


+ 4 - 4
MBI/SAGA.GplotRelationComputerManage/SystemRelation/SystemComputerHandler.cs

@@ -35,10 +35,10 @@ namespace SAGA.GplotRelationComputerManage
                 {
 
 #if DEBUG
-                    if (testFiles.All(f => !fileInfo.Contains(f)))
-                    {
-                        continue;
-                    }
+                    //if (testFiles.All(f => !fileInfo.Contains(f)))
+                    //{
+                    //    continue;
+                    //}
 #endif
                     FloorSystemItem floorItems = context.FloorItems.GetItem(fileInfo);
                     //FloorSystemItemTest floorItems = context.TestFloorItems.GetItem(fileInfo);

+ 15 - 7
MBI/SAGA.MBI/RequestData/RelationRequest.cs

@@ -386,19 +386,27 @@ namespace SAGA.MBI.RequestData
                 string postData = queryObject.ToString();
                 RestClient client = new RestClient(url, HttpVerb.POST, postData);
                 string request = client.PostRequest();
-                if (request.IsRequestHasItem())
+                //if (request.IsRequestHasItem())
+                //{
+                JObject jObject = JObject.Parse(request);
+                if(jObject.IsContainKeyEx("Content"))
                 {
-                    JObject jObject = JObject.Parse(request);
-                    foreach (JObject jobj in jObject["Content"])
+                    foreach (JObject item in jObject["Content"])
                     {
-                        string toid = jobj.GetValueEx("to_id");                   
-                        string fromid = jobj.GetValueEx("from_id");
-                        if (!string.IsNullOrWhiteSpace(toid) && !string.IsNullOrWhiteSpace(fromid))
+                        foreach (JObject jobj in item["Content"])
                         {
-                            items.Add(new Tuple<string, string>(toid, fromid));
+                            string toid = jobj.GetValueEx("to_id");
+                            string fromid = jobj.GetValueEx("from_id");
+                            if (!string.IsNullOrWhiteSpace(toid) && !string.IsNullOrWhiteSpace(fromid))
+                            {
+                                items.Add(new Tuple<string, string>(toid, fromid));
+                            }
                         }
+                       
                     }
                 }
+                  
+                //}
                 return items;
             }
             catch (Exception e)

+ 4 - 4
MBI/SAGA.RevitUtils/SAGA.RevitUtils.csproj

@@ -158,6 +158,10 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\Dlls\RevitRefDll\RevitAPIUI.dll</HintPath>
     </Reference>
+    <Reference Include="SAGA.RevitAPI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>G:\2019\SAGA.MBI\SAGA.MBI\MBI\OutputDll\SAGA.RevitAPI.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Drawing" />
@@ -335,10 +339,6 @@
       <Project>{07b73c98-dcb0-4782-81fa-f50a30b563ab}</Project>
       <Name>SAGA.DotNetUtils</Name>
     </ProjectReference>
-    <ProjectReference Include="..\SAGA.RevitAPI\SAGA.RevitAPIR2018.csproj">
-      <Project>{fb86504f-29db-4766-a2da-22842e5f770d}</Project>
-      <Name>SAGA.RevitAPIR2018</Name>
-    </ProjectReference>
     <ProjectReference Include="..\SAGA.RevitUtility\SAGA.RevitUtility.csproj">
       <Project>{5f78f5f7-95ba-4b72-8181-230b11192eca}</Project>
       <Name>SAGA.RevitUtility</Name>