This commit is contained in:
2024-06-05 08:24:19 +08:00
parent 1677a6d714
commit 3990f747ce
67 changed files with 6774 additions and 1645 deletions
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web.UI.WebControls;
using BLL;
using Newtonsoft.Json.Linq;
@@ -60,7 +61,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
this.drpWeldType.DataValueField = "WeldTypeCode";
this.drpWeldType.DataSource = from x in Funs.DB.Base_WeldType orderby x.WeldTypeCode select x;
this.drpWeldType.DataBind();
///焊接位置
this.drpWeldingLocationId.DataTextField = "WeldingLocationCode";
this.drpWeldingLocationId.DataValueField = "WeldingLocationCode";
@@ -123,6 +124,10 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
drpWPS.DataBind();
Funs.FineUIPleaseSelect(drpWPS);
// 物料码
BLL.MaterialCoodeService.InitMaterialCoodeDropDownList(this.drpCoode1, this.CurrUser.LoginProjectId, true, Resources.Lan.PleaseSelect);//Coode1
BLL.MaterialCoodeService.InitMaterialCoodeDropDownList(this.drpCoode2, this.CurrUser.LoginProjectId, true, Resources.Lan.PleaseSelect);//Coode2
List<Model.SpWeldingDailyItem> GetWeldingDailyItem = BLL.Pipeline_WeldingDailyService.GetWeldingDailyItem(this.WeldingDailyId);
this.BindGrid(GetWeldingDailyItem); // 初始化页面
@@ -325,6 +330,50 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
string eventArg = string.Empty;
List<Model.SpWeldingDailyItem> GetWeldingDailyItem = this.CollectGridJointInfo();
// 判断Coode数量
string coodeNumError = string.Empty;
var coode1Group = GetWeldingDailyItem.GroupBy(x => x.CoodeHeartNo1).Select(g => g.Key);
var coode2Group = GetWeldingDailyItem.GroupBy(x => x.CoodeHeartNo2).Select(g => g.Key);
var coodeListGroup = coode1Group.Union(coode2Group).Distinct();
string[] jotList= GetWeldingDailyItem.Select(x=>x.WeldJointId).ToArray();
foreach (var c in coodeListGroup)
{
if (c.Contains(":"))
{
string coode = c.Split(':')[0];
string heartNo = c.Split(':')[1];
var coodeNum = from x in Funs.DB.Base_MaterialCoode
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.Coode == coode && x.HeartNo == heartNo
select x;
int daily1 = (from x in GetWeldingDailyItem where x.CoodeHeartNo1 == c select x).Count();
int daily2 = (from x in GetWeldingDailyItem where x.CoodeHeartNo2 == c select x).Count();
int jotCoode1 = (from x in Funs.DB.Pipeline_WeldJoint
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.Coode1 == coode && x.HeartNo1 == heartNo
&& !jotList.Contains(x.WeldJointId)
select x).Count();
int jotCoode2 = (from x in Funs.DB.Pipeline_WeldJoint
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.Coode2 == coode && x.HeartNo2 == heartNo
&& !jotList.Contains(x.WeldJointId)
select x).Count();
if (coodeNum.Count() > 0 && coodeNum.First().Amount != null)
{
if (daily1 + daily2 + jotCoode1 + jotCoode2 > coodeNum.First().Amount.Value)
{
coodeNumError += "Coode:" + coode + "对应的炉批号:" + heartNo + "的数量已超出,";
}
}
}
}
if (!string.IsNullOrEmpty(coodeNumError))
{
coodeNumError = coodeNumError + "请检查后再导入";
}
#region
//// 焊工资质
//foreach (var item in GetWeldingDailyItem)
@@ -621,8 +670,13 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
//}
#endregion
if (!string.IsNullOrEmpty(coodeNumError))
{
ShowNotify(coodeNumError, MessageBoxIcon.Warning, 10000);
return;
}
// 焊工资质都符合条件
if (eventArg == string.Empty)
else if (eventArg == string.Empty)
{
Model.Pipeline_WeldingDaily newWeldingDaily = new Model.Pipeline_WeldingDaily();
newWeldingDaily.WeldingDailyCode = this.txtWeldingDailyCode.Text.Trim();
@@ -681,11 +735,18 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
newWeldJoint.JointAttribute = item.JointAttribute;
newWeldJoint.JointArea = item.JointArea;
newWeldJoint.WeldingLocationId = item.WeldingLocationId;
newWeldJoint.Material1Id = item.MaterialId1;
newWeldJoint.Material2Id = item.MaterialId2;
newWeldJoint.HeartNo1 = item.HeartNo1;
newWeldJoint.HeartNo2 = item.HeartNo2;
if (item.CoodeHeartNo1.Contains(":"))
{
newWeldJoint.Coode1 = item.CoodeHeartNo1.Split(':')[0];
newWeldJoint.HeartNo1 = item.CoodeHeartNo1.Split(':')[1];
}
if (item.CoodeHeartNo2.Contains(":"))
{
newWeldJoint.Coode2 = item.CoodeHeartNo2.Split(':')[0];
newWeldJoint.HeartNo2 = item.CoodeHeartNo2.Split(':')[1];
}
newWeldJoint.PipeAssembly1Id = item.Components1Id;
newWeldJoint.PipeAssembly2Id = item.Components2Id;
newWeldJoint.WeldingMethodId = item.WeldingMethodId;
@@ -700,7 +761,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
//更新焊口号 修改固定焊口号后 +G
//BLL.Pipeline_WeldJointService.UpdateWeldJointAddG(newWeldJoint.WeldJointId, newWeldJoint.JointAttribute, Const.BtnAdd);
BLL.Batch_PointBatchItemService.InsertPointBatch(this.ProjectId, this.drpUnit.SelectedValue, this.drpInstallation.SelectedValue,item.BackingWelderId ,item.CoverWelderId, item.WeldJointId, newWeldingDaily.WeldingDate);
BLL.Batch_PointBatchItemService.InsertPointBatch(this.ProjectId, this.drpUnit.SelectedValue, this.drpInstallation.SelectedValue, item.BackingWelderId, item.CoverWelderId, item.WeldJointId, newWeldingDaily.WeldingDate);
}
@@ -938,7 +999,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
if (!string.IsNullOrEmpty(values.Value<string>("JointAttribute")))
{
item.JointAttribute = values.Value<string>("JointAttribute").ToString();
if (item.JointAttribute == "活动S")
if (item.JointAttribute == "S")
{
item.JointArea = "S";
}
@@ -947,6 +1008,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
item.JointArea = "F";
}
}
var weldingLocation = (from x in Funs.DB.Base_WeldingLocation
where x.WeldingLocationCode == values.Value<string>("WeldingLocationId")
select x).FirstOrDefault();
@@ -956,8 +1018,9 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
}
item.Size = Funs.GetNewDecimalOrZero(values.Value<string>("DoneDin").ToString());
item.DoneDin = Funs.GetNewDecimalOrZero(values.Value<string>("DoneDin").ToString());
item.HeartNo1= values.Value<string>("HeartNo1").ToString();
item.HeartNo2 = values.Value<string>("HeartNo2").ToString();
item.CoodeHeartNo1 = values.Value<string>("CoodeHeartNo1").ToString();
item.CoodeHeartNo2 = values.Value<string>("CoodeHeartNo2").ToString();
var wmt = (from x in Funs.DB.Base_WeldingMethod
where x.WeldingMethodCode == values.Value<string>("WeldingMethodCode")