feat(hjgl):增加俄标焊评匹配
This commit is contained in:
@@ -177,6 +177,17 @@ namespace BLL
|
||||
|
||||
#region 匹配wpq
|
||||
public static List<View_HJGL_WPQ> GetMatchWPQ(HJGL_WeldJoint jot, string projectid, string unitid)
|
||||
{
|
||||
return GetMatchWPQ_RU(jot, projectid, unitid);
|
||||
}
|
||||
/// <summary>
|
||||
/// 国标匹配规则
|
||||
/// </summary>
|
||||
/// <param name="jot"></param>
|
||||
/// <param name="projectid"></param>
|
||||
/// <param name="unitid"></param>
|
||||
/// <returns></returns>
|
||||
public static List<View_HJGL_WPQ> 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
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 俄罗斯标准匹配规则
|
||||
/// </summary>
|
||||
/// <param name="jot"></param>
|
||||
/// <param name="projectid"></param>
|
||||
/// <param name="unitid"></param>
|
||||
/// <returns></returns>
|
||||
public static List<View_HJGL_WPQ> 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<Model.View_HJGL_WPQ> list = new List<Model.View_HJGL_WPQ>();
|
||||
// 单位、接头形式、材质的覆盖
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回组别的序号
|
||||
/// </summary>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user