11
This commit is contained in:
@@ -1020,40 +1020,26 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
}
|
||||
if (ds.Tables[0].Rows[i]["Coode1"] != null && !string.IsNullOrEmpty(ds.Tables[0].Rows[i]["Coode1"].ToString()))
|
||||
{
|
||||
var cood = coodeList.FirstOrDefault(x => x.Coode == ds.Tables[0].Rows[i]["Coode1"].ToString());
|
||||
if (cood == null)
|
||||
{
|
||||
errorInfos += "Coode1:[" + ds.Tables[0].Rows[i]["Coode1"].ToString() + "]不存在;";
|
||||
}
|
||||
else
|
||||
{
|
||||
d.Coode1 = cood.Coode;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
errorInfos += (i + 2) + "行,Coode1不能为空!</br>";
|
||||
d.Coode1 = ds.Tables[0].Rows[i]["Coode1"].ToString();
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// errorInfos += (i + 2) + "行,Coode1不能为空!</br>";
|
||||
//}
|
||||
|
||||
|
||||
if (ds.Tables[0].Rows[i]["Coode2"] != null && !string.IsNullOrEmpty(ds.Tables[0].Rows[i]["Coode2"].ToString()))
|
||||
{
|
||||
var cood = coodeList.FirstOrDefault(x => x.Coode == ds.Tables[0].Rows[i]["Coode2"].ToString());
|
||||
if (cood == null)
|
||||
{
|
||||
errorInfos += "Coode2:[" + ds.Tables[0].Rows[i]["Coode2"].ToString() + "]不存在;";
|
||||
}
|
||||
else
|
||||
{
|
||||
d.Coode1 = cood.Coode;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
errorInfos += (i + 2) + "行,Coode2不能为空!</br>";
|
||||
d.Coode1 = ds.Tables[0].Rows[i]["Coode2"].ToString();
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// errorInfos += (i + 2) + "行,Coode2不能为空!</br>";
|
||||
//}
|
||||
|
||||
if (ds.Tables[0].Rows[i]["炉批号1"] != null && !string.IsNullOrEmpty(ds.Tables[0].Rows[i]["炉批号1"].ToString()))
|
||||
{
|
||||
var cood = coodeList.FirstOrDefault(x => x.Coode == d.Coode1 && x.HeartNo == ds.Tables[0].Rows[i]["炉批号1"].ToString());
|
||||
var cood = coodeList.FirstOrDefault(x =>x.IsUse==true && x.Coode == d.Coode1 && x.HeartNo == ds.Tables[0].Rows[i]["炉批号1"].ToString());
|
||||
if (cood == null)
|
||||
{
|
||||
errorInfos += "炉批号1:[" + ds.Tables[0].Rows[i]["炉批号1"].ToString() + "]或对应的Coode1不存在;";
|
||||
@@ -1063,14 +1049,14 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
d.HeartNo1 = ds.Tables[0].Rows[i]["炉批号1"].ToString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
errorInfos += (i + 2) + "行,炉批号1不能为空!</br>";
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// errorInfos += (i + 2) + "行,炉批号1不能为空!</br>";
|
||||
//}
|
||||
|
||||
if (ds.Tables[0].Rows[i]["炉批号2"] != null && !string.IsNullOrEmpty(ds.Tables[0].Rows[i]["炉批号2"].ToString()))
|
||||
{
|
||||
var cood = coodeList.FirstOrDefault(x => x.Coode == d.Coode2 && x.HeartNo == ds.Tables[0].Rows[i]["炉批号2"].ToString());
|
||||
var cood = coodeList.FirstOrDefault(x => x.IsUse == true && x.Coode == d.Coode2 && x.HeartNo == ds.Tables[0].Rows[i]["炉批号2"].ToString());
|
||||
if (cood == null)
|
||||
{
|
||||
errorInfos += "炉批号2:[" + ds.Tables[0].Rows[i]["炉批号2"].ToString() + "]或对应的Coode2不存在;";
|
||||
@@ -1080,10 +1066,10 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
d.HeartNo2 = ds.Tables[0].Rows[i]["炉批号2"].ToString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
errorInfos += (i + 2) + "行,炉批号2不能为空!</br>";
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// errorInfos += (i + 2) + "行,炉批号2不能为空!</br>";
|
||||
//}
|
||||
|
||||
//if (ds.Tables[0].Rows[i]["焊丝"] != null && !string.IsNullOrEmpty(ds.Tables[0].Rows[i]["焊丝"].ToString()))
|
||||
//{
|
||||
@@ -1166,6 +1152,39 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
|
||||
dayList.Add(d);
|
||||
|
||||
#region 判断WPS资质 暂不用
|
||||
//if (!string.IsNullOrEmpty(errorInfos))
|
||||
//{
|
||||
// ShowNotify(errorInfos, MessageBoxIcon.Warning, 10000);
|
||||
// return;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// // 判断WPS资质 暂不用
|
||||
// if (welderQueIsUse == true)
|
||||
// {
|
||||
// if (isExistFloor && isExistCell)
|
||||
// {
|
||||
// //bool canSave = false;
|
||||
// var jot = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(jotId);
|
||||
// var wps = BLL.WPQListServiceService.GetWPQById(jot.WPQId);
|
||||
// if (wps != null)
|
||||
// {
|
||||
// if (wps.WelderIds.Contains(cellWelderId) && wps.WelderIds.Contains(floorWelderId))
|
||||
// {
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// eventArg = eventArg + jot.WeldJointCode + ",";
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region 焊工合格项目资质判断
|
||||
if (!string.IsNullOrEmpty(errorInfos))
|
||||
{
|
||||
ShowNotify(errorInfos, MessageBoxIcon.Warning, 10000);
|
||||
@@ -1176,125 +1195,98 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
// 判断资质
|
||||
if (welderQueIsUse == true)
|
||||
{
|
||||
if (isExistFloor && isExistCell)
|
||||
if (!string.IsNullOrEmpty(jotId) && isExistFloor && isExistCell)
|
||||
{
|
||||
//bool canSave = false;
|
||||
bool canSave = false;
|
||||
var jot = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(jotId);
|
||||
var wps = BLL.WPQListServiceService.GetWPQById(jot.WPQId);
|
||||
if (wps.WelderIds.Contains(cellWelderId) && wps.WelderIds.Contains(floorWelderId))
|
||||
{
|
||||
var joty = BLL.Base_WeldTypeService.GetWeldTypeByWeldTypeId(jot.WeldTypeId);
|
||||
string weldTypeGroup = joty.Flag;
|
||||
string weldTypeCode = joty.WeldTypeCode;
|
||||
string floorWelder = floorWelderId;
|
||||
string cellWelder = cellWelderId;
|
||||
//decimal? dia = jot.Dia;
|
||||
//decimal? sch = jot.Thickness;
|
||||
|
||||
string weldingMethodCode = string.Empty;
|
||||
var wm = BLL.Base_WeldingMethodService.GetWeldingMethodByWeldingMethodId(d.WeldingMethodId);
|
||||
if (wm != null)
|
||||
{
|
||||
weldingMethodCode = wm.WeldingMethodCode;
|
||||
}
|
||||
string[] wmeCodes = weldingMethodCode.Split('+');
|
||||
|
||||
string location = string.Empty;
|
||||
var loc = BLL.Base_WeldingLocationServie.GetWeldingLocationById(d.WeldingLocationId);
|
||||
if (loc != null)
|
||||
{
|
||||
location = loc.WeldingLocationCode;
|
||||
}
|
||||
|
||||
string ste = jot.Material1Id;
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
if (canSave == false)
|
||||
{
|
||||
eventArg = eventArg + jot.WeldJointCode + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#region 焊工资质判断 ,暂不用,改为和WPS的焊工判断
|
||||
//if (!string.IsNullOrEmpty(errorInfos))
|
||||
//{
|
||||
// ShowNotify(errorInfos, MessageBoxIcon.Warning, 10000);
|
||||
// return;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// // 判断资质
|
||||
// if (welderQueIsUse == true)
|
||||
// {
|
||||
// if (isExistFloor && isExistCell)
|
||||
// {
|
||||
// bool canSave = false;
|
||||
// var jot = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(jotId);
|
||||
// var joty = BLL.Base_WeldTypeService.GetWeldTypeByWeldTypeId(jot.WeldTypeId);
|
||||
// string weldTypeGroup = joty.Flag;
|
||||
// string weldTypeCode = joty.WeldTypeCode;
|
||||
// string floorWelder = floorWelderId;
|
||||
// string cellWelder = cellWelderId;
|
||||
// //decimal? dia = jot.Dia;
|
||||
// //decimal? sch = jot.Thickness;
|
||||
|
||||
// string weldingMethodCode = string.Empty;
|
||||
// var wm = BLL.Base_WeldingMethodService.GetWeldingMethodByWeldingMethodId(jot.WeldingMethodId);
|
||||
// if (wm != null)
|
||||
// {
|
||||
// weldingMethodCode = wm.WeldingMethodCode;
|
||||
// }
|
||||
// string[] wmeCodes = weldingMethodCode.Split('+');
|
||||
|
||||
// string location = string.Empty;
|
||||
// var loc = BLL.Base_WeldingLocationServie.GetWeldingLocationById(jot.WeldingLocationId);
|
||||
// if (loc != null)
|
||||
// {
|
||||
// location = loc.WeldingLocationCode;
|
||||
// }
|
||||
|
||||
// string ste = jot.Material1Id;
|
||||
|
||||
// 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;
|
||||
|
||||
// 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);
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (canSave == false)
|
||||
// {
|
||||
// eventArg = eventArg + jot.WeldJointCode + ",";
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user