xulisong před 6 roky
rodič
revize
12a5a5a5d5

binární
MBI/MBIResource/BaseDB/MBIAssistData.db


+ 4 - 0
MBI/SAGA.DotNetUtils/WPF/MVVM/BasePropertyChanged.cs

@@ -37,6 +37,10 @@ namespace SAGA.DotNetUtils.WPF
                 PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(body.Member.Name));
             }
         }
+        public void RaisePropertyChanged(string propertyName = "")
+        {
+            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+        }
     }
     public static class PropertyChangedBaseEx
     {

+ 10 - 1
MBI/SAGA.GplotManage/SAGA.GplotManage.csproj

@@ -129,6 +129,10 @@
     <Compile Include="GplotManage\GplotView\GplotView.cs" />
     <Compile Include="Command\GplotUtil.cs" />
     <Compile Include="GraphTypeEnum.cs" />
+    <Compile Include="SystemChecks\VmSystemCheck.cs" />
+    <Compile Include="SystemChecks\WinSystemCheck.xaml.cs">
+      <DependentUpon>WinSystemCheck.xaml</DependentUpon>
+    </Compile>
     <Compile Include="SystemRelation\RelationDataUtil.cs" />
     <Compile Include="UploadRelated\AirNetwork.cs" />
     <Compile Include="UploadRelated\ControlRelation.cs" />
@@ -218,7 +222,12 @@
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
   </ItemGroup>
-  <ItemGroup />
+  <ItemGroup>
+    <Page Include="SystemChecks\WinSystemCheck.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Import Project="..\packages\MrAdvice.2.5.24\build\MrAdvice.targets" Condition="Exists('..\packages\MrAdvice.2.5.24\build\MrAdvice.targets')" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

+ 20 - 0
MBI/SAGA.GplotManage/SystemChecks/VmSystemCheck.cs

@@ -0,0 +1,20 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:VmSystemCheck
+ * 作者:xulisong
+ * 创建时间: 2019/2/28 15:32:36
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using SAGA.DotNetUtils.WPF;
+
+namespace SAGA.GplotManage.SystemChecks
+{
+    public class VmSystemCheck  :BaseViewModelStub
+    {
+    }
+}

+ 83 - 0
MBI/SAGA.GplotManage/SystemChecks/WinSystemCheck.xaml

@@ -0,0 +1,83 @@
+<windows:WinBase x:Class="SAGA.GplotManage.SystemChecks.WinSystemCheck"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:SAGA.GplotManage.SystemChecks"
+        xmlns:windows="clr-namespace:SAGA.RevitUtils.Windows;assembly=SAGA.RevitUtils"
+        mc:Ignorable="d" Title="官网异常清单" WindowStartupLocation="CenterScreen"
+                 Height="550" Width="580">
+    <windows:WinBase.Resources>
+        <CollectionViewSource x:Key="SourceGroupByClassCode" Source="{Binding Path=MissFMEquips,NotifyOnSourceUpdated=True}">
+            <CollectionViewSource.GroupDescriptions>
+                <PropertyGroupDescription PropertyName="Equipment.EquipClassName"></PropertyGroupDescription>
+            </CollectionViewSource.GroupDescriptions>
+        </CollectionViewSource>
+        <Style TargetType="{x:Type GroupItem}" x:Key="GroupHeaderFamilyStyle">
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type GroupItem}">
+                        <Expander IsExpanded="False" Background="White" BorderBrush="White" Foreground="Black">
+                            <Expander.Header>
+                                <DockPanel>
+                                    <TextBlock FontWeight="Bold" Text="{Binding Path=Name}" Width="140"/>
+                                    <TextBlock FontWeight="Bold" Text="{Binding Path=ItemCount}"/>
+                                </DockPanel>
+                            </Expander.Header>
+                            <Expander.Content>
+                                <ItemsPresenter />
+                            </Expander.Content>
+                        </Expander>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+    </windows:WinBase.Resources>
+    <Grid Margin="5">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="30"></RowDefinition>
+            <RowDefinition></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid>
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition></ColumnDefinition>
+                <ColumnDefinition></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <StackPanel HorizontalAlignment="Stretch" Orientation="Horizontal">
+                <Label Height="25" Content="当前模型:"  VerticalContentAlignment="Center"></Label>
+                <TextBlock   Text="{Binding Path=FloorLocaltion}"  VerticalAlignment="Center"></TextBlock>
+            </StackPanel>
+
+            <Button Grid.Column="1" Height="25" Width="100" Content="重新检测"   HorizontalAlignment="Right"></Button>
+        </Grid>
+
+        <DataGrid x:Name="datagrid" Grid.Row="1" RowHeight="30" SelectionMode="Single" AutoGenerateColumns="False"
+                  ItemsSource="{Binding Source={StaticResource SourceGroupByClassCode}}">
+            <DataGrid.GroupStyle>
+                <GroupStyle ContainerStyle="{StaticResource GroupHeaderFamilyStyle}"/>
+            </DataGrid.GroupStyle>
+            <DataGrid.ColumnHeaderStyle>
+                <Style TargetType="DataGridColumnHeader">
+                    <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
+                </Style>
+            </DataGrid.ColumnHeaderStyle>
+            <DataGrid.Columns>
+                <DataGridTextColumn Width="*" MinWidth="80" Header="BIMID" ></DataGridTextColumn>
+                <DataGridTextColumn Width="*" MinWidth="100" Header="官网类型" ></DataGridTextColumn>
+                <DataGridTextColumn Width="*" MinWidth="80" Header="流向" ></DataGridTextColumn>
+                <DataGridTemplateColumn Header="操作" Width="*" MinWidth="350">
+                    <DataGridTemplateColumn.CellTemplate>
+                        <DataTemplate>
+                            <StackPanel Orientation="Horizontal">
+                                <Button Content="模型定位"  Command="{Binding Data.Commands.ScanProductTypeCommand,Source={StaticResource ResourceKey=DATA} }" CommandParameter="{Binding}"    HorizontalAlignment="Left" Padding="5,0,5,0"/>
+                                <Button Content="已改正" Command="{Binding Data.Commands.EditProductTypeCommand,Source={StaticResource ResourceKey=DATA} }" CommandParameter="{Binding}"    HorizontalAlignment="Left" Padding="5,0,5,0"/>
+                                <Button Content="误报" Command="{Binding Data.Commands.EditProductTypeCommand,Source={StaticResource ResourceKey=DATA} }" CommandParameter="{Binding}"   HorizontalAlignment="Left" Padding="5,0,5,0"/>
+                            </StackPanel>
+                        </DataTemplate>
+                    </DataGridTemplateColumn.CellTemplate>
+                </DataGridTemplateColumn>
+            </DataGrid.Columns>
+        </DataGrid>
+
+    </Grid>
+</windows:WinBase>

+ 31 - 0
MBI/SAGA.GplotManage/SystemChecks/WinSystemCheck.xaml.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+using SAGA.RevitUtils.Windows;
+
+namespace SAGA.GplotManage.SystemChecks
+{
+    /// <summary>
+    /// WinSystemCheck.xaml 的交互逻辑
+    /// </summary>
+    public partial class WinSystemCheck : WinBase
+    {
+        private VmSystemCheck m_Vm;
+        public WinSystemCheck()
+        {
+            InitializeComponent();
+            m_Vm = new VmSystemCheck();
+            this.DataContext = this.m_Vm;
+        }
+    }
+}

+ 5 - 0
MBI/SAGA.GplotRelationComputerManage/SAGA.GplotRelationComputerManage.csproj

@@ -157,6 +157,11 @@
     <Compile Include="SpaceRelation\SpaceComputerContext.cs" />
     <Compile Include="SpaceRelation\SpaceComputerHandler.cs" />
     <Compile Include="SpaceRelation\SpaceComputerManager.cs" />
+    <Compile Include="SystemChecks\FloorCheckItem.cs" />
+    <Compile Include="SystemChecks\GplotSystemCheckContext.cs" />
+    <Compile Include="SystemChecks\GplotSystemCheckManager.cs" />
+    <Compile Include="SystemChecks\Model\SystemCheckReportItem.cs" />
+    <Compile Include="SystemChecks\Model\SystemCheckResultItem.cs" />
     <Compile Include="SystemRelation\Common\PointItemType.cs" />
     <Compile Include="SystemRelation\Common\RelationTypeUtil.cs" />
     <Compile Include="SystemRelation\Common\SystemCalcUtil.cs" />

+ 1 - 1
MBI/SAGA.GplotRelationComputerManage/SpaceRelation/SpaceComputerManager.cs

@@ -22,7 +22,7 @@ namespace SAGA.GplotRelationComputerManage
     /// </summary>
     public class SpaceComputerManager
     {
-        private readonly static List<string> m_UpSpaceFunTypes= new List<string>() { "140","150","1A0","1B0" };
+        private readonly static List<string> m_UpSpaceFunTypes = new List<string>() {"140"};// new List<string>() { "140","150","1A0","1B0" };
      /// <summary>
      /// 获取计算上下关系的空间类型
      /// </summary>

+ 64 - 0
MBI/SAGA.GplotRelationComputerManage/SystemChecks/FloorCheckItem.cs

@@ -0,0 +1,64 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:FloorCheckItem
+ * 作者:xulisong
+ * 创建时间: 2019/2/28 11:53:22
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Autodesk.Revit.DB;
+
+namespace SAGA.GplotRelationComputerManage.SystemChecks
+{
+    /// <summary>
+    /// 每层检测结果
+    /// </summary>
+    public class FloorCheckItem
+    {
+        #region 构造函数
+
+        /// <summary>
+        /// 初始化解析类
+        /// </summary>
+        /// <param name="doc"></param>
+        public FloorCheckItem(Document doc)
+        {
+            Document = doc;
+        }
+
+        #endregion
+
+        #region 属性相关
+
+        /// <summary>
+        /// 关联模型信息
+        /// </summary>
+        public Document Document { get; private set; }
+        /// <summary>
+        /// 使用关联标高
+        /// </summary>
+        public Level UseLevel { get; private set; }
+        #endregion
+        public void Parse(GplotSystemCheckContext context)
+        {
+            if (UseLevel == null)
+                return;
+            var doc = Document;
+            var relations = context.Relations;
+            foreach (var relation in relations)
+            {
+                var shell = context.RelationShells.GetItem(relation);
+                 ParseSystem(context, shell, shell.IsPipeSystem()? Domain.DomainPiping:Domain.DomainHvac);          
+            }
+        }
+        private void ParseSystem(GplotSystemCheckContext context,RelationTypeShell shell, Domain domain)
+        {
+
+        }
+
+    }
+}

+ 42 - 0
MBI/SAGA.GplotRelationComputerManage/SystemChecks/GplotSystemCheckContext.cs

@@ -0,0 +1,42 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:GplotSystemCheckContext
+ * 作者:xulisong
+ * 创建时间: 2019/2/28 11:48:12
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using SAGA.DotNetUtils.Cache;
+
+namespace SAGA.GplotRelationComputerManage.SystemChecks
+{
+    /// <summary>
+    /// 检测信息
+    /// </summary>
+    public class GplotSystemCheckContext
+    {
+        public GplotSystemCheckContext()
+        {
+            RelationShells = SystemCalcUtil.CreateRelationShellItems();
+            ReportItems = new List<SystemCheckReportItem>();
+            Relations = new List<string>();
+        }
+        List<SystemCheckReportItem> ReportItems { get; set; }
+
+        #region 需要计算的系统相关
+        /// <summary>
+        /// 缓存关系计算壳对象
+        /// </summary>
+        public CacheItems<string, RelationTypeShell> RelationShells { get; private set; }
+
+        /// <summary>
+        /// 需要计算的关系类型
+        /// </summary>
+        public List<string> Relations { get; private set; }
+        #endregion
+    }
+}

+ 49 - 0
MBI/SAGA.GplotRelationComputerManage/SystemChecks/GplotSystemCheckManager.cs

@@ -0,0 +1,49 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:GplotSystemCheckManager
+ * 作者:xulisong
+ * 创建时间: 2019/2/28 11:43:24
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Autodesk.Revit.DB;
+
+namespace SAGA.GplotRelationComputerManage.SystemChecks
+{
+    public class GplotSystemCheckManager
+    {
+        public void CheckSystem(List<Document> documents,List<string> gplotTypeSystems)
+        {
+            if (gplotTypeSystems == null || !gplotTypeSystems.Any())
+                return;
+            if (documents == null || !documents.Any())
+                return;
+            GplotSystemCheckContext context = new GplotSystemCheckContext();
+            context.Relations.AddRange(gplotTypeSystems);
+            foreach (var document in documents)
+            {
+                var floorItem = new FloorCheckItem(document);
+                floorItem.Parse(context);
+            }
+            //向数据库提交信息
+        }
+
+        public SystemCheckReportItem GetCacheCheckSystemResult(Document document, string gplotType)
+        {
+            /*
+             *  判断数据库中是否存在;存在直接查询数据库返回;不存在的话进行检测,再返回
+             */
+            return GetCheckSystemResult(document, gplotType);
+        }
+
+        public SystemCheckReportItem GetCheckSystemResult(Document document, string gplotType)
+        {
+            CheckSystem(new List<Document>() { document }, new List<string>() { gplotType });
+            return new SystemCheckReportItem();
+        }
+    }
+}

+ 134 - 0
MBI/SAGA.GplotRelationComputerManage/SystemChecks/Model/SystemCheckReportItem.cs

@@ -0,0 +1,134 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:SystemCHeckReportItem
+ * 作者:xulisong
+ * 创建时间: 2019/2/28 9:48:48
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using SAGA.DotNetUtils.WPF;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SAGA.GplotRelationComputerManage.SystemChecks
+{
+    public class SystemCheckReportItem  : BasePropertyChanged
+    {
+        public SystemCheckReportItem()
+        {
+            ResultItems = new List<SystemCheckResultItem>();
+        }
+
+        private string m_Id;
+        /// <summary>
+        /// 检查结果Id
+        /// </summary>
+        public string Id
+        {
+            get { return this.m_Id; }
+            set
+            {
+                this.m_Id = value;
+                RaisePropertyChanged(nameof(this.Id));
+            }
+        }
+
+
+        private string  m_ReportId;
+        /// <summary>
+        /// 报表Id
+        /// </summary>
+        public string  ReportId
+        {
+            get { return this.m_ReportId; }
+            set
+            {
+                this.m_ReportId = value;
+                RaisePropertyChanged(nameof(this.ReportId));
+            }
+        }
+
+
+        private string m_BimId;
+        /// <summary>
+        /// BimId
+        /// </summary>
+        public string BimId
+        {
+            get { return this.m_BimId; }
+            set
+            {
+                this.m_BimId = value;
+                RaisePropertyChanged(nameof(this.BimId));
+            }
+        }
+
+
+
+        private string m_FlowDirection;
+        /// <summary>
+        /// 流向
+        /// </summary>
+        public string FlowDirection
+        {
+            get { return this.m_FlowDirection; }
+            set
+            {
+                this.m_FlowDirection = value;
+                RaisePropertyChanged(nameof(this.FlowDirection));
+            }
+        }
+
+
+        private string  m_ErrorCode;
+        /// <summary>
+        /// 错误编码
+        /// </summary>
+        public string  ErrorCode
+        {
+            get { return this.m_ErrorCode; }
+            set
+            {
+                this.m_ErrorCode = value;
+                RaisePropertyChanged(nameof(this.ErrorCode));
+            }
+        }
+
+
+        private bool m_IsCorrect;
+        /// <summary>
+        /// 是否改正
+        /// </summary>
+        public bool IsCorrect
+        {
+            get { return this.m_IsCorrect; }
+            set
+            {
+                this.m_IsCorrect = value;
+                RaisePropertyChanged(nameof(this.IsCorrect));
+            }
+        }
+
+
+        private bool m_IsMisinformation;
+        /// <summary>
+        /// 是否是误报
+        /// </summary>
+        public bool IsMisinformation
+        {
+            get { return this.m_IsMisinformation; }
+            set
+            {
+                this.m_IsMisinformation = value;
+                RaisePropertyChanged(nameof(this.IsMisinformation));
+            }
+        }
+
+        /// <summary>
+        /// 检查相关结果
+        /// </summary>
+        public List<SystemCheckResultItem> ResultItems { get; set; }
+    }
+}

+ 78 - 0
MBI/SAGA.GplotRelationComputerManage/SystemChecks/Model/SystemCheckResultItem.cs

@@ -0,0 +1,78 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:SystemCheckResultItem
+ * 作者:xulisong
+ * 创建时间: 2019/2/28 9:52:50
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using SAGA.DotNetUtils.WPF;
+
+namespace SAGA.GplotRelationComputerManage.SystemChecks
+{
+    public class SystemCheckResultItem: BasePropertyChanged
+    {
+        private string m_Id;
+        /// <summary>
+        /// 报表Id
+        /// </summary>
+        public string Id
+        {
+            get { return this.m_Id; }
+            set
+            {
+                this.m_Id = value;
+                RaisePropertyChanged(nameof(this.Id));
+            }
+        }
+
+
+        private string m_FloorId;
+        /// <summary>
+        /// 楼层Id
+        /// </summary>
+        public string FloorId
+        {
+            get { return this.m_FloorId; }
+            set
+            {
+                this.m_FloorId = value;
+                RaisePropertyChanged(nameof(this.FloorId));
+            }
+        }
+
+
+        private string m_GplotType;
+        /// <summary>
+        /// 拓扑类型Id
+        /// </summary>
+        public string GplotType
+        {
+            get { return this.m_GplotType; }
+            set
+            {
+                this.m_GplotType = value;
+                RaisePropertyChanged(nameof(this.GplotType));
+            }
+        }
+
+
+        private string  m_BuildingTime;
+        /// <summary>
+        /// 创建时间
+        /// </summary>
+        public string  BuildingTime
+        {
+            get { return this.m_BuildingTime; }
+            set
+            {
+                this.m_BuildingTime = value;
+                RaisePropertyChanged(nameof(this.BuildingTime));
+            }
+        }
+    }
+}

+ 5 - 0
MBI/SAGA.MBI/DataArrange/DalModeFileManange.cs

@@ -179,8 +179,13 @@ namespace SAGA.MBI.DataArrange
                     }
                     parenttree = floorTree;
                 }
+
                 if (tree != null)
+                {
                     tree = parenttree;
+                    break;
+                }
+                   
             }
             return tree;
         }

+ 1 - 3
MBI/SAGA.MBI/SAGA.MBI.csproj

@@ -1105,9 +1105,7 @@
       <Install>false</Install>
     </BootstrapperPackage>
   </ItemGroup>
-  <ItemGroup>
-    <Folder Include="SystemCheck\" />
-  </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
     <PreBuildEvent>

+ 2 - 0
MBI/SAGA.MBIAssistData/SAGA.MBIAssistData.csproj

@@ -70,6 +70,8 @@
     <Compile Include="BLL\DutyBIMRelation.cs" />
     <Compile Include="DAL\DutyBIMRelation.cs" />
     <Compile Include="Model\DutyBIMRelation.cs" />
+    <Compile Include="Model\SystemCheckReport.cs" />
+    <Compile Include="Model\SystemCheckResult.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>