2022-11-23 焊接wbs树加载优化,管线划分数据加载优化

This commit is contained in:
2022-11-23 00:02:22 +08:00
parent fe520d1201
commit 0759a36121
17 changed files with 186 additions and 134 deletions
@@ -94,12 +94,13 @@
</Toolbars>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="管线信息" ForceFit="true"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="PipelineId" AllowCellEditing="true"
EnableCollapse="false" runat="server" BoxFlex="1" DataKeyNames="PipelineId" AllowCellEditing="true"
AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2" DataIDField="PipelineId"
AllowSorting="true" SortField="PipelineCode" SortDirection="ASC" OnSort="Grid1_Sort" EnableCheckBoxSelect="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
AllowSorting="true" OnSort="Grid1_Sort" EnableCheckBoxSelect="true" SortDirection="PipelineCode"
AllowPaging="true" OnPageIndexChange="Grid1_PageIndexChange"
OnRowClick="Grid1_RowClick" EnableRowClickEvent="true"
EnableTextSelection="True" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick">
EnableTextSelection="True" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick"
IsDatabasePaging="true" PageSize="200" EnableBigDataRowTip="false" EnableBigData="true" IsFluid="true" >
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
@@ -121,7 +122,7 @@
</f:TemplateField>
</Columns>
<PageItems>
<%--<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
@@ -134,7 +135,7 @@
<f:ListItem Text="25" Value="25" />
<f:ListItem Text="所有行" Value="10000" />
</f:DropDownList>
</PageItems>
</PageItems>--%>
</f:Grid>
</Items>
</f:Panel>
@@ -1,4 +1,5 @@
using BLL;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
@@ -11,6 +12,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
public partial class PipelingDivide : PageBase
{
public static List<Model.HJGL_Pipeline> view_HJGL_Pipelines =new List<Model.HJGL_Pipeline>();
public decimal PipelineComplete
{
get
@@ -50,7 +52,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
if (!IsPostBack)
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
// this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
this.InitTreeMenu();//加载树
PipelineComplete = 0;
PipelineNOComplete = 0;
@@ -116,7 +118,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
foreach (var q in unitWork1)
{
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count();
int a = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == q.UnitWorkId select x).Count();
var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId;
@@ -130,7 +132,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
foreach (var q in unitWork2)
{
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count();
int a = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == q.UnitWorkId select x).Count();
var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId;
@@ -152,6 +154,16 @@ namespace FineUIPro.Web.HJGL.PreDesign
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
{
this.BindGrid();
var q = view_HJGL_Pipelines.Where(x => x.PipeArea == PipelineService.PipeArea_SHOP);
if (q.Any())
{
List<string> listpipecode = new List<string>();
foreach (var item in q)
{
listpipecode.Add("/" + item.PipelineCode);
}
Line_No = string.Join(",", listpipecode);
}
Model.Parameter3D parameter3D = new Model.Parameter3D();
Model.ColorModel colorModel = new Model.ColorModel();
colorModel = BLL.Project_SysSetService.GetColorModel(this.CurrUser.LoginProjectId);
@@ -174,32 +186,24 @@ namespace FineUIPro.Web.HJGL.PreDesign
private void BindGrid()
{
Model.View_HJGL_Pipeline view_HJGL_Pipeline = new Model.View_HJGL_Pipeline();
Model.HJGL_Pipeline view_HJGL_Pipeline = new Model.HJGL_Pipeline();
view_HJGL_Pipeline.ProjectId = this.CurrUser.LoginProjectId;
view_HJGL_Pipeline.UnitWorkId = this.tvControlItem.SelectedNodeID;
view_HJGL_Pipeline.PipelineCode = this.txtPipelineCode.Text.Trim();
view_HJGL_Pipeline.SingleName = this.txtSingleName.Text.Trim();
view_HJGL_Pipeline.DesignPress=this.txtDesignPress.Text.Trim();
view_HJGL_Pipeline.MaterialCode=this.txtMaterialCode.Text.Trim();
// view_HJGL_Pipeline.MaterialCode=this.txtMaterialCode.Text.Trim();
var list = BLL.PipelineService.GetView_HJGL_Pipelines(view_HJGL_Pipeline);
var q = list.Where(x => x.PipeArea == PipelineService.PipeArea_SHOP );
var q2 = list.Where(x => x.PipeArea == PipelineService.PipeArea_FIELD );
if (q.Any())
{
List<string> listpipecode = new List<string>();
foreach (var item in q)
{
listpipecode.Add("/" + item.PipelineCode);
}
Line_No = string.Join(",", listpipecode);
}
PipelineComplete = q.Count();
PipelineNOComplete = q2.Count();
view_HJGL_Pipelines = list;
// 2.获取当前分页数据
Grid1.RecordCount = list.Count();
//list = GetFilteredTable(Grid1.FilteredData, list);
var table = this.GetPagedDataTable(Grid1, list);
// 2.获取当前分页数据
// 3.绑定到Grid
var table = this.GetPagedDataTable(Grid1, list);
Grid1.DataSource = table;
Grid1.DataBind();
}
@@ -241,7 +245,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
// Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
#endregion
@@ -325,7 +329,11 @@ namespace FineUIPro.Web.HJGL.PreDesign
#region
protected void btnGetChart_Click(object sender, EventArgs e)
{
var q = view_HJGL_Pipelines.Where(x => x.PipeArea == PipelineService.PipeArea_SHOP);
var q2 = view_HJGL_Pipelines.Where(x => x.PipeArea == PipelineService.PipeArea_FIELD);
PipelineComplete = q.Count();
PipelineNOComplete = q2.Count();
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("PipelingDivideChart.aspx?PipelineComplete={0}&&PipelineNOComplete={1}", PipelineComplete, PipelineNOComplete, "编辑 - ")));
}
@@ -239,33 +239,6 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// </remarks>
protected global::System.Web.UI.WebControls.Label txt;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
@@ -77,7 +77,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
foreach (var q in unitWork1)
{
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" select x).Count();
int a = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" select x).Count();
var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId;
@@ -94,7 +94,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
foreach (var q in unitWork2)
{
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" select x).Count();
int a = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" select x).Count();
var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId;
@@ -116,7 +116,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
private void BindNodes(TreeNode node)
{
List<Model.HJGL_Pipeline> pipeline = new List<Model.HJGL_Pipeline>();
var pipelines = from x in Funs.DB.HJGL_Pipeline where x.PipeArea == "1" select x;
var pipelines = from x in PipelineService.hJGL_Pipelines where x.PipeArea == "1" select x;
pipeline = (from x in pipelines
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())