2022-12-12 焊接wbs树速度优化
This commit is contained in:
@@ -11,6 +11,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
public partial class JotTwoDesign : PageBase
|
||||
{
|
||||
public int pageSize = 20;
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
@@ -87,10 +88,17 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
tn1.NodeID = q.UnitWorkId;
|
||||
tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
|
||||
tn1.ToolTip = "施工单位:" + u.UnitName;
|
||||
tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
|
||||
tn1.EnableClickEvent = true;
|
||||
tn1.EnableExpandEvent = true;
|
||||
rootNode1.Nodes.Add(tn1);
|
||||
if (a > 0)
|
||||
{
|
||||
BindNodes(tn1);
|
||||
// BindNodes(tn1);
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = "加载管线...";
|
||||
newNode.NodeID = "加载管线...";
|
||||
tn1.Nodes.Add(newNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,10 +116,17 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
tn2.Expanded = true;
|
||||
}
|
||||
tn2.ToolTip = "施工单位:" + u.UnitName;
|
||||
tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
|
||||
tn2.EnableClickEvent = true;
|
||||
tn2.EnableExpandEvent = true;
|
||||
rootNode2.Nodes.Add(tn2);
|
||||
if (a > 0)
|
||||
{
|
||||
BindNodes(tn2);
|
||||
// BindNodes(tn1);
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = "加载管线...";
|
||||
newNode.NodeID = "加载管线...";
|
||||
tn2.Nodes.Add(newNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,51 +140,67 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
|
||||
orderby x.PipelineCode
|
||||
select x).ToList();
|
||||
foreach (var item in pipeline)
|
||||
int pageindex = int.Parse(node.CommandName.Split('|')[0]);
|
||||
int pageCount = int.Parse(node.CommandName.Split('|')[1]);
|
||||
if (pageindex <= pageCount)
|
||||
{
|
||||
//var jotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == true select x).Count();
|
||||
//var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == true && 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() + " " + "焊口" + "】";
|
||||
//}
|
||||
|
||||
var jotCount = (from x in WeldJointService.hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == true select x).Count();
|
||||
var AuditCount= (from x in WeldJointService.hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == true && x.AuditDate !=null select x).Count();
|
||||
TreeNode newNode = new TreeNode();
|
||||
|
||||
if (jotCount== AuditCount) //全部审核
|
||||
pipeline = pipeline.Skip(pageSize * (pageindex - 1)).Take(pageSize).ToList();
|
||||
foreach (var item in pipeline)
|
||||
{
|
||||
newNode.Text = "<font color='#00FF00'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
|
||||
//var jotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == true select x).Count();
|
||||
//var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == true && 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() + " " + "焊口" + "】";
|
||||
//}
|
||||
|
||||
var jotCount = (from x in WeldJointService.hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == true select x).Count();
|
||||
var AuditCount = (from x in WeldJointService.hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == true && x.AuditDate != null select x).Count();
|
||||
TreeNode newNode = new TreeNode();
|
||||
|
||||
if (jotCount == AuditCount) //全部审核
|
||||
{
|
||||
newNode.Text = "<font color='#00FF00'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
|
||||
|
||||
}
|
||||
else if (AuditCount == 0) //全部未审核
|
||||
{
|
||||
newNode.Text = "<font color='#FF0000'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
|
||||
|
||||
}
|
||||
else //部分审核
|
||||
{
|
||||
newNode.Text = "<font color='#B9B925'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
|
||||
|
||||
}
|
||||
//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);
|
||||
}
|
||||
else if ( AuditCount==0) //全部未审核
|
||||
if (pageindex < pageCount)
|
||||
{
|
||||
newNode.Text = "<font color='#FF0000'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
|
||||
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = "加载";
|
||||
newNode.NodeID = SQLHelper.GetNewID();
|
||||
newNode.CommandName = "加载";
|
||||
newNode.Icon = Icon.ArrowDown;
|
||||
newNode.EnableClickEvent = true;
|
||||
node.Nodes.Add(newNode);
|
||||
}
|
||||
else //部分审核
|
||||
{
|
||||
newNode.Text = "<font color='#B9B925'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
|
||||
|
||||
}
|
||||
//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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,8 +218,25 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
|
||||
}
|
||||
if (e.CommandName == "加载")
|
||||
{
|
||||
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);
|
||||
}
|
||||
this.BindGrid();
|
||||
}
|
||||
protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
|
||||
{
|
||||
if (e.Node.Nodes[0].NodeID == "加载管线...")
|
||||
{
|
||||
e.Node.Nodes.Clear();
|
||||
BindNodes(e.Node);
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 数据绑定
|
||||
|
||||
Reference in New Issue
Block a user