duheng
2024-12-24 5f9570f243c7744b9e13c1a63506e7587a047b1d
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/00-core/AssetsMatchingHelper.cs
@@ -846,12 +846,12 @@
            }
            Vmo.AssetsFourlinkMainVmo vmo = null;
            var nameMatching = fourLinkVmos.Where(x =>
    (x.KeyWord != null && x.KeyWord.Any(keyword => GetIntersect(keyword, input.ModelType) >= 1)) ||
    (x.KeyWord == null || !x.KeyWord.Any()) && GetIntersect(x.Name, input.ModelType) >= 1
    (x.KeyWords != null && x.KeyWords.Any(keyword => GetIntersect(keyword, input.ModelType) >= 1)) ||
    (x.KeyWords == null || !x.KeyWords.Any()) && GetIntersect(x.Name, input.ModelType) >= 1
    ) //先进行筛选,后进行从大到小排序
    .OrderByDescending(x =>
     (x.KeyWord != null && x.KeyWord.Any(keyword => GetIntersect(keyword, input.ModelType) >= 1)) ||
     (x.KeyWord == null || !x.KeyWord.Any()) && GetIntersect(x.Name, input.ModelType) >= 1).ToList();
     (x.KeyWords != null && x.KeyWords.Any(keyword => GetIntersect(keyword, input.ModelType) >= 1)) ||
     (x.KeyWords == null || !x.KeyWords.Any()) && GetIntersect(x.Name, input.ModelType) >= 1).ToList();
            if (nameMatching.Count > 1)
            {
@@ -1842,27 +1842,27 @@
                }
            }
            var flowmeter = dict.OrderBy(x => x.Value).LastOrDefault().Key;
            input.MatchingDbId = flowmeter.ID.ToString();
            var elbow = dict.OrderBy(x => x.Value).LastOrDefault().Key;
            input.MatchingDbId = elbow.ID.ToString();
            if (string.IsNullOrEmpty(input.ModelType))
            {
                input.MatchingModelType = flowmeter.Name;
                input.MatchingModelType = elbow.Name;
            }
            if (input.MinorLoss <= 0)
            if (input.MinorLoss <= 0 || input.MinorLoss == null)
            {
                input.MatchingMinorLoss = flowmeter.MinorLoss;
                input.MatchingMinorLoss = elbow.MinorLoss;
            }
            if (input.BendingAngle <= 0)
            if (input.BendingAngle <= 0 || input.BendingAngle == null)
            {
                input.MatchingBendingAngle = flowmeter.Angle;
                input.MatchingBendingAngle = elbow.Angle;
            }
            input.MatchingElbowType = (Yw.WinFrmUI.eElbowType)(int)flowmeter.ElbowType;
            input.MatchingElbowType = (Yw.WinFrmUI.eElbowType)(int)elbow.ElbowType;
            if (input.Material == null || input.Material == string.Empty)
            {
                input.MatchingMaterial = flowmeter.Material;
                input.MatchingMaterial = elbow.Material;
            }
            if (!input.Caliber.HasValue)
                input.MatchingCaliber = flowmeter.Caliber;
                input.MatchingCaliber = elbow.Caliber;
            return true;
        }