lixiaojun
2025-03-02 4ce9d8c856dc2f0e580e92b74f399c80f27f080a
Service/HStation.Service.Revit.Core/04-service/01-json/RevitJsonHelper.cs
@@ -21,8 +21,8 @@
                msg = "Revit json 字符串为空";
                return default;
            }
            try
            {
            //try
            //{
                var model = new Model.RevitModel();
                //解析结构json
@@ -260,12 +260,12 @@
                }
                return model;
            }
            catch (Exception ex)
            {
                msg = ex.Message;
                return default;
            }
            //}
            //catch (Exception ex)
            //{
            //    msg = ex.Message;
            //    return default;
            //}
        }
@@ -3748,19 +3748,6 @@
            #endregion
            #region CurrentFlow
            if (jobject[RevitJsonProp.CurrentFlow].MatchNumeric(out double currentFlow))
            {
                flowmeter.CurrentFlow = currentFlow;
            }
            else
            {
                flowmeter.UpdatePropStatus(nameof(flowmeter.CurrentFlow), ePropStatus.Abnormal, "[流量信息]缺少或者数据格式错误");
            }
            #endregion
            return flowmeter;
        }
@@ -3988,19 +3975,6 @@
            #endregion
            #region CurrentPress
            if (jobject[RevitJsonProp.CurrentPress].MatchNumeric(out double currentPress))
            {
                pressmeter.CurrentPress = currentPress;
            }
            else
            {
                pressmeter.UpdatePropStatus(nameof(pressmeter.CurrentPress), ePropStatus.Abnormal, "[压力信息]缺少或者数据格式错误");
            }
            #endregion
            return pressmeter;
        }
@@ -4066,7 +4040,7 @@
            if (jobject.ParseString(RevitJsonProp.Flags, out string flags))
            {
                pipe.Flags = RevitFlagsHelper.ToList(flags);
                pipe.Flags = FlagsHelper.ToList(flags);
                if (!string.IsNullOrEmpty(flags))
                {
                    if (pipe.Flags == null || pipe.Flags.Count < 1)
@@ -4572,51 +4546,6 @@
            else
            {
                translation.UpdatePropStatus(nameof(translation.Material), ePropStatus.Abnormal, "缺少[材质信息]");
            }
            #endregion
            #region Diameter
            if (jobject[RevitJsonProp.DiameterInfo].MatchNumeric(out double diameter))
            {
                translation.Diameter = diameter;
            }
            else
            {
                translation.UpdatePropStatus(nameof(translation.Diameter), ePropStatus.Abnormal, "[直径信息]缺少或者格式错误");
            }
            if (translation.Diameter < 1)
            {
                if (jobject[RevitJsonProp.InternalDiameter].MatchNumeric(out double internalDiameter))
                {
                    translation.Diameter = internalDiameter;
                    translation.UpdatePropStatus(nameof(translation.Diameter), ePropStatus.Lack, "[直径信息]通过[内径]进行修复]");
                }
                else
                {
                    translation.UpdatePropStatus(nameof(translation.Diameter), ePropStatus.Abnormal, "[直径信息]无法通过[内径]进行修复]");
                }
            }
            if (translation.Diameter < 1)
            {
                if (jobject[RevitJsonProp.DN].MatchNumeric(out double dn))
                {
                    translation.Diameter = dn;
                    translation.UpdatePropStatus(nameof(translation.Diameter), ePropStatus.Lack, "[直径信息]通过[公称直径]进行修复]");
                }
                else
                {
                    translation.UpdatePropStatus(nameof(translation.Diameter), ePropStatus.Abnormal, "[直径信息]无法通过[公称直径]进行修复]");
                }
            }
            if (translation.Diameter < 1)
            {
                translation.Diameter = 500;
                translation.UpdatePropStatus(nameof(translation.Diameter), ePropStatus.Lack, "[直径信息][内径]解析错误,使用默认值(500mm)修正]");
            }
            #endregion
@@ -5728,6 +5657,11 @@
                {
                    exchanger.Elev = elevOfElevation / 1000f;
                    var jre = jobject[RevitJsonProp.Elev];
                    if (!jre.HasValues)
                    {
                    }
                    if (jre != null)
                    {
                        if (jre.HasValues)