提交代码

This commit is contained in:
2023-11-26 17:43:05 +08:00
parent 206d2c5c43
commit 560f6d8b7b
7 changed files with 340 additions and 158 deletions
@@ -114,6 +114,9 @@
<f:RenderField HeaderText="单位名称" ColumnID="UnitName" DataField="UnitName"
SortField="UnitName" FieldType="String" HeaderTextAlign="Center" Width="180px">
</f:RenderField>
<f:RenderField HeaderText="流水段" ColumnID="FlowingSection" DataField="FlowingSection"
SortField="FlowingSection" FieldType="String" HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<%--<f:RenderField HeaderText="单位工程" ColumnID="UnitWorkCode" DataField="UnitWorkCode"
SortField="UnitWorkCode" FieldType="String" HeaderTextAlign="Center" Width="100px">
</f:RenderField>--%>
@@ -161,11 +164,11 @@
<f:RenderField HeaderText="坡口类型" ColumnID="GrooveTypeCode" DataField="GrooveTypeCode"
SortField="GrooveTypeCode" FieldType="String" HeaderTextAlign="Center" Width="90px">
</f:RenderField>
<f:RenderField HeaderText="焊条" ColumnID="WeldingRod" DataField="WeldingRod"
SortField="WeldingRod" FieldType="String" HeaderTextAlign="Center" Width="90px">
<f:RenderField HeaderText="焊条" ColumnID="WeldingRodCode" DataField="WeldingRodCode"
SortField="WeldingRodCode" FieldType="String" HeaderTextAlign="Center" Width="90px">
</f:RenderField>
<f:RenderField HeaderText="焊丝" ColumnID="WeldingWire" DataField="WeldingWire"
SortField="WeldingWire" FieldType="String" HeaderTextAlign="Center" Width="90px">
<f:RenderField HeaderText="焊丝" ColumnID="WeldingWireCode" DataField="WeldingWireCode"
SortField="WeldingWireCode" FieldType="String" HeaderTextAlign="Center" Width="90px">
</f:RenderField>
<f:RenderField HeaderText="预热温度" ColumnID="PreTemperature"
DataField="PreTemperature" SortField="PreTemperature" FieldType="String"
@@ -94,8 +94,8 @@ namespace FineUIPro.Web.HJGL.InfoQuery
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
this.InitTreeMenu();//加载树
this.JointComplete = 0;
this.JointNoComplete =0;
this.JointPre =0;
this.JointNoComplete = 0;
this.JointPre = 0;
this.JointNoPre = 0;
}
@@ -146,8 +146,8 @@ namespace FineUIPro.Web.HJGL.InfoQuery
//}
//else
//{
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
//}
if (unitWork1.Count() > 0)
{
@@ -182,7 +182,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
foreach (var q in unitWork2)
{
int a = (from x in Funs.DB.HJGL_Pipeline
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId
&& x.PipelineCode.Contains(this.tvPipeCode.Text.Trim())
select x).Count();
@@ -233,7 +233,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
this.BindGrid();
}
}
protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
@@ -276,7 +276,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
newNode.CommandName = "加载";
newNode.Icon = Icon.ArrowDown;
newNode.EnableClickEvent = true;
node.Nodes.Add(newNode);
node.Nodes.Add(newNode);
}
}
}
@@ -285,9 +285,9 @@ namespace FineUIPro.Web.HJGL.InfoQuery
private void BindGrid()
{
Model.View_HJGL_WeldJoint model =new Model.View_HJGL_WeldJoint();
Model.View_HJGL_WeldJoint model = new Model.View_HJGL_WeldJoint();
model.ProjectId = this.CurrUser.LoginProjectId;
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2 )
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
{
model.UnitWorkId = this.tvControlItem.SelectedNodeID;
@@ -298,12 +298,12 @@ namespace FineUIPro.Web.HJGL.InfoQuery
}
model.WeldJointCode = this.txtWeldJointCode.Text;
var list= BLL.WeldJointService.GetViewWeldJointsBymodel(model);
var list = BLL.WeldJointService.GetViewWeldJointsBymodel(model);
View_HJGL_WeldJoint = list;
Grid1.RecordCount = list.Count;
// var table = this.GetPagedDataTable(Grid1, list);
var table = list.Skip(Grid1.PageSize * (Grid1.PageIndex)).Take(Grid1.PageSize).ToList();
Grid1.DataSource = table;
// var table = this.GetPagedDataTable(Grid1, list);
var table = list.Skip(Grid1.PageSize * (Grid1.PageIndex)).Take(Grid1.PageSize).ToList();
Grid1.DataSource = table;
Grid1.DataBind();
}
@@ -464,7 +464,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
}
protected void btnGetChart_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("JointQueryChart.aspx?JointComplete={0}&&JointNoComplete={1}&&JointPre={2}&&JointNoPre={3}", JointComplete, JointNoComplete, JointPre, JointNoPre, "编辑 - ")));
}
@@ -485,7 +485,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
var list = BLL.WeldJointService.GetViewWeldJointsBymodel(model);
View_HJGL_WeldJoint = list;
}
string path = Funs.RootPath + @"File\Excel\Temp\JointQuery.xlsx";
path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx");
var q = (from x in View_HJGL_WeldJoint
@@ -493,6 +493,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
{
= x.WeldJointCode,
= x.UnitName,
= x.FlowingSection,
1 = x.Material1Code,
2 = x.Material2Code,
= x.Size,
@@ -503,8 +504,8 @@ namespace FineUIPro.Web.HJGL.InfoQuery
= x.WeldingMethodCode,
WPS编号 = x.WPQCode,
= x.GrooveTypeCode,
= x.WeldingRod,
= x.WeldingWire,
= x.WeldingRodCode,
= x.WeldingWireCode,
= x.PreTemperature,
= x.JointAttribute,
= x.WeldingDate,
@@ -544,33 +545,38 @@ namespace FineUIPro.Web.HJGL.InfoQuery
{
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
{
var q = (from x in Funs.DB.View_HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.tvControlItem.SelectedNodeID
select new {
PipelineId=x.PipelineId,
WeldingDate=x.WeldingDate,
WeldJointCode=x.WeldJointCode,
PipelineCode=x.PipelineCode,
Size=x.Size,
var q = (from x in Funs.DB.View_HJGL_WeldJoint
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.tvControlItem.SelectedNodeID
select new
{
PipelineId = x.PipelineId,
WeldingDate = x.WeldingDate,
WeldJointCode = x.WeldJointCode,
PipelineCode = x.PipelineCode,
Size = x.Size,
});
var noCompipeline = from x in q
group x by x.PipelineId into g
select new
{
PipelineId = g.Key,
Count = (from x2 in g where x2.WeldingDate!=null && x2.WeldingDate!="" select x2).Count(),
};
var Noweldjoint =( from x in q
join y in noCompipeline on x.PipelineId equals y.PipelineId
where y.Count == 0
select new { =x.WeldJointCode ,
线=x.PipelineCode,
=x.Size}).ToList();
group x by x.PipelineId into g
select new
{
PipelineId = g.Key,
Count = (from x2 in g where x2.WeldingDate != null && x2.WeldingDate != "" select x2).Count(),
};
var Noweldjoint = (from x in q
join y in noCompipeline on x.PipelineId equals y.PipelineId
where y.Count == 0
select new
{
= x.WeldJointCode,
线 = x.PipelineCode,
= x.Size
}).ToList();
string path = Funs.RootPath + @"File\Excel\Temp\NoCompleteWeldjoint.xlsx";
path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx");
MiniExcel.SaveAs(path, Noweldjoint);
string fileName = "未完成管线焊口.xlsx";
FileInfo info = new FileInfo(path);
long fileSize = info.Length;
@@ -587,7 +593,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
{
Alert.Show("请选择主项");
}
}
/// <summary>
/// 导出方法
@@ -648,7 +654,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
parameter3D.ColorModel = colorModel;
parameter3D.TagNum = string.Join(",", weldjointcodes);
parameter3D.ButtonType = "2.1";
parameter3D.Crater_data = "1";
parameter3D.Crater_data = "1";
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
{
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
@@ -668,11 +674,11 @@ namespace FineUIPro.Web.HJGL.InfoQuery
parameter3D.Transparency = colorModel.PipelineComplete;
parameter3D.Finished_color = colorModel.JointCompleteColor;
parameter3D.Incomplete_color = colorModel.JointNOCompleteColor;
ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName;
ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName;
ctlAuditFlow.data = parameter3D;
ctlAuditFlow.BindData();
}
}
}
@@ -215,26 +215,26 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
if (pds.Count > 0 && pds != null)
{
var getPipeline = from x in Funs.DB.View_HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x;
var getMedium = from x in Funs.DB.Base_Medium where x.ProjectId == this.CurrUser.LoginProjectId select x;//介质
var getPipeLineClass = from x in Funs.DB.Base_PipingClass where x.ProjectId == this.CurrUser.LoginProjectId select x;//管道等级
var getDetectionRate = from x in Funs.DB.Base_DetectionRate select x;//探伤比例
var getDetectionType = from x in Funs.DB.Base_DetectionType select x;//探伤类型
var getPressurePipingClass = from x in Funs.DB.Base_PressurePipingClass select x;//压力管道级别
var getTestMedium = from x in Funs.DB.Base_TestMedium where x.TestType == "1" select x;//压力试验介质
var getLeakMedium = from x in Funs.DB.Base_TestMedium where x.TestType == "2" select x;//泄露性试验介质
var getPurgeMethod = from x in Funs.DB.Base_PurgeMethod select x;
var getMaterial = from x in Funs.DB.Base_Material select x;
var getWeldType = from x in Funs.DB.Base_WeldType select x;
Model.SGGLDB db = Funs.DB;
var getPipeline = from x in db.View_HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x;
var getMedium = from x in db.Base_Medium where x.ProjectId == this.CurrUser.LoginProjectId select x;//介质
var getPipeLineClass = from x in db.Base_PipingClass where x.ProjectId == this.CurrUser.LoginProjectId select x;//管道等级
var getDetectionRate = from x in db.Base_DetectionRate select x;//探伤比例
var getDetectionType = from x in db.Base_DetectionType select x;//探伤类型
var getPressurePipingClass = from x in db.Base_PressurePipingClass select x;//压力管道级别
var getTestMedium = from x in db.Base_TestMedium where x.TestType == "1" select x;//压力试验介质
var getLeakMedium = from x in db.Base_TestMedium where x.TestType == "2" select x;//泄露性试验介质
var getPurgeMethod = from x in db.Base_PurgeMethod select x;
var getMaterial = from x in db.Base_Material select x;
var getWeldType = from x in db.Base_WeldType select x;
//var getComponents = from x in Funs.DB.Base_Components where x.ProjeceId == this.CurrUser.LoginProjectId select x;
Model.WBS_UnitWork unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(Request.Params["UnitWorkId"]);
for (int i = 1; i < pds.Count; i++)
{
Model.View_HJGL_WeldJoint pipeline = new Model.View_HJGL_WeldJoint();
//pipeline.PipelineId = SQLHelper.GetNewID();
Model.WBS_UnitWork unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(Request.Params["UnitWorkId"]);
if (unitWork != null)
{
pipeline.UnitWorkId = Request.Params["UnitWorkId"];
@@ -662,7 +662,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
if (col6.Contains("RT"))
{
Model.Base_DetectionType rt = BLL.Base_DetectionTypeService.GetDetectionTypeIdByDetectionTypeCode("RT");
Model.Base_DetectionType rt = getDetectionType.FirstOrDefault(x => x.DetectionTypeCode == "RT");
if (rt != null)
{
pipeline.DetectionTypeId = rt.DetectionTypeId;
@@ -670,7 +670,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
else
{
Model.Base_DetectionType ut = BLL.Base_DetectionTypeService.GetDetectionTypeIdByDetectionTypeCode("UT");
Model.Base_DetectionType ut = getDetectionType.FirstOrDefault(x => x.DetectionTypeCode == "UT");
if (ut != null)
{
pipeline.DetectionTypeId = ut.DetectionTypeId;
@@ -681,7 +681,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
if (col6.Contains("MT"))
{
Model.Base_DetectionType mt = BLL.Base_DetectionTypeService.GetDetectionTypeIdByDetectionTypeCode("MT");
Model.Base_DetectionType mt = getDetectionType.FirstOrDefault(x => x.DetectionTypeCode == "MT");
if (mt != null)
{
pipeline.DetectionTypeId = mt.DetectionTypeId;
@@ -689,7 +689,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
else
{
Model.Base_DetectionType pt = BLL.Base_DetectionTypeService.GetDetectionTypeIdByDetectionTypeCode("PT");
Model.Base_DetectionType pt = getDetectionType.FirstOrDefault(x => x.DetectionTypeCode == "PT");
if (pt != null)
{
pipeline.DetectionTypeId = pt.DetectionTypeId;
@@ -1017,7 +1017,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
void addHJGL_WeldJoints(List<Model.View_HJGL_WeldJoint> PipelineList, string UnitWorkId)
{
var getpipelines = from y in Funs.DB.HJGL_Pipeline where y.UnitWorkId == UnitWorkId select y;
Model.SGGLDB db = Funs.DB;
var getpipelines = from y in db.HJGL_Pipeline where y.UnitWorkId == UnitWorkId select y;
var allWeldJoints = from x in db.HJGL_WeldJoint
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
where y.UnitWorkId == UnitWorkId
select x;
List<Model.HJGL_WeldJoint> weldJoints_add = new List<Model.HJGL_WeldJoint>();
var weldJoints = (from x in PipelineList
@@ -1055,7 +1060,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
temp.IsHotProess
}).ToList();
var weldJointCodes =weldJoints.Select(x=>x.WeldJointCode).Distinct().ToList();
var pipelineCodes = weldJoints.Select(x => x.PipelineCode).Distinct().ToList();
for (int i = 0; i < weldJoints.Count(); i++)
{
@@ -1076,7 +1080,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
weldJoint.ProjectId = weldJoints[i].ProjectId;
weldJoint.IsHotProess = weldJoints[i].IsHotProess;
var isExistJot = WeldJointService.GetWeldJointsByWeldJointCode(weldJoint.PipelineId, weldJoint.WeldJointCode);
var isExistJot = allWeldJoints.FirstOrDefault(x => x.PipelineId == weldJoint.PipelineId && x.WeldJointCode == weldJoint.WeldJointCode);
if (isExistJot != null) // 更新焊口
{
weldJoint.WeldJointId = isExistJot.WeldJointId;
@@ -1086,24 +1090,29 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
weldJoint.WeldJointId = SQLHelper.GetNewID();
weldJoints_add.Add(weldJoint);
//BLL.WeldJointService.AddWeldJoint(weldJoint);
}
}
//db.SubmitChanges();
if (weldJoints_add.Count > 0)
{
BLL.WeldJointService.AddBulkWeldJoint(weldJoints_add);
}
Model.SGGLDB db = Funs.DB;
var q = from x in db.HJGL_WeldJoint
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
where y.UnitWorkId == Request.Params["UnitWorkId"] && pipelineCodes.Contains(x.PipelineCode) && !weldJointCodes.Contains(x.WeldJointCode)
select x;
if (q.Count() > 0)
Model.SGGLDB db2 = Funs.DB;
List<Model.HJGL_WeldJoint> delJoints = new List<Model.HJGL_WeldJoint>();
var allWeldJoints2 = from x in db2.HJGL_WeldJoint
join y in db2.HJGL_Pipeline on x.PipelineId equals y.PipelineId
where y.UnitWorkId == Request.Params["UnitWorkId"]
select x;
foreach (var pipelineCode in pipelineCodes)
{
db.HJGL_WeldJoint.DeleteAllOnSubmit(q);
db.SubmitChanges();
var pipelineWeldJointCodes = weldJoints.Where(x => x.PipelineCode == pipelineCode).Select(x => x.WeldJointCode).ToList();
var q = allWeldJoints2.Where(x => x.PipelineCode == pipelineCode && !pipelineWeldJointCodes.Contains(x.WeldJointCode)).ToList();
delJoints.AddRange(q);
}
if (delJoints.Count() > 0)
{
db2.HJGL_WeldJoint.DeleteAllOnSubmit(delJoints);
db2.SubmitChanges();
}
}
@@ -1112,7 +1121,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
// string unitworkId = Request.Params["UnitWorkId"];
// var getPipeline = from x in Funs.DB.View_HJGL_WeldJoint where x.UnitWorkId== unitworkId select x;
// List<Model.HJGL_WeldJoint> weldJoints_add = new List<Model.HJGL_WeldJoint>();
// List<Model.HJGL_WeldJoint> weldJoints_add = new List<Model.HJGL_WeldJoint>();
// for (int i = 0; i < PipelineList.Count(); i++)
// {