Browse Source

Merge branch 'master' of http://dev.dp.sagacloud.cn:8886/r/Revit/SAGA.MBI

xulisong 6 năm trước cách đây
mục cha
commit
d9cfeacf77

BIN
MBI/MBIResource/DataCheck/垃圾数据检查结果输出-模版.xlsx


BIN
MBI/MBIResource/DataCheck/模型检查结果输出格式-模版.xlsx


+ 105 - 0
MBI/Menu/MBITool.xml

@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Menus>
+  <App>
+    <AppIndex>1</AppIndex>
+    <AppName>SAGA</AppName>
+  </App>
+  <Tab TabName="工具">
+    <MenuTab>MBITool_W</MenuTab>
+    <Modules>MBITool</Modules>
+  </Tab>
+  <Panel PanelName="数据修正" GroupFlag="True" GroupImage="" RevitVer="R14,R15,R16,R17"  ButtonStyles="Large">
+    
+    <Button ButtonStyles="Large">
+      <ButtonName>SAGA.MBI.CheckCloudAndLocalFamilyCommand</ButtonName>
+      <ButtonText>同步族类型</ButtonText>
+      <ImageName>1、打开楼层模型</ImageName>
+      <DllName>..\OutputDll\SAGA.MBI.exe</DllName>
+      <ClassName>SAGA.MBI.CheckCloudAndLocalFamilyCommand</ClassName>
+      <ToolTip>处理云平台和物理世界族类型不同步的问题。</ToolTip>
+      <LongDescription>处理云平台和物理世界族类型不同步的问题。</LongDescription>
+      <ToolTipImage></ToolTipImage>
+      <MenuTab>MBITool_W</MenuTab>
+      <Modules>MBITool</Modules>
+    </Button>
+  
+    <Button ButtonStyles="Large">
+      <ButtonName>SAGA.MBI.AddEquipLocationCommand</ButtonName>
+      <ButtonText>更新所有楼层设备的坐标信息</ButtonText>
+      <ImageName>1、打开楼层模型</ImageName>
+      <DllName>..\OutputDll\SAGA.MBI.exe</DllName>
+      <ClassName>SAGA.MBI.AddEquipLocationCommand</ClassName>
+      <ToolTip>更新所有楼层设备的坐标信息</ToolTip>
+      <LongDescription>更新所有楼层设备的坐标信息</LongDescription>
+      <ToolTipImage></ToolTipImage>
+      <MenuTab>MBITool_W</MenuTab>
+      <Modules>MBITool</Modules>
+    </Button>
+    <Button ButtonStyles="Large">
+      <ButtonName>SAGA.MBI.ExportMbiModelCommand</ButtonName>
+      <ButtonText>上传jsonZ文件</ButtonText>
+      <ImageName>2、模型文件管理</ImageName>
+      <DllName>..\OutputDll\SAGA.MBI.exe</DllName>
+      <ClassName>SAGA.MBI.ExportMbiModelCommand</ClassName>
+      <ToolTip>模型文件管理。</ToolTip>
+      <LongDescription>模型文件管理。</LongDescription>
+      <ToolTipImage></ToolTipImage>
+      <MenuTab>MBITool_W</MenuTab>
+      <Modules>MBITool</Modules>
+    </Button>
+    <Button ButtonStyles="Large">
+      <ButtonName>SAGA.MBI.CheckEquipinFloorCommand</ButtonName>
+      <ButtonText>更新设备所在楼层关系</ButtonText>
+      <ImageName>1、打开楼层模型</ImageName>
+      <DllName>..\OutputDll\SAGA.MBI.exe</DllName>
+      <ClassName>SAGA.MBI.CheckEquipinFloorCommand</ClassName>
+      <ToolTip>更新设备所在楼层关系。</ToolTip>
+      <LongDescription>更新设备所在楼层关系。</LongDescription>
+      <ToolTipImage></ToolTipImage>
+      <MenuTab>MBITool_W</MenuTab>
+      <Modules>MBITool</Modules>
+    </Button>
+    <Button ButtonStyles="Large">
+      <ButtonName>SAGA.MBI.CorrectLossDutyCommand</ButtonName>
+      <ButtonText>修正有模型但没有岗位问题</ButtonText>
+      <ImageName>1、打开楼层模型</ImageName>
+      <DllName>..\OutputDll\SAGA.MBI.exe</DllName>
+      <ClassName>SAGA.MBI.CorrectLossDutyCommand</ClassName>
+      <ToolTip>修正有模型但没有岗位问题。</ToolTip>
+      <LongDescription>修正有模型但没有岗位问题。</LongDescription>
+      <ToolTipImage></ToolTipImage>
+      <MenuTab>MBITool_W</MenuTab>
+      <Modules>MBITool</Modules>
+    </Button>
+  </Panel>
+  <Panel PanelName="工具" GroupFlag="True" GroupImage="" RevitVer="R14,R15,R16,R17"  ButtonStyles="Large">
+
+    <Button ButtonStyles="Large">
+      <ButtonName>SAGA.MBI.ExportEquipNotInSpaceCommand</ButtonName>
+      <ButtonText>没有在空间的设备</ButtonText>
+      <ImageName>1、打开楼层模型</ImageName>
+      <DllName>..\OutputDll\SAGA.MBI.exe</DllName>
+      <ClassName>SAGA.MBI.ExportEquipNotInSpaceCommand</ClassName>
+      <ToolTip>导出没有在空间的设备。</ToolTip>
+      <LongDescription>导出没有在空间的设备。</LongDescription>
+      <ToolTipImage></ToolTipImage>
+      <MenuTab>MBITool_W</MenuTab>
+      <Modules>MBITool</Modules>
+    </Button>
+
+    <Button ButtonStyles="Large">
+      <ButtonName>SAGA.MBI.ExportCategoriesCommand</ButtonName>
+      <ButtonText>导出所有的设备类别</ButtonText>
+      <ImageName>1、打开楼层模型</ImageName>
+      <DllName>..\OutputDll\SAGA.MBI.exe</DllName>
+      <ClassName>SAGA.MBI.ExportCategoriesCommand</ClassName>
+      <ToolTip>更新设备所在楼层关系。</ToolTip>
+      <LongDescription>更新设备所在楼层关系。</LongDescription>
+      <ToolTipImage></ToolTipImage>
+      <MenuTab>MBITool_W</MenuTab>
+      <Modules>MBITool</Modules>
+    </Button>
+  </Panel>
+</Menus>
+<!--名称里面换行-->
+<!-- <ButtonText>扫楼App&#x000A;用户管理</ButtonText>-->

+ 1 - 1
MBI/SAGA.MBI/Command.cs

@@ -240,7 +240,7 @@ namespace SAGA.MBI
                 if (doc == null) return Result.Cancelled;
                 string floorId = doc.PathName.GetFileName();
                 WinMissFMList win = new WinMissFMList(floorId);
-                win.ShowDialog();
+                win.Show();
                 Log4Net.Debug("结束命令:未实体化模型清单");
             }
             catch (Exception e)

+ 2 - 1
MBI/SAGA.MBI/DataArrange/DalEquip.cs

@@ -60,7 +60,8 @@ namespace SAGA.MBI.DataArrange
             //model.BIMType = familyName + ";" + typeName;
 
             //model.LocalID = instance.GetParameterString("设备本地编码");
-            //model.LocalName = instance.GetParameterString("设备本地名称");
+            //Revit族名称
+            mode.RevitFamilyName = elem.GetFamily().Name;
 
             //dic.Add("Length", (instance.GetBoxLength() / 1000).Round(3));
             //dic.Add("Width", (instance.GetBoxWidth() / 1000).Round(3));

+ 9 - 9
MBI/SAGA.MBI/DataArrange/DalProjectTree.cs

@@ -71,9 +71,9 @@ namespace SAGA.MBI.DataArrange
         /// </summary>
         /// <param name="id"></param>
         /// <returns></returns>
-        public static Dictionary<string,string> GetFloorNameAndId()
+        public static Dictionary<string, string> GetFloorNameAndId()
         {
-            Dictionary<string,string> pair=new Dictionary<string, string>();
+            Dictionary<string, string> pair = new Dictionary<string, string>();
             TreeNodeItem tree = null;
             foreach (TreeNodeItem buildingTree in MBIControl.ProjectTree.Children)
             {
@@ -81,7 +81,7 @@ namespace SAGA.MBI.DataArrange
                 {
                     if (floorTree.Item is MFloor floor)
                     {
-                       pair.Add(floor.Id,floor.ToString());
+                        pair.Add(floor.Id, floor.ToString());
 
                     }
                 }
@@ -130,17 +130,17 @@ namespace SAGA.MBI.DataArrange
         /// 获取树结点下的楼层
         /// </summary>
         /// <param name="isContainMissFile">是否包含缺少模型文件的楼层</param>
-        public static List<MFloor> GetAllFloors(bool isContainMissFile=true)
+        public static List<MFloor> GetAllFloors(bool isContainMissFile = true)
         {
             var floors = DalModeFileManange.GetAllFloors(MBIControl.ProjectTree);
-            return isContainMissFile?floors:floors.Where(t=>!t.IsMissFile).ToList();
+            return isContainMissFile ? floors : floors.Where(t => !t.IsMissFile).ToList();
         }
         /// <summary>
         /// 获取选择建筑的所有楼层
         /// </summary>
         /// <param name="isOnlyPermission">仅获取有权限的楼层</param>
         /// <returns></returns>
-        public static List<MFloor> GetSelectedFloors()
+        public static List<MFloor> GetSelectedFloors(bool allchild = false)
         {
             List<MFloor> floors = new List<MFloor>();
             foreach (TreeNodeItem buildingTree in MBIControl.ProjectTree.Children)
@@ -150,7 +150,8 @@ namespace SAGA.MBI.DataArrange
                 {
                     foreach (TreeNodeItem floorTree in buildingTree.Children)
                     {
-                        if (!floorTree.IsSelected) continue;
+                        if (!allchild)
+                            if (!floorTree.IsSelected) continue;
                         if (floorTree.Item is MFloor floor)
                         {
                             floors.Add(floor);
@@ -163,7 +164,6 @@ namespace SAGA.MBI.DataArrange
         /// <summary>
         /// 获取选择建筑
         /// </summary>
-        /// <param name="isOnlyPermission">仅获取有权限的楼层</param>
         /// <returns></returns>
         public static MBuilding GetSelectedBuilding()
         {
@@ -171,7 +171,7 @@ namespace SAGA.MBI.DataArrange
             foreach (TreeNodeItem buildingTree in MBIControl.ProjectTree.Children)
             {
                 if (!buildingTree.IsSelected) continue;
-                if (buildingTree.Item is MBuilding )
+                if (buildingTree.Item is MBuilding)
                 {
                     building = buildingTree.Item as MBuilding;
                 }

+ 2 - 4
MBI/SAGA.MBI/DataArrange/DalSpace.cs

@@ -74,10 +74,8 @@ namespace SAGA.MBI.DataArrange
         {
             string defaultName = space.Name;
             var roomname = space.GetParameterString(BuiltInParameter.ROOM_NAME);
-            if (roomname != "空间"&& roomname.IsNotNullEmptyExt())
-            {
-                defaultName = roomname;
-            }
+            if (roomname == "空间" || roomname.IsNullOrEmptyExt()) return defaultName;
+            defaultName = roomname;
             return defaultName;
         }
     }

+ 14 - 10
MBI/SAGA.MBI/JsonConvert/QRCodeConvert.cs

@@ -28,22 +28,26 @@ namespace SAGA.MBI.RequestData
         /// </summary>
         /// <param name="fmid">资产id</param>
         /// <returns></returns>
-        public static MQRCode QueryQRCodeList(string fmid)
+        public static List<MQRCode> QueryQRCodeList(List<string> fmids)
         {
-            MQRCode qrcode = null;
-            string json = QRCodeRequest.QueryQRCodeList(fmid);
+            List<MQRCode> list = new List<MQRCode>();
+
+            string json = QRCodeRequest.QueryQRCodeList(fmids);
             if (json.IsRequestHasItem())
             {
                 JObject jObject = JObject.Parse(json);
-                JObject qrJObject = (JObject) jObject["Content"][0];
-                qrcode=new MQRCode();
-                qrcode.QRKey = qrJObject.GetValueEx("key");
-                qrcode.FmId = qrJObject.GetValueEx("fmId");
-                qrcode.ObjectId = qrJObject.GetValueEx("objId");
-                qrcode.ProjectId = qrJObject.GetValueEx("proId");
+                foreach (JObject qrJObject in jObject["Content"])
+                {
+                    var qrcode = new MQRCode();
+                    qrcode.QRKey = qrJObject.GetValueEx("key");
+                    qrcode.FmId = qrJObject.GetValueEx("fmId");
+                    qrcode.ObjectId = qrJObject.GetValueEx("objId");
+                    qrcode.ProjectId = qrJObject.GetValueEx("proId");
+                    list.Add(qrcode);
+                }
             }
 
-            return qrcode;
+            return list;
         }
     }
 }

+ 2 - 0
MBI/SAGA.MBI/Model/MRevitEquipBase.cs

@@ -65,6 +65,8 @@ namespace SAGA.MBI.Model
         #region AttachProperty
         //是否上传
         public bool HasUpload { get; set; }
+        //设备族名称
+        public string RevitFamilyName { get; set; }
         //设备类编码
         public string EquipClassCode { get; set; }
         //设备类名称

+ 3 - 3
MBI/SAGA.MBI/RequestData/QRCodeRequest.cs

@@ -25,12 +25,12 @@ namespace SAGA.MBI.RequestData
         /// </summary>
         /// <param name="fmid">资产id</param>
         /// <returns></returns>
-        public static string QueryQRCodeList(string fmid)
+        public static string QueryQRCodeList(List<string> fmids)
         {
-            string url = MBIConst.SaasLocalHost + $"qrcode/restQRCodeService/queryQRCodeList";
+            string url = MBIConst.SaasLocalHost + $"qrcode/restQRCodeService/queryQRCodeByFmIds";
             JObject jObject = new JObject();
             jObject.Add("user_id", MBIControl.ManageInfo.Person_Id);
-            jObject.Add("fmId", fmid);
+            jObject.Add("fmIds", new JArray(fmids.ToArray()));
             jObject.Add("valid", "1");
 
             string postData = jObject.ToString();

+ 4 - 3
MBI/SAGA.MBI/ToolsData/CheckBase/CheckOperation.cs

@@ -31,12 +31,12 @@ namespace SAGA.MBI.ToolsData.CheckBase
             List<ICheckBase> list = new List<ICheckBase>();
             switch (type)
             {
-                case CheckType.DataCheck:
-                    list = GetDataCheckItems();
-                    break;
                 case CheckType.ModeCheck:
                     list = GetModeCheckItems();
                     break;
+                case CheckType.DataCheck:
+                    list = GetDataCheckItems();
+                    break;
             }
             return list;
         }
@@ -77,6 +77,7 @@ namespace SAGA.MBI.ToolsData.CheckBase
             List<DataCheckBase> list = new List<DataCheckBase>();
             list.Add(new DutyFMInfoCheck());
             list.Add(new QRCodeContextCheck());
+            list.Add(new MissDutyOrMode());
             list.ForEach(t =>
             {
                 t.RIsChecked = true;

+ 17 - 4
MBI/SAGA.MBI/ToolsData/CorrectLossDuty.cs

@@ -60,13 +60,26 @@ namespace SAGA.MBI.ToolsData
         /// <returns></returns>
         private static void Operate(MFloor floor)
         {
-            //Traceloger.Show();
+            var tuple = GetCheckResult(floor);
+            //分组
+            var beaddContext = tuple.Item1;
+            var bedelContext = tuple.Item2;
+            RebuildCloudData(bedelContext, beaddContext);
+        }
+        /// <summary>
+        /// 获取需要增加或删除的内容
+        /// Item1增加,Item2删除
+        /// </summary>
+        /// <param name="floor"></param>
+        /// <returns></returns>
+        public static Tuple<CalcContext,CalcContext> GetCheckResult(MFloor floor)
+        {
             var oldContext = DalCommon.DownLoadCouldData(floor);
             var newContext = ObjectCalc.Calc(floor);
             //分组
-            var bedelContext = DalModeFileManange.GetDelContext(oldContext, newContext,true);
-            var beaddContext = DalModeFileManange.GetAddContext(oldContext, newContext,true);
-            RebuildCloudData(bedelContext, beaddContext);
+            var beaddContext = DalModeFileManange.GetAddContext(oldContext, newContext, true);
+            var bedelContext = DalModeFileManange.GetDelContext(oldContext, newContext, true);
+            return new Tuple<CalcContext, CalcContext>(beaddContext,bedelContext);
         }
         /// <summary>
         /// 重建物理世界有问题的数据

+ 1 - 0
MBI/SAGA.MBI/ToolsData/DataCheck/DataCheckBase.cs

@@ -28,6 +28,7 @@ namespace SAGA.MBI.ToolsData.DataCheck
         public void Check2(CheckContext context)
         {
             Context = context;
+            if (!RIsChecked) return;
             Check();
         }
 

+ 4 - 1
MBI/SAGA.MBI/ToolsData/DataCheck/DutyFMInfoCheck.cs

@@ -94,7 +94,8 @@ namespace SAGA.MBI.ToolsData.DataCheck
             }
             return result;
         }
-
+        //忽略的信息点
+        private List<string> m_IgnoreList=new List<string>(){ "EquipID" ,"EquipName"};
         private DutyFMInfoCheckResult GetCheckResult(MRevitEquipBase duty, MEquipFM fm)
         {
             DutyFMInfoCheckResult result = null;
@@ -109,6 +110,8 @@ namespace SAGA.MBI.ToolsData.DataCheck
                 foreach (KeyValuePair<string, JToken> pair in dutyJObject)
                 {
                     string key = pair.Key;
+                    //不检查的信息点
+                    if(m_IgnoreList.Contains(key))continue;
                     string dutyValue = pair.Value.ToString();
                     string fmValue = fmJObject.GetValueEx(key);
                     if (dutyValue.IsNotNullEmptyExt() && fmValue.IsNotNullEmptyExt() && !dutyValue.Equals(fmValue))

+ 60 - 81
MBI/SAGA.MBI/ToolsData/DataCheck/MissDutyOrModeCheck.cs

@@ -15,6 +15,7 @@ using Newtonsoft.Json.Linq;
 using NPOI.SS.UserModel;
 using SAGA.DotNetUtils.Extend;
 using SAGA.DotNetUtils.Others;
+using SAGA.MBI.Calc;
 using SAGA.MBI.DataArrange;
 using SAGA.MBI.JsonConvert;
 using SAGA.MBI.Model;
@@ -49,92 +50,85 @@ namespace SAGA.MBI.ToolsData.DataCheck
 
         #region CheckMethod
         /// <summary>
-        /// 缓存建筑下的所有岗位信息
-        /// </summary>
-        /// <returns></returns>
-        private List<MRevitEquipBase> CacheBuildingDutys()
-        {
-            return CommonConvert.CacheEqEc(this.Context.BuildingId);
-        }
-        /// <summary>
-        /// 缓存 建筑下的所有资产
-        /// </summary>
-        /// <returns></returns>
-        private List<MEquipFM> CacheBuildingFMs()
-        {
-            return MatchFMConvert.GetAllEquipFmFromScanBuilding(this.Context.BuildingId); ;
-        }
-        /// <summary>
         /// 对比信息点是否一致
         /// </summary>
         /// <returns></returns>
         private bool GetCheckResult()
-        {
+        {            
             bool result = true;
-            string buildingId = this.Context.BuildingId;
-            if (buildingId.IsNullOrEmptyExt())
+            var floors = DalProjectTree.GetSelectedFloors(true);
+            foreach (var mfloor in floors)
             {
-                result = false;
-                return result;
-            }
-            var dutys = CacheBuildingDutys();
-            var fms = CacheBuildingFMs();
-            foreach (var duty in dutys)       {
-                while (true)
-                {
-                    string fmid = duty.FMID;
-                    if (fmid.IsNullOrEmptyExt()) break;
-                    var fm = fms.FirstOrDefault(t => t.Id == fmid);
-                    if (fm == null) break;
-                    var rs = GetCheckResult(duty,fm);
-                    if (rs == null) break;
-                    Results.Add(rs);
-                    break;
-                }
+                Results.AddRange(GetCheckResult(mfloor));
             }
             return result;
         }
 
-        private DutyFMInfoCheckResult GetCheckResult(MRevitEquipBase duty, MEquipFM fm)
+        private List<MissDutyOrModeCheckResult> GetCheckResult(MFloor mFloor)
         {
-            DutyFMInfoCheckResult result = null;
+            List<MissDutyOrModeCheckResult> list = new List<MissDutyOrModeCheckResult>();
+
             try
             {
-                var dutyJObject = duty.CloundJObject;
-                var fmJson = fm.FMJson;
-                var fmJObject = JObject.Parse(fmJson);
+                var tuple = CorrectLossDuty.GetCheckResult(mFloor);
+                list.AddRange(GetCheckResult(tuple.Item1,true));
+                list.AddRange(GetCheckResult(tuple.Item2,false));
+            }
+            catch (Exception e)
+            {
+            }
+            return list;
+        }
 
-                PropertyDefineTb pdtb = PEPCodeConvert.GetPropertyDefineTb(duty.EquipClassCode);
-                StringBuilder sb = new StringBuilder();
-                foreach (KeyValuePair<string, JToken> pair in dutyJObject)
+        private List<MissDutyOrModeCheckResult> GetCheckResult(CalcContext calcContext,bool isadd)
+        {
+            List<MissDutyOrModeCheckResult> list = new List<MissDutyOrModeCheckResult>();
+            try
+            {
+                //if (isadd)
+                //{
+                //    calcContext.OpenDocument();
+                //}
+                Action<List<MRevitEquipBase>, List<MissDutyOrModeCheckResult>> convetAction = (dutys, l) =>
                 {
-                    string key = pair.Key;
-                    string dutyValue = pair.Value.ToString();
-                    string fmValue = fmJObject.GetValueEx(key);
-                    if (dutyValue.IsNotNullEmptyExt() && fmValue.IsNotNullEmptyExt() && !dutyValue.Equals(fmValue))
+                    foreach (var duty in dutys)
                     {
-                        var define = pdtb.PropertyDefineItems.FirstOrDefault(t => t.CodeName == key);
-                        sb.Append($"{define?.Name??key}、");
+                        MissDutyOrModeCheckResult result = new MissDutyOrModeCheckResult();
+                        result.FloorName = calcContext.MFloor.ToString();
+                        result.IsRight = false;
+                        if (isadd)
+                        {
+                            result.BIMID = duty.BimID.GetBIMID().ToString();
+                            result.RMessage = "无岗位,在模型中有可识别构件";
+                        }
+                        else
+                        {
+                            result.DutyId = duty.Id;
+                            result.DutyName = duty.ToString();
+                            result.RMessage = "有岗位,在模型中找不到对应构件";
+                        }
+                        l.Add(result);
                     }
-                }
-                result = new DutyFMInfoCheckResult();
-                result.FloorName = DalProjectTree.GetFloorNameByFloorId(duty.FloorId);
-                result.DutyId = duty.Id;
-                result.DutyName = duty.ToString();
-                result.BIMID = duty.BimID.GetBIMID().ToString();
-                result.FMId = fm.Id;
-                result.FMName = fm.ToString();
-                result.IsRight = sb.Length == 0;
-                result.RMessage = result.IsRight ? "" : $"值不一致的信息点有:{sb}";
+                };
+                convetAction(calcContext.MEquipments.ToList<MRevitEquipBase>(), list);
+                convetAction(calcContext.MEquipmentParts.ToList<MRevitEquipBase>(), list);
+                convetAction(calcContext.MBeacons.ToList<MRevitEquipBase>(), list);
+                convetAction(calcContext.MSpaces.ToList<MRevitEquipBase>(), list);
             }
             catch (Exception e)
             {
-                return result;
+                Console.WriteLine(e);
             }
-            return result;
+            finally
+            {
+                //if (isadd)
+                //{
+                //    calcContext.CloseDocument();
+                //}
+            }
+            return list;
         }
 
-
         #endregion
 
         //[DataCheckProcessAspect]
@@ -149,31 +143,16 @@ namespace SAGA.MBI.ToolsData.DataCheck
 
                 #region 添加数据
                 int index = 3;
-                //添加 共检查XXX条数据,未通过检查的如下 提示
-                IRow rowTip = sheet.CreateRow(index - 1);
-                rowTip.AddCell(0, $"总检查{Results.Count}条数据,未通过检查的如下", DataCheckNPOIStyle.Title);
-                //IRow row4 = sheet.CreateRow(index);
-                //row4.HeightInPoints = 15;
-
-                //row4.AddCell(0, "楼层本地名称", DataCheckNPOIStyle.Title);
-                //row4.AddCell(1, "文件名", DataCheckNPOIStyle.Title);
-                //row4.AddCell(2, "文件地址", DataCheckNPOIStyle.Title);
-                //row4.AddCell(3, "族名称", DataCheckNPOIStyle.Title);
-                //row4.AddCell(4, "类型", DataCheckNPOIStyle.Title);
-                //row4.AddCell(5, "ID", DataCheckNPOIStyle.Title);
-                //row4.AddCell(6, "通过", DataCheckNPOIStyle.Title);
-                //row4.AddCell(7, "备注(失败原因)", DataCheckNPOIStyle.Title);
-                foreach (DutyFMInfoCheckResult result in Results)
+                
+                foreach (MissDutyOrModeCheckResult result in Results)
                 {
                     //数量过多,只显示有问题的
-                    if (result.IsRight) continue;
+                    //if (result.IsRight) continue;
                     index++;
                     IRow rowN = sheet.CreateRow(index);
                     DataCheckNPOIStyle style = result.IsRight ? DataCheckNPOIStyle.Content : DataCheckNPOIStyle.Error;
                     int i = 0;
                     rowN.AddCell(i++, result.FloorName, style);
-                    rowN.AddCell(i++, result.FMId, style);
-                    rowN.AddCell(i++, result.FMName, style);
                     rowN.AddCell(i++, result.DutyId, style);
                     rowN.AddCell(i++, result.DutyName, style);
                     rowN.AddCell(i++, result.BIMID, style);

+ 1 - 2
MBI/SAGA.MBI/ToolsData/DataCheck/MissDutyOrModeCheckResult.cs

@@ -16,8 +16,7 @@ namespace SAGA.MBI.ToolsData.DataCheck
         public string FloorName { get; set; }
         public string DutyId { get; set; }
         public string DutyName { get; set; }
-        public string FMId { get; set; }
-        public string FMName { get; set; }
         public string BIMID { get; set; }
+        public string FamilyName { get; set; }
     }
 }

+ 9 - 4
MBI/SAGA.MBI/ToolsData/DataCheck/QRCodeContextCheck.cs

@@ -70,12 +70,18 @@ namespace SAGA.MBI.ToolsData.DataCheck
                 return result;
             }
             var fms = CacheBuildingFMs();
+
+            var qrcodes = QRCodeConvert.QueryQRCodeList(fms.Select(t=>t.Id).ToList());
             foreach (var fm in fms)       {
                 while (true)
                 {
                     string dutyId = fm.EquipmentId;
                     if (dutyId.IsNullOrEmptyExt()) break;
-                    var rs = GetCheckResult(fm);
+
+                    var qrcode = qrcodes.FirstOrDefault(t=>t.FmId==fm.Id);
+                    if (qrcode == null) break;
+
+                    var rs = GetCheckResult(fm,qrcode);
                     if (rs == null) break;
                     Results.Add(rs);
                     break;
@@ -84,14 +90,13 @@ namespace SAGA.MBI.ToolsData.DataCheck
             return result;
         }
 
-        private QRCodeContextCheckResult GetCheckResult(MEquipFM fm)
+        private QRCodeContextCheckResult GetCheckResult(MEquipFM fm,MQRCode qrcode)
         {
             QRCodeContextCheckResult result = null;
             try
             {
-                string dutyId = fm.EquipmentId;
+                string dutyId = fm?.EquipmentId;
                 if (dutyId == null) return result;
-                var qrcode = QRCodeConvert.QueryQRCodeList(fm.Id);
                 if (qrcode == null) return result;
                 result = new QRCodeContextCheckResult();
                 result.QRKey = qrcode.QRKey;

+ 1 - 1
MBI/SAGA.MBI/ToolsData/DataCheck/WinDataCheckSetting.xaml

@@ -45,6 +45,7 @@
                             <HierarchicalDataTemplate ItemsSource="{Binding Path=Children}">
                                 <WrapPanel>
                                     <RadioButton IsChecked="{Binding Path=IsSelected,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
+                                                 GroupName="Treeview"
                                               Width="Auto" VerticalContentAlignment="Center" >
                                         <RadioButton.Visibility>
                                             <MultiBinding Converter="{StaticResource FloorRadioButtonVisibleConverter}">
@@ -59,7 +60,6 @@
                         <TreeView.ItemContainerStyle>
                             <Style TargetType="{x:Type TreeViewItem}">
                                 <Setter Property="IsExpanded" Value="True" />
-                                <Setter Property="IsSelected" Value="{Binding Path=IsSelected}"></Setter>
                             </Style>
                         </TreeView.ItemContainerStyle>
                     </TreeView>