Przeglądaj źródła

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

xulisong 6 lat temu
rodzic
commit
d7a0491ce9

+ 1 - 0
MBI/SAGA.MBI/DataArrange/DalCommon.cs

@@ -447,6 +447,7 @@ namespace SAGA.MBI.DataArrange
             if (rbase == null)
             {
                 string floorId = bimId.GetFloorId();
+                if (floorId.IsNullOrEmpty()) return rbase;
                 string buildingId = DalProjectTree.GetBuildingIdByFloor(floorId);
                 m_AllRevitObjects = CommonConvert.CacheAllData(buildingId);
                 rbase = m_AllRevitObjects.FirstOrDefault(t => t.BimID == bimId);

+ 1 - 0
MBI/SAGA.MBI/DataArrange/DalSpace.cs

@@ -90,6 +90,7 @@ namespace SAGA.MBI.DataArrange
         {
             MISpace mSpace = null;
             var spaceId = RelationConvert.GetSpaceByRelationElementInSpace(equipId);
+
             mSpace = DalCommon.QueryObjectById(spaceId) as MISpace;
             return mSpace;
         }

+ 3 - 1
MBI/SAGA.MBI/Extend/StringExtend.cs

@@ -56,6 +56,7 @@ namespace SAGA.MBI.Tools
         /// <returns></returns>
         public static bool IsOnlyDutyNoModelBIMID(this string cbimId)
         {
+            if (cbimId == null) return true;
             var strs = cbimId.Split(':');
             return strs.Length != 2;
         }
@@ -66,7 +67,8 @@ namespace SAGA.MBI.Tools
         /// <returns></returns>
         public static string GetFloorId(this string cbimId)
         {
-            string bimId = cbimId;
+            if (cbimId == null) return cbimId;
+            string bimId = "";
             var strs = cbimId.Split(':');
             if (strs.Length > 1)
                 bimId = strs[0];

+ 1 - 0
MBI/SAGA.MBI/JsonConvert/CommonConvert.cs

@@ -193,6 +193,7 @@ namespace SAGA.MBI.RequestData
         /// <returns></returns>
         public static MRevitEquipBase QueryObjectById(string id)
         {
+            if (id.IsNullOrEmpty()) return null;
             string json = CommonRequest.QueryObjectById(id);
             if (!json.IsRequestHasItem()) return null;
             JObject jObject = JObject.Parse(json);

+ 1 - 1
MBI/SAGA.MBI/ToolsData/CorrectLossDuty.cs

@@ -170,7 +170,7 @@ namespace SAGA.MBI.ToolsData
             {
                 context.MEquipmentParts.Remove(equip);
             }
-            var nobimdutyBeacons = context.MBeacons.Where(t => t.BimID.IsOnlyDutyNoModelBIMID()).ToList();
+            var nobimdutyBeacons = context.MBeacons.Where(t =>  t.BimID.IsOnlyDutyNoModelBIMID()).ToList();
             foreach (var equip in nobimdutyBeacons)
             {
                 context.MBeacons.Remove(equip);

+ 5 - 3
MBI/SAGA.MBI/ToolsData/DataCheck/BIMDuplicationCheck.cs

@@ -87,8 +87,10 @@ namespace SAGA.MBI.ToolsData.DataCheck
             try
             {
                 string bimid = group.Key;
-                string revitId=bimid.GetBIMID().ToString();
+                var revitId=bimid.GetBIMID();
+                if (revitId == 0) return list;
                 string floorId = bimid.GetFloorId();
+                if (floorId.IsNullOrEmpty()) return list;
                 string floorName = DalProjectTree.GetFloorNameByFloorId(floorId);
                 foreach (MRevitEquipBase equipBase in group)
                 {
@@ -96,14 +98,14 @@ namespace SAGA.MBI.ToolsData.DataCheck
                     result.FloorName = floorName;
                     result.DutyId = equipBase.Id;
                     result.DutyName = equipBase.ToString();
-                    result.BIMID = revitId;
+                    result.BIMID = revitId.ToString();
                     result.IsRight = false;
                     list.Add(result);
                 }
             }
             catch (Exception e)
             {
-                Console.WriteLine(e);
+                MessageShowBase.Show(e);;
             }
             finally
             {

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

@@ -61,6 +61,7 @@ namespace SAGA.MBI.ToolsData.DataCheck
             var floors = DalProjectTree.GetSelectedFloors(true);
             foreach (var mfloor in floors)
             {
+                if (mfloor.IsMissFile) continue;
                 Results.AddRange(GetCheckResult(mfloor));
             }
             return Results.All(t => t.IsRight);

+ 4 - 1
MBI/SAGA.MBI/WinView/ModeInfoMaintenance/VMMatchFM.cs

@@ -424,6 +424,8 @@ namespace SAGA.MBI.WinView.ModeInfoMaintenance
                 NotifyPropertyChanged("FMList");
             }
         }
+        //所在空间Id,避免为Null时重复请求
+        private string m_EquipSpaceId;
         public RecommendFMData(List<MEquipFM> list, MRevitEquipBase equip, string floorName)
         {
             FloorName = floorName;
@@ -432,6 +434,7 @@ namespace SAGA.MBI.WinView.ModeInfoMaintenance
             //1.a,如果有值,过滤没有关联岗位的。
             //1.b,1.a有值,推荐1.a;没有值,推荐1;
             //2,1没有值,按方案2过滤
+            m_EquipSpaceId = equip.MSpace?.Id;
             var tempList = list.Where(t => IsMathPlan1(t, equip)).ToList();
             if (tempList.Any())
             {
@@ -517,7 +520,7 @@ namespace SAGA.MBI.WinView.ModeInfoMaintenance
         {
             bool result = false;
             string fmSpaceId = equipFm.SpaceId;
-            string equipSpaceId = equip.MSpace?.Id;
+            string equipSpaceId = m_EquipSpaceId;
             if (fmSpaceId.IsNotNullEmpty() && equipSpaceId.IsNotNullEmpty())
             {
                 result = fmSpaceId == equipSpaceId;