11
This commit is contained in:
@@ -102,13 +102,15 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
|
||||
protected void BtnExtract_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool canWPS = true;
|
||||
var jotList = (from x in Funs.DB.Pipeline_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId && x.WeldingDailyId != null && x.WeldingMethodId != null select x).ToList();
|
||||
var jotList = (from x in Funs.DB.Pipeline_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId && x.WeldingDailyId != null && x.WeldingMethodId != null
|
||||
select x).ToList(); // && x.PipelineId== "246c6b8c-8fbd-480c-9810-43062bf09646"
|
||||
foreach (var jot in jotList)
|
||||
{
|
||||
var wps = BLL.WPQListServiceService.GetWPQById(jot.WPQId);
|
||||
string floorWelder = jot.BackingWelderId;
|
||||
string cellWelder = jot.CoverWelderId;
|
||||
|
||||
bool canWPS = true;
|
||||
if (wps != null)
|
||||
{
|
||||
// 验证焊工WPS资质
|
||||
@@ -143,7 +145,12 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
decimal? sch = jot.Thickness;
|
||||
|
||||
string[] wmeCodes = mat.WeldingMethodCode.Split('+');
|
||||
string location = loc.WeldingLocationCode;
|
||||
|
||||
string location=string.Empty;
|
||||
if (loc != null)
|
||||
{
|
||||
location = loc.WeldingLocationCode;
|
||||
}
|
||||
string ste = jot.Material1Id;
|
||||
|
||||
List<Model.Welder_WelderQualify> floorWelderQualifys = (from x in Funs.DB.Welder_WelderQualify
|
||||
@@ -201,13 +208,17 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (canWPS==false || canSave == false)
|
||||
if (canWPS == false || canSave == false)
|
||||
{
|
||||
jot.IsSuperQueWelding = true;
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jot.IsSuperQueWelding = null;
|
||||
}
|
||||
}
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
ShowNotify("提取完成");
|
||||
return;
|
||||
|
||||
@@ -9,6 +9,7 @@ using NPOI.SS.Util;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using System.Linq;
|
||||
using BLL;
|
||||
using System.Web.Configuration;
|
||||
|
||||
namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
{
|
||||
@@ -353,6 +354,11 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
var weldJoints = BLL.Pipeline_WeldJointService.GetWeldlinesByWeldingDailyId(weldingDailyId);
|
||||
if (weldJoints.Count() > 0)
|
||||
{
|
||||
string[] jointList = weldJoints.Select(p => p.WeldJointId).ToArray();
|
||||
var pointBatchList = from x in Funs.DB.Batch_PointBatchItem
|
||||
where jointList.Contains(x.WeldJointId)
|
||||
select x;
|
||||
string[] pointBatchIdList = pointBatchList.Select(p => p.PointBatchId).Distinct().ToArray();
|
||||
foreach (var item in weldJoints)
|
||||
{
|
||||
var updateWeldJoint = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(item.WeldJointId);
|
||||
@@ -369,8 +375,42 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
BLL.Batch_NDEItemService.DeleteAllNDEInfoToWeldJoint(item.WeldJointId);
|
||||
}
|
||||
}
|
||||
|
||||
// 打开批
|
||||
if (pointBatchIdList.Count() > 0)
|
||||
{
|
||||
foreach (string p in pointBatchIdList)
|
||||
{
|
||||
var pItem = (from x in Funs.DB.Batch_PointBatchItem
|
||||
orderby x.EnterDate descending
|
||||
where x.PointBatchId == p
|
||||
select x).ToList();
|
||||
int pItemNum = pItem.Count();
|
||||
if (pItemNum > 0)
|
||||
{
|
||||
var batch = BLL.Batch_PointBatchService.GetPointBatchById(p);
|
||||
var rate = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(batch.DetectionRateId);
|
||||
int dnum = Convert.ToInt32((double)100 / (int)rate.DetectionRateValue);
|
||||
// 取模(余数)
|
||||
int modelNum = pItemNum % dnum;
|
||||
// 等于0不处理
|
||||
if (modelNum != 0)
|
||||
{
|
||||
var bachtOrder = pItem.GetRange(0, modelNum);
|
||||
foreach (var g in bachtOrder)
|
||||
{
|
||||
BLL.Batch_PointBatchItemService.UpdatePointBatchOrder(g.PointBatchItemId, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
BLL.Pipeline_WeldingDailyService.DeleteWeldingDailyByWeldingDailyId(weldingDailyId);
|
||||
|
||||
|
||||
|
||||
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_WeldReportMenuId, Const.BtnDelete, weldingDailyId);
|
||||
ShowNotify(Resources.Lan.DeletedSuccessfully, MessageBoxIcon.Success);
|
||||
this.BindGrid();
|
||||
@@ -1019,6 +1059,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
// }
|
||||
//}
|
||||
|
||||
string oldmat1 = d.Material1Id;
|
||||
if (ds.Tables[0].Rows[i]["材质1"] != null && !string.IsNullOrEmpty(ds.Tables[0].Rows[i]["材质1"].ToString()))
|
||||
{
|
||||
var steel = materials.FirstOrDefault(x => x.MaterialCode == ds.Tables[0].Rows[i]["材质1"].ToString());
|
||||
@@ -1050,7 +1091,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
else
|
||||
{
|
||||
if ((!string.IsNullOrEmpty(d.Material2Id) && steel.MaterialId != d.Material2Id)
|
||||
&& (!string.IsNullOrEmpty(d.Material1Id) && steel.MaterialId != d.Material1Id))
|
||||
&& (!string.IsNullOrEmpty(oldmat1) && steel.MaterialId != oldmat1))
|
||||
{
|
||||
errorInfos += (i + 2) + "行,材质2[" + ds.Tables[0].Rows[i]["材质2"].ToString() + "]验证不一至;";
|
||||
}
|
||||
@@ -1061,7 +1102,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
string oldCom1 = d.PipeAssembly1Id;
|
||||
if (ds.Tables[0].Rows[i]["组件1"] != null && !string.IsNullOrEmpty(ds.Tables[0].Rows[i]["组件1"].ToString()))
|
||||
{
|
||||
var com = componentss.FirstOrDefault(x => x.ComponentsCode == ds.Tables[0].Rows[i]["组件1"].ToString());
|
||||
@@ -1093,8 +1134,8 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((!string.IsNullOrEmpty(d.PipeAssembly1Id) && com.ComponentsId != d.PipeAssembly1Id)
|
||||
&& (!string.IsNullOrEmpty(d.PipeAssembly2Id) && com.ComponentsId != d.PipeAssembly2Id))
|
||||
if ((!string.IsNullOrEmpty(d.PipeAssembly2Id) && com.ComponentsId != d.PipeAssembly2Id)
|
||||
&& (!string.IsNullOrEmpty(oldCom1) && com.ComponentsId != oldCom1))
|
||||
{
|
||||
errorInfos += (i + 2) + "行,组件2[" + ds.Tables[0].Rows[i]["组件2"].ToString() + "]验证不一至;";
|
||||
}
|
||||
@@ -1105,6 +1146,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
}
|
||||
}
|
||||
|
||||
string oldHeartNo1 = d.HeartNo1;
|
||||
if (ds.Tables[0].Rows[i]["炉批号1"] != null && !string.IsNullOrEmpty(ds.Tables[0].Rows[i]["炉批号1"].ToString()))
|
||||
{
|
||||
if ((!string.IsNullOrEmpty(d.HeartNo1) && ds.Tables[0].Rows[i]["炉批号1"].ToString() != d.HeartNo1)
|
||||
@@ -1120,7 +1162,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
|
||||
if (ds.Tables[0].Rows[i]["炉批号2"] != null && !string.IsNullOrEmpty(ds.Tables[0].Rows[i]["炉批号2"].ToString()))
|
||||
{
|
||||
if ((!string.IsNullOrEmpty(d.HeartNo1) && ds.Tables[0].Rows[i]["炉批号2"].ToString() != d.HeartNo1)
|
||||
if ((!string.IsNullOrEmpty(oldHeartNo1) && ds.Tables[0].Rows[i]["炉批号2"].ToString() != oldHeartNo1)
|
||||
&& (!string.IsNullOrEmpty(d.HeartNo2) && ds.Tables[0].Rows[i]["炉批号2"].ToString() != d.HeartNo2))
|
||||
{
|
||||
errorInfos += (i + 2) + "行,炉批号2[" + ds.Tables[0].Rows[i]["炉批号2"].ToString() + "]验证不一至;";
|
||||
|
||||
@@ -340,23 +340,30 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
var wps = BLL.WPQListServiceService.GetWPQById(item.WPQId);
|
||||
|
||||
// 验证焊工资质
|
||||
if (item.BackingWelderId == item.CoverWelderId)
|
||||
if (wps != null)
|
||||
{
|
||||
if (!wps.WelderIds.Contains(item.BackingWelderId))
|
||||
if (item.BackingWelderId == item.CoverWelderId)
|
||||
{
|
||||
errorCheck += rowIndex + "行,焊工:" + item.BackingWelderCode + "无WPS焊接资质,";
|
||||
if (!wps.WelderIds.Contains(item.BackingWelderId))
|
||||
{
|
||||
errorCheck += rowIndex + "行,焊工:" + item.BackingWelderCode + "无WPS焊接资质,";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!wps.WelderIds.Contains(item.BackingWelderId))
|
||||
{
|
||||
errorCheck += rowIndex + "行,焊工:" + item.BackingWelderCode + "无WPS焊接资质,";
|
||||
}
|
||||
if (!wps.WelderIds.Contains(item.CoverWelderId))
|
||||
{
|
||||
errorCheck += rowIndex + "行,焊工:" + item.CoverWelderId + "无WPS焊接资质,";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!wps.WelderIds.Contains(item.BackingWelderId))
|
||||
{
|
||||
errorCheck += rowIndex + "行,焊工:" + item.BackingWelderCode + "无WPS焊接资质,";
|
||||
}
|
||||
if (!wps.WelderIds.Contains(item.CoverWelderId))
|
||||
{
|
||||
errorCheck += rowIndex + "行,焊工:" + item.CoverWelderId + "无WPS焊接资质,";
|
||||
}
|
||||
errorCheck += rowIndex + "行,WPS不能为空,";
|
||||
}
|
||||
|
||||
// 验证数据是否一至
|
||||
|
||||
Reference in New Issue
Block a user