2023-02-16 焊接修改

This commit is contained in:
2023-02-16 17:19:08 +08:00
parent c19e51a290
commit 75431705fb
28 changed files with 599 additions and 342 deletions
@@ -13,6 +13,8 @@ namespace FineUIPro.Web.HJGL.DataImport
{
public partial class MaterialInformation : PageBase
{
public int pageSize = PipelineService.pageSize;
protected void Page_Load(object sender, EventArgs e)
{
@@ -95,7 +97,7 @@ namespace FineUIPro.Web.HJGL.DataImport
tn1.NodeID = q.UnitWorkId;
tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
tn1.ToolTip = "施工单位:" + u.UnitName;
tn1.CommandName = "单位工程";
tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
tn1.EnableExpandEvent = true;
rootNode1.Nodes.Add(tn1);
if (a > 0)
@@ -117,12 +119,12 @@ namespace FineUIPro.Web.HJGL.DataImport
TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId;
tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
if (q.UnitWorkId == this.hdUnitWorkId.Text)
{
tn2.Expanded = true;
}
//if (q.UnitWorkId == this.hdUnitWorkId.Text)
//{
// tn2.Expanded = true;
//}
tn2.ToolTip = "施工单位:" + u.UnitName;
tn2.CommandName = "单位工程";
tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
tn2.EnableExpandEvent = true;
tn2.EnableClickEvent = true;
@@ -143,31 +145,7 @@ namespace FineUIPro.Web.HJGL.DataImport
#region
private void BindNodes(TreeNode node)
{
//List<Model.HJGL_Pipeline> pipeline = new List<Model.HJGL_Pipeline>();
//var pipelines = from x in Funs.DB.HJGL_Pipeline select x;
//pipeline = (from x in pipelines
// where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID
// && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
// orderby x.PipelineCode
// select x).ToList();
//foreach (var item in pipeline)
//{
// var jotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == null select x).Count();
// var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == null && x.WeldingDailyId != null select x).Count();
// TreeNode newNode = new TreeNode();
// if (jotCount > weldJotCount)
// {
// newNode.Text = "<font color='#EE0000'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
// }
// else
// {
// newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】";
// }
// newNode.ToolTip = "管线号【焊口数】";
// newNode.NodeID = item.PipelineId;
// newNode.EnableClickEvent = true;
// node.Nodes.Add(newNode);
//}
BLL.PipelineService.BindTreeNodes(node, this.tvPipeCode.Text.Trim(), this.CurrUser.LoginProjectId, pageSize);
}
#endregion
@@ -176,35 +154,9 @@ namespace FineUIPro.Web.HJGL.DataImport
if (e.Node.Nodes[0].NodeID == "加载管线...")
{
e.Node.Nodes.Clear();
if (e.Node.CommandName == "单位工程")
{
var pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID
&& x.PipelineCode.Contains(this.tvPipeCode.Text.Trim())
orderby x.PipelineCode
select x).ToList();
var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x ).ToList();
foreach (var item in pipeline)
{
var jotCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == null select x).Count();
//var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == null && x.WeldingDailyId != null select x).Count();
TreeNode newNode = new TreeNode();
//if (jotCount > weldJotCount)
//{
// newNode.Text = "<font color='#EE0000'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
//}
//else
//{
// newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】";
//}
newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】";
newNode.NodeID = item.PipelineId;
newNode.EnableClickEvent = true;
e.Node.Nodes.Add(newNode);
}
}
BindNodes(e.Node);
}
}
@@ -217,23 +169,25 @@ namespace FineUIPro.Web.HJGL.DataImport
/// <param name="e"></param>
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
if (e.CommandName == "加载")
{
if (tvControlItem.SelectedNode.CommandName== "单位工程")
{
this.hdUnitWorkId.Text=tvControlItem.SelectedNode.NodeID.ToString();
//this.BindGrid1("", this.hdUnitWorkId.Text);
//this.BindGrid2("", this.hdUnitWorkId.Text);
}
else
string CommandName = e.Node.ParentNode.CommandName;
e.Node.ParentNode.CommandName = (int.Parse(CommandName.Split('|')[0]) + 1) + "|" + int.Parse(CommandName.Split('|')[1]);
TreeNode treeNode = e.Node.ParentNode;
treeNode.Nodes.Remove(e.Node);
BindNodes(e.Node.ParentNode);
}
else
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID);
this.hdUnitWorkId.Text = string.Empty;
if (pipeline != null)
{
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
this.BindGrid1(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
this.BindGrid2(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
if (pipeline.PipeArea == PipelineService.PipeArea_SHOP)
@@ -241,14 +195,16 @@ namespace FineUIPro.Web.HJGL.DataImport
TabStrip1.ActiveTabIndex = 0;
}
else
else
{
TabStrip1.ActiveTabIndex = 1;
}
}
}
}
}
}
@@ -267,12 +223,18 @@ namespace FineUIPro.Web.HJGL.DataImport
LEFT JOIN HJGL_Pipeline line ON pipe.PipelineId=line.PipelineId
WHERE line.UnitWorkId=@UnitWorkId and line.PipeArea='1' ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
{
strSql += " and lib.MaterialCode like @MaterialCode ";
listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(pipelineId))
{
strSql += " and pipe.PipelineId=@PipelineId order by PrefabricatedComponents";
strSql += " and pipe.PipelineId=@PipelineId order by PrefabricatedComponents ";
listStr.Add(new SqlParameter("@PipelineId", pipelineId));
}
listStr.Add(new SqlParameter("@UnitWorkId", unitworkid));
SqlParameter[] parameter = listStr.ToArray();
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
@@ -296,6 +258,11 @@ namespace FineUIPro.Web.HJGL.DataImport
listStr.Add(new SqlParameter("@PipelineId", pipelineId));
}
if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
{
strSql += " and lib.MaterialCode like @MaterialCode ";
listStr.Add(new SqlParameter("@MaterialCode", "%"+txtMaterialCode.Text.Trim() + "%"));
}
listStr.Add(new SqlParameter("@UnitWorkId", unitworkid));
SqlParameter[] parameter = listStr.ToArray();
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
@@ -574,13 +541,6 @@ namespace FineUIPro.Web.HJGL.DataImport
//this.BindGrid3(this.tvControlItem.SelectedNodeID);
}
protected void txtMaterialCode_TextChanged(object sender, EventArgs e)
{
this.BindGrid2(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
}
#endregion
#region
@@ -769,6 +729,17 @@ namespace FineUIPro.Web.HJGL.DataImport
}
#endregion
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnQuery_Click(object sender, EventArgs e)
{
this.BindGrid1(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
this.BindGrid2(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
}
#region
/// <summary>
/// 导入按钮