From 74ce2df18a413aad8755802c2ff3d1379df59426 Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Sat, 13 Jun 2026 10:16:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(hjgl):=E5=A2=9E=E5=8A=A0=E4=BF=84=E6=A0=87?= =?UTF-8?q?=E7=84=8A=E8=AF=84=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/BLL/HJGL/WPQ/WPQListService.cs | 100 ++++++++++++++++++ .../CQMS/PersonManage/WelderItemEdit.aspx.cs | 2 +- 2 files changed, 101 insertions(+), 1 deletion(-) diff --git a/SGGL/BLL/HJGL/WPQ/WPQListService.cs b/SGGL/BLL/HJGL/WPQ/WPQListService.cs index f1ae2fc5..b31d3738 100644 --- a/SGGL/BLL/HJGL/WPQ/WPQListService.cs +++ b/SGGL/BLL/HJGL/WPQ/WPQListService.cs @@ -177,6 +177,17 @@ namespace BLL #region 匹配wpq public static List GetMatchWPQ(HJGL_WeldJoint jot, string projectid, string unitid) + { + return GetMatchWPQ_RU(jot, projectid, unitid); + } + /// + /// 国标匹配规则 + /// + /// + /// + /// + /// + public static List GetMatchWPQ_CN(HJGL_WeldJoint jot, string projectid, string unitid) { var pipe = BLL.PipelineService.GetPipelineByPipelineId(jot.PipelineId); var weldT = BLL.Base_WeldTypeService.GetWeldTypeByWeldTypeId(jot.WeldTypeId); @@ -411,6 +422,95 @@ namespace BLL } + /// + /// 俄罗斯标准匹配规则 + /// + /// + /// + /// + /// + public static List GetMatchWPQ_RU(HJGL_WeldJoint jot, string projectid, string unitid) + { + var pipe = BLL.PipelineService.GetPipelineByPipelineId(jot.PipelineId); + var weldT = BLL.Base_WeldTypeService.GetWeldTypeByWeldTypeId(jot.WeldTypeId); + string material1 = jot.Material1Id; + string material2 = jot.Material2Id; + decimal dia = jot.Dia.HasValue ? jot.Dia.Value : 0; + decimal sch = jot.Thickness.HasValue ? jot.Thickness.Value : 0; + string unitId = string.Empty; + if (unitid != Const._Null) + { + unitId = unitid; + } + else + { + unitId = pipe.UnitId; + } + + string weldType = string.Empty; + if (weldT != null) + { + weldType = weldT.WeldTypeCode; + } + + var mat1 = BLL.Base_MaterialService.GetMaterialByMaterialId(material1); + var mat2 = BLL.Base_MaterialService.GetMaterialByMaterialId(material2); + if (mat1.MaterialCode == "No matl" || mat2.MaterialCode == "No matl") //材质1或材质2有一种为无材质,则匹配不了wpq + { + return null; + } + int m1 = SNClass(mat1.MaterialClass); + int m2 = SNClass(mat2.MaterialClass); + + int g1 = SNGroup(mat1.MaterialGroup); + int g2 = SNGroup(mat2.MaterialGroup); + + string preGroup1 = PreGroup(mat1.MaterialGroup); + string preGroup2 = PreGroup(mat2.MaterialGroup); + List list = new List(); + // 单位、接头形式、材质的覆盖 + var wpq = from x in Funs.DB.View_HJGL_WPQ + where x.UnitId == unitId && x.State == BLL.Const.State_2 && x.ProjectId == projectid + //&& (x.JointType == "对接焊缝" || (x.JointType != "对接焊缝" && weldType != "B")) + //&& ((x.Material1Group == mat1.MaterialGroup && x.Material2Group == mat2.MaterialGroup) + //|| (x.Material1Group == mat2.MaterialGroup && x.Material2Group == mat1.MaterialGroup)) + select x; + + // 根据接头形式判断外径和壁厚的覆盖 + if (weldType.Contains("B")) + { + wpq = from x in wpq + where dia >= x.MinImpactDia && dia <= x.MaxImpactDia + && sch >= x.MinImpactThickness && sch <= x.MaxImpactThickness + select x; + } + else + { + wpq = from x in wpq + where dia >= x.MinCImpactDia && dia <= x.MaxCImpactDia + && sch >= x.NoMinImpactThickness && sch <= x.NoMaxImpactThickness + select x; + } + foreach (var item in wpq) + { + //与WPS一致(材1 = WPS材1,且材2 = WPS材2或材2 = WPS材1,且材1 = WPS材2) + if ((mat1.MaterialClass == item.Material1Class && mat2.MaterialClass == item.Material2Class) || (mat2.MaterialClass == item.Material1Class && mat1.MaterialClass == item.Material2Class)) + { + list.Add(item); + } + } + //list = list.Distinct().ToList(); + if (list != null && list.Count() > 0) + { + return list.Distinct().ToList(); + } + else + { + return null; + } + + } + /// /// 返回组别的序号 /// diff --git a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderItemEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderItemEdit.aspx.cs index 37b3fecc..d4a85b95 100644 --- a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderItemEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderItemEdit.aspx.cs @@ -117,7 +117,7 @@ namespace FineUIPro.Web.CQMS.PersonManage private decimal? GetDecimalByStr(string str) { - if (str == "0") + if (str == "0"||string.IsNullOrEmpty(str)) { return null; }