This commit is contained in:
2024-07-01 09:29:35 +08:00
parent 3990f747ce
commit 26d1774fb1
35 changed files with 1432 additions and 488 deletions
@@ -374,99 +374,98 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
coodeNumError = coodeNumError + "请检查后再导入";
}
#region
//// 焊工资质
//foreach (var item in GetWeldingDailyItem)
//{
// bool canSave = false;
// var jot = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(item.WeldJointId);
// var joty = BLL.Base_WeldTypeService.GetWeldTypeByWeldTypeId(jot.WeldTypeId);
// string weldTypeGroup = joty.Flag;
// string weldTypeCode = joty.WeldTypeCode;
// string floorWelder = item.BackingWelderId;
// string cellWelder = item.CoverWelderId;
// decimal? dia = item.Dia;
// decimal? sch = item.Thickness;
// //string wme = item.WeldingMethodCode;
// //string wmeCode = string.Empty;
// //var wm = BLL.HJGL_WeldingMethodService.GetWeldMethodByWMEID(item.WME_ID);
// //if (wm != null)
// //{
// // wmeCode = wm.WME_Code;
// //}
#region
foreach (var item in GetWeldingDailyItem)
{
bool canSave = false;
var jot = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(item.WeldJointId);
var joty = BLL.Base_WeldTypeService.GetWeldTypeByWeldTypeId(jot.WeldTypeId);
string weldTypeGroup = joty.Flag;
string weldTypeCode = joty.WeldTypeCode;
string floorWelder = item.BackingWelderId;
string cellWelder = item.CoverWelderId;
decimal? dia = item.Dia;
decimal? sch = item.Thickness;
//string wme = item.WeldingMethodCode;
//string wmeCode = string.Empty;
//var wm = BLL.HJGL_WeldingMethodService.GetWeldMethodByWMEID(item.WME_ID);
//if (wm != null)
//{
// wmeCode = wm.WME_Code;
//}
// string[] wmeCodes = item.WeldingMethodCode.Split('+');
// string location = item.WeldingLocationCode;
// string ste = jot.Material1Id;
// var projectWelder = BLL.Welder_ProjectWelderService.GetProjectWelderByProjectIdAndWelderId(this.ProjectId,item.BackingWelderId);
// var projectUnit = BLL.Project_UnitService.GetProject_UnitByProjectIdUnitId(this.ProjectId,projectWelder.UnitId);
// if (projectUnit != null && projectUnit.WelderQueIsUse == true)
// {
// List<Model.Welder_WelderQualify> floorWelderQualifys = (from x in Funs.DB.Welder_WelderQualify
// where x.WelderId == floorWelder && x.WeldingMethodId != null
// && x.WeldingLocationId != null && x.MaterialType != null
// && x.WeldType != null
// && x.ThicknessMax != null && x.SizesMin != null
// select x).ToList();
string[] wmeCodes = item.WeldingMethodCode.Split('+');
string location = item.WeldingLocationCode;
string ste = jot.Material1Id;
var projectWelder = BLL.Welder_ProjectWelderService.GetProjectWelderByProjectIdAndWelderId(this.ProjectId, item.BackingWelderId);
var projectUnit = BLL.Project_UnitService.GetProject_UnitByProjectIdUnitId(this.ProjectId, projectWelder.UnitId);
if (projectUnit != null && projectUnit.WelderQueIsUse == true)
{
List<Model.Welder_WelderQualify> floorWelderQualifys = (from x in Funs.DB.Welder_WelderQualify
where x.WelderId == floorWelder && x.WeldingMethodId != null
&& x.WeldingLocationId != null && x.MaterialType != null
&& x.WeldType != null
&& x.ThicknessMax != null && x.SizesMin != null
select x).ToList();
// List<Model.Welder_WelderQualify> cellWelderQualifys = (from x in Funs.DB.Welder_WelderQualify
// where x.WelderId == cellWelder && x.WeldingMethodId != null
// && x.WeldingLocationId != null && x.MaterialType != null
// && x.WeldType != null
// && x.ThicknessMax != null && x.SizesMin != null
// select x).ToList();
// // 打底和盖面同一焊工
// if (floorWelder == cellWelder)
// {
// if (floorWelderQualifys != null && floorWelderQualifys.Count() > 0)
// {
// if (wmeCodes.Count() <= 1) // 一种焊接方法
// {
// canSave = IsOK(floorWelderQualifys, wmeCodes[0], location, weldTypeGroup, ste, dia, sch);
// }
// else // 大于一种焊接方法,如氩电联焊
// {
// canSave = TwoWmeIsOK(floorWelderQualifys, cellWelderQualifys, wmeCodes[0], wmeCodes[1], location, weldTypeGroup, ste, dia, sch);
// }
// }
// }
// // 打底和盖面焊工不同
// else
// {
// bool isok1 = false;
// bool isok2 = false;
List<Model.Welder_WelderQualify> cellWelderQualifys = (from x in Funs.DB.Welder_WelderQualify
where x.WelderId == cellWelder && x.WeldingMethodId != null
&& x.WeldingLocationId != null && x.MaterialType != null
&& x.WeldType != null
&& x.ThicknessMax != null && x.SizesMin != null
select x).ToList();
// 打底和盖面同一焊工
if (floorWelder == cellWelder)
{
if (floorWelderQualifys != null && floorWelderQualifys.Count() > 0)
{
if (wmeCodes.Count() <= 1) // 一种焊接方法
{
canSave = IsOK(floorWelderQualifys, wmeCodes[0], location, weldTypeGroup, ste, dia, sch);
}
else // 大于一种焊接方法,如氩电联焊
{
canSave = TwoWmeIsOK(floorWelderQualifys, cellWelderQualifys, wmeCodes[0], wmeCodes[1], location, weldTypeGroup, ste, dia, sch);
}
}
}
// 打底和盖面焊工不同
else
{
bool isok1 = false;
bool isok2 = false;
// if (wmeCodes.Count() <= 1) // 一种焊接方法
// {
// if (floorWelderQualifys != null && floorWelderQualifys.Count() > 0)
// {
// isok1 = IsOK(floorWelderQualifys, wmeCodes[0], location, weldTypeGroup, ste, dia, sch);
// }
// if (cellWelderQualifys != null && cellWelderQualifys.Count() > 0)
// {
// isok2 = IsOK(cellWelderQualifys, wmeCodes[0], location, weldTypeGroup, ste, dia, sch);
// }
// if (isok1 && isok2)
// {
// canSave = true;
// }
// }
// else
// {
// canSave = TwoWmeIsOK(floorWelderQualifys, cellWelderQualifys, wmeCodes[0], wmeCodes[1], location, weldTypeGroup, ste, dia, sch);
// }
// }
// }
// else
// {
// canSave = true;
// }
if (wmeCodes.Count() <= 1) // 一种焊接方法
{
if (floorWelderQualifys != null && floorWelderQualifys.Count() > 0)
{
isok1 = IsOK(floorWelderQualifys, wmeCodes[0], location, weldTypeGroup, ste, dia, sch);
}
if (cellWelderQualifys != null && cellWelderQualifys.Count() > 0)
{
isok2 = IsOK(cellWelderQualifys, wmeCodes[0], location, weldTypeGroup, ste, dia, sch);
}
if (isok1 && isok2)
{
canSave = true;
}
}
else
{
canSave = TwoWmeIsOK(floorWelderQualifys, cellWelderQualifys, wmeCodes[0], wmeCodes[1], location, weldTypeGroup, ste, dia, sch);
}
}
}
else
{
canSave = true;
}
// if (canSave == false)
// {
// eventArg = eventArg + jot.WeldJointCode + ",";
// }
//}
if (canSave == false)
{
eventArg = eventArg + jot.WeldJointCode + ",";
}
}
#endregion
#region 线