2022-09-05 16:36:31 +08:00
|
|
|
|
using BLL;
|
2023-02-14 19:59:12 +08:00
|
|
|
|
using FineUIPro.Web.HJGL.WeldingManage;
|
2022-10-13 18:52:45 +08:00
|
|
|
|
using Model;
|
2022-09-05 16:36:31 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
using System.Data.SqlClient;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using AspNet = System.Web.UI.WebControls;
|
|
|
|
|
|
|
|
|
|
|
|
namespace FineUIPro.Web.HJGL.InfoQuery
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class JointQuery : PageBase
|
|
|
|
|
|
{
|
2023-02-14 19:59:12 +08:00
|
|
|
|
public int pageSize = 20;
|
2022-10-19 15:49:56 +08:00
|
|
|
|
public decimal JointComplete
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return (decimal)ViewState["JointComplete"];
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
ViewState["JointComplete"] = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public decimal JointNoComplete
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return (decimal)ViewState["JointNoComplete"];
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
ViewState["JointNoComplete"] = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public int JointPre
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return (int)ViewState["JointPre"];
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
ViewState["JointPre"] = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public int JointNoPre
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return (int)ViewState["JointNoPre"];
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
ViewState["JointNoPre"] = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-10-25 22:30:17 +08:00
|
|
|
|
public string Completed_weldedjunction
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return (string)ViewState["Completed_weldedjunction"];
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
ViewState["Completed_weldedjunction"] = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public string Incomplete_weldjunction
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return (string)ViewState["Incomplete_weldjunction"];
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
ViewState["Incomplete_weldjunction"] = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-09-05 16:36:31 +08:00
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
ctlAuditFlow.Url = BLL.Project_SysSetService.GetAvevaNetUrl(this.CurrUser.LoginProjectId);
|
|
|
|
|
|
if (!IsPostBack)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
|
|
|
|
|
|
this.InitTreeMenu();//加载树
|
2022-10-19 15:49:56 +08:00
|
|
|
|
this.JointComplete = 0;
|
|
|
|
|
|
this.JointNoComplete =0;
|
|
|
|
|
|
this.JointPre =0;
|
|
|
|
|
|
this.JointNoPre = 0;
|
2022-09-05 16:36:31 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#region 加载树装置-单位-工作区
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 加载树
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void InitTreeMenu()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.tvControlItem.Nodes.Clear();
|
|
|
|
|
|
|
|
|
|
|
|
TreeNode rootNode1 = new TreeNode();
|
|
|
|
|
|
rootNode1.NodeID = "1";
|
|
|
|
|
|
rootNode1.Text = "建筑工程";
|
|
|
|
|
|
rootNode1.CommandName = "建筑工程";
|
|
|
|
|
|
rootNode1.Selectable = false;
|
|
|
|
|
|
this.tvControlItem.Nodes.Add(rootNode1);
|
|
|
|
|
|
|
|
|
|
|
|
TreeNode rootNode2 = new TreeNode();
|
|
|
|
|
|
rootNode2.NodeID = "2";
|
|
|
|
|
|
rootNode2.Text = "安装工程";
|
|
|
|
|
|
rootNode2.CommandName = "安装工程";
|
|
|
|
|
|
rootNode2.Expanded = true;
|
|
|
|
|
|
this.tvControlItem.Nodes.Add(rootNode2);
|
|
|
|
|
|
|
|
|
|
|
|
var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
|
|
|
|
|
|
// 获取当前用户所在单位
|
|
|
|
|
|
var currUnit = pUnits.FirstOrDefault(x => x.UnitId == this.CurrUser.UnitId);
|
|
|
|
|
|
|
|
|
|
|
|
var unitWorkList = (from x in Funs.DB.WBS_UnitWork
|
|
|
|
|
|
where x.ProjectId == this.CurrUser.LoginProjectId
|
|
|
|
|
|
&& x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null
|
|
|
|
|
|
select x).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
List<Model.WBS_UnitWork> unitWork1 = null;
|
|
|
|
|
|
List<Model.WBS_UnitWork> unitWork2 = null;
|
|
|
|
|
|
|
|
|
|
|
|
// 当前为施工单位,只能操作本单位的数据
|
|
|
|
|
|
if (currUnit != null && currUnit.UnitType == Const.ProjectUnitType_2)
|
|
|
|
|
|
{
|
|
|
|
|
|
unitWork1 = (from x in unitWorkList
|
|
|
|
|
|
where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "1"
|
|
|
|
|
|
select x).ToList();
|
|
|
|
|
|
unitWork2 = (from x in unitWorkList
|
|
|
|
|
|
where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "2"
|
|
|
|
|
|
select x).ToList();
|
|
|
|
|
|
}
|
|
|
|
|
|
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();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (unitWork1.Count() > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var q in unitWork1)
|
|
|
|
|
|
{
|
2023-02-14 19:59:12 +08:00
|
|
|
|
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count();
|
|
|
|
|
|
var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
|
|
|
|
|
|
TreeNode tn1 = new TreeNode();
|
|
|
|
|
|
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)
|
2022-09-05 16:36:31 +08:00
|
|
|
|
{
|
2023-02-14 19:59:12 +08:00
|
|
|
|
// BindNodes(tn1);
|
|
|
|
|
|
TreeNode newNode = new TreeNode();
|
|
|
|
|
|
newNode.Text = "加载管线...";
|
|
|
|
|
|
newNode.NodeID = "加载管线...";
|
|
|
|
|
|
tn1.Nodes.Add(newNode);
|
2022-09-05 16:36:31 +08:00
|
|
|
|
}
|
2023-02-14 19:59:12 +08:00
|
|
|
|
//if (a > 0)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// BindNodes(tn1);
|
|
|
|
|
|
//}
|
2022-09-05 16:36:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (unitWork2.Count() > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var q in unitWork2)
|
|
|
|
|
|
{
|
2022-12-30 15:36:30 +08:00
|
|
|
|
int a = (from x in Funs.DB.HJGL_Pipeline
|
|
|
|
|
|
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId
|
2022-09-05 16:36:31 +08:00
|
|
|
|
&& x.PipelineCode.Contains(this.tvPipeCode.Text.Trim())
|
|
|
|
|
|
|
|
|
|
|
|
select x).Count();
|
|
|
|
|
|
var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
|
|
|
|
|
|
TreeNode tn2 = new TreeNode();
|
|
|
|
|
|
tn2.NodeID = q.UnitWorkId;
|
|
|
|
|
|
tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
|
|
|
|
|
|
if (q.UnitWorkId == this.hdUnitWorkId.Text)
|
|
|
|
|
|
{
|
|
|
|
|
|
tn2.Expanded = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
tn2.ToolTip = "施工单位:" + u.UnitName;
|
2023-02-14 19:59:12 +08:00
|
|
|
|
tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
|
2022-10-31 17:03:08 +08:00
|
|
|
|
tn2.EnableClickEvent = true;
|
2023-02-14 19:59:12 +08:00
|
|
|
|
tn2.EnableExpandEvent = true;
|
2022-09-05 16:36:31 +08:00
|
|
|
|
rootNode2.Nodes.Add(tn2);
|
|
|
|
|
|
if (a > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
// BindNodes(tn2);
|
|
|
|
|
|
TreeNode newNode = new TreeNode();
|
|
|
|
|
|
newNode.Text = "加载管线...";
|
|
|
|
|
|
newNode.NodeID = "加载管线...";
|
|
|
|
|
|
tn2.Nodes.Add(newNode);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 点击TreeView
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 点击TreeView
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
|
|
|
|
|
|
{
|
2023-02-14 19:59:12 +08:00
|
|
|
|
if (e.CommandName == "加载")
|
2022-10-15 15:40:49 +08:00
|
|
|
|
{
|
2023-02-14 19:59:12 +08:00
|
|
|
|
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);
|
2022-10-15 15:40:49 +08:00
|
|
|
|
}
|
2023-02-14 19:59:12 +08:00
|
|
|
|
else
|
2022-10-15 15:40:49 +08:00
|
|
|
|
{
|
2023-02-14 19:59:12 +08:00
|
|
|
|
this.BindGrid();
|
|
|
|
|
|
Model.Parameter3D parameter3D = new Model.Parameter3D();
|
|
|
|
|
|
Model.ColorModel colorModel = new Model.ColorModel();
|
|
|
|
|
|
colorModel = BLL.Project_SysSetService.GetColorModel(this.CurrUser.LoginProjectId);
|
|
|
|
|
|
parameter3D.ColorModel = colorModel;
|
|
|
|
|
|
parameter3D.TagNum = "";
|
|
|
|
|
|
parameter3D.ButtonType = "2.1";
|
|
|
|
|
|
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
|
|
|
|
|
|
|
|
|
|
|
|
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
|
2022-10-15 15:40:49 +08:00
|
|
|
|
{
|
2023-02-14 19:59:12 +08:00
|
|
|
|
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
|
|
|
|
|
|
parameter3D.Crater_data = "0";
|
|
|
|
|
|
parameter3D.Completed_weldedjunction = Completed_weldedjunction;
|
|
|
|
|
|
parameter3D.Incomplete_weldjunction = Incomplete_weldjunction;
|
2022-10-15 15:40:49 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
2023-02-14 19:59:12 +08:00
|
|
|
|
else if (this.tvControlItem.SelectedNode.CommandName == "管线")
|
|
|
|
|
|
{
|
|
|
|
|
|
var model = PipelineService.GetPipelineByPipelineId(tvControlItem.SelectedNodeID);
|
|
|
|
|
|
if (model != null && !string.IsNullOrEmpty(model.UnitWorkId))
|
|
|
|
|
|
{
|
|
|
|
|
|
parameter3D.Crater_data = "1";
|
|
|
|
|
|
parameter3D.TagNum = "/" + model.PipelineCode;
|
|
|
|
|
|
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(model.UnitWorkId);
|
2022-09-05 16:36:31 +08:00
|
|
|
|
|
2023-02-14 19:59:12 +08:00
|
|
|
|
}
|
2022-10-28 17:01:51 +08:00
|
|
|
|
|
2023-02-14 19:59:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
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.data = parameter3D;
|
|
|
|
|
|
ctlAuditFlow.BindData();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-05 16:36:31 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
|
|
|
|
|
|
{
|
2022-12-30 15:36:30 +08:00
|
|
|
|
|
2023-02-14 19:59:12 +08:00
|
|
|
|
if (e.Node.Nodes[0].NodeID == "加载管线...")
|
|
|
|
|
|
{
|
|
|
|
|
|
e.Node.Nodes.Clear();
|
|
|
|
|
|
BindNodes(e.Node);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
private void BindNodes(TreeNode node)
|
|
|
|
|
|
{
|
|
|
|
|
|
var pipeline = (from x in Funs.DB.HJGL_Pipeline
|
|
|
|
|
|
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == 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();
|
|
|
|
|
|
int pageindex = int.Parse(node.CommandName.Split('|')[0]);
|
|
|
|
|
|
int pageCount = int.Parse(node.CommandName.Split('|')[1]);
|
|
|
|
|
|
if (pageindex <= pageCount)
|
|
|
|
|
|
{
|
|
|
|
|
|
pipeline = pipeline.Skip(pageSize * (pageindex - 1)).Take(pageSize).ToList();
|
2022-09-05 16:36:31 +08:00
|
|
|
|
foreach (var item in pipeline)
|
|
|
|
|
|
{
|
2022-12-30 15:36:30 +08:00
|
|
|
|
var jotCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId /*&& x.IsTwoJoint == null*/ select x).Count();
|
2022-09-05 16:36:31 +08:00
|
|
|
|
TreeNode newNode = new TreeNode();
|
|
|
|
|
|
newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】";
|
|
|
|
|
|
newNode.NodeID = item.PipelineId;
|
|
|
|
|
|
newNode.CommandName = "管线";
|
|
|
|
|
|
newNode.EnableClickEvent = true;
|
2023-02-14 19:59:12 +08:00
|
|
|
|
node.Nodes.Add(newNode);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (pageindex < pageCount)
|
|
|
|
|
|
{
|
|
|
|
|
|
TreeNode newNode = new TreeNode();
|
|
|
|
|
|
newNode.Text = "加载";
|
|
|
|
|
|
newNode.NodeID = SQLHelper.GetNewID();
|
|
|
|
|
|
newNode.CommandName = "加载";
|
|
|
|
|
|
newNode.Icon = Icon.ArrowDown;
|
|
|
|
|
|
newNode.EnableClickEvent = true;
|
|
|
|
|
|
node.Nodes.Add(newNode);
|
2022-09-05 16:36:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
private void BindGrid()
|
|
|
|
|
|
{
|
2022-10-25 22:30:17 +08:00
|
|
|
|
//string strSql = @"SELECT * FROM dbo.View_HJGL_JointInfoQuery
|
|
|
|
|
|
// WHERE ProjectId= @ProjectId";
|
|
|
|
|
|
//List<SqlParameter> listStr = new List<SqlParameter>();
|
|
|
|
|
|
//listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
|
|
|
|
|
|
//if (this.tvControlItem.SelectedNode.CommandName == "单位工程")
|
|
|
|
|
|
//{
|
|
|
|
|
|
// strSql += " AND UnitWorkId =@UnitWorkId";
|
|
|
|
|
|
// listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNodeID));
|
|
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else if (this.tvControlItem.SelectedNode.CommandName == "管线")
|
|
|
|
|
|
//{
|
|
|
|
|
|
// strSql += " AND PipelineId = @PipelineId";
|
|
|
|
|
|
// listStr.Add(new SqlParameter("@PipelineId", this.tvControlItem.SelectedNodeID));
|
|
|
|
|
|
//}
|
|
|
|
|
|
//if (!string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim()))
|
|
|
|
|
|
//{
|
|
|
|
|
|
// strSql += " AND WeldJointCode LIKE @WeldJointCode";
|
|
|
|
|
|
// listStr.Add(new SqlParameter("@WeldJointCode", this.txtWeldJointCode.Text.Trim()));
|
|
|
|
|
|
//}
|
|
|
|
|
|
//SqlParameter[] parameter = listStr.ToArray();
|
|
|
|
|
|
//DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
|
|
|
|
|
//var q = tb.AsEnumerable().Where(x => x["WeldingDate"].ToString() != "");
|
|
|
|
|
|
//var q2 = tb.AsEnumerable().Where(x => x["JointAttribute"].ToString() == "预制口");
|
|
|
|
|
|
//var sumcount = tb.Rows.Count;
|
|
|
|
|
|
//this.Grid1.RecordCount = tb.Rows.Count;
|
|
|
|
|
|
Model.View_HJGL_WeldJoint model =new Model.View_HJGL_WeldJoint();
|
|
|
|
|
|
model.ProjectId = this.CurrUser.LoginProjectId;
|
2023-02-14 19:59:12 +08:00
|
|
|
|
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2 )
|
2022-09-05 16:36:31 +08:00
|
|
|
|
{
|
2022-10-25 22:30:17 +08:00
|
|
|
|
model.UnitWorkId = this.tvControlItem.SelectedNodeID;
|
2022-09-05 16:36:31 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (this.tvControlItem.SelectedNode.CommandName == "管线")
|
|
|
|
|
|
{
|
2022-10-25 22:30:17 +08:00
|
|
|
|
model.PipelineId= this.tvControlItem.SelectedNodeID;
|
2022-09-05 16:36:31 +08:00
|
|
|
|
}
|
2022-10-25 22:30:17 +08:00
|
|
|
|
model.WeldJointCode = this.txtWeldJointCode.Text;
|
|
|
|
|
|
var list= BLL.WeldJointService.GetViewWeldJointsBymodel(model);
|
2023-02-14 19:59:12 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(ctlAuditFlow.Url))
|
|
|
|
|
|
{
|
|
|
|
|
|
get3DParmeter_weldjoint(list);//获取三维所需焊口参数
|
|
|
|
|
|
var q = list.Where(x => !string.IsNullOrEmpty(x.WeldingDate));
|
|
|
|
|
|
var q2 = list.Where(x => x.JointAttribute == "预制口");
|
|
|
|
|
|
var sumcount = list.Count;
|
|
|
|
|
|
this.Grid1.RecordCount = list.Count;
|
|
|
|
|
|
|
|
|
|
|
|
this.JointComplete = q.Count();
|
|
|
|
|
|
this.JointNoComplete = sumcount - JointComplete;
|
|
|
|
|
|
this.JointPre = q2.Count();
|
|
|
|
|
|
this.JointNoPre = sumcount - JointPre;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var table = this.GetPagedDataTable(Grid1, list);
|
|
|
|
|
|
Grid1.DataSource = table;
|
|
|
|
|
|
Grid1.RecordCount = list.Count;
|
2022-09-05 16:36:31 +08:00
|
|
|
|
Grid1.DataBind();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-10-25 22:30:17 +08:00
|
|
|
|
private void get3DParmeter_weldjoint(List<View_HJGL_WeldJoint> model)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (model.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
var q = model.Where(x => !string.IsNullOrEmpty(x.WeldingDate));//获取已完成焊口
|
|
|
|
|
|
if (q.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
List<string> Completed_weldedjunctionList = new List<string>();
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in q)
|
|
|
|
|
|
{
|
|
|
|
|
|
Completed_weldedjunctionList.Add("/" + item.WeldJointCode);
|
|
|
|
|
|
}
|
|
|
|
|
|
Completed_weldedjunction = string.Join(",", Completed_weldedjunctionList);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var q1 = model.Where(x => string.IsNullOrEmpty(x.WeldingDate));//获取未完成管线
|
|
|
|
|
|
if (q1.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
List<string> Incomplete_weldjunctionList = new List<string>();
|
|
|
|
|
|
foreach (var item in q1)
|
|
|
|
|
|
{
|
2022-10-28 18:10:36 +08:00
|
|
|
|
Incomplete_weldjunctionList.Add("/" + item.WeldJointCode);
|
2022-10-25 22:30:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
Incomplete_weldjunction = string.Join(",", Incomplete_weldjunctionList);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2022-09-05 16:36:31 +08:00
|
|
|
|
|
|
|
|
|
|
#region
|
|
|
|
|
|
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 分页下拉选择事件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
|
|
|
|
|
BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 排序
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 统计按钮事件
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 统计
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void BtnAnalyse_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 树查询
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void btnTreeFind_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.InitTreeMenu();
|
|
|
|
|
|
//this.BindGrid3(this.tvControlItem.SelectedNodeID);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void Tree_TextChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.InitTreeMenu();
|
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
protected void btnGetChart_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
2022-10-19 15:49:56 +08:00
|
|
|
|
|
|
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("JointQueryChart.aspx?JointComplete={0}&&JointNoComplete={1}&&JointPre={2}&&JointNoPre={3}", JointComplete, JointNoComplete, JointPre, JointNoPre, "编辑 - ")));
|
2022-09-05 16:36:31 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 导出按钮
|
|
|
|
|
|
/// 导出按钮
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void btnOut_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
2023-02-14 19:59:12 +08:00
|
|
|
|
Model.View_HJGL_WeldJoint model = new Model.View_HJGL_WeldJoint();
|
|
|
|
|
|
model.ProjectId = this.CurrUser.LoginProjectId;
|
|
|
|
|
|
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
model.UnitWorkId = this.tvControlItem.SelectedNodeID;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (this.tvControlItem.SelectedNode.CommandName == "管线")
|
|
|
|
|
|
{
|
|
|
|
|
|
model.PipelineId = this.tvControlItem.SelectedNodeID;
|
|
|
|
|
|
}
|
|
|
|
|
|
model.WeldJointCode = this.txtWeldJointCode.Text;
|
|
|
|
|
|
var list = BLL.WeldJointService.GetViewWeldJointsBymodel(model);
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-05 16:36:31 +08:00
|
|
|
|
Response.ClearContent();
|
|
|
|
|
|
string filename = Funs.GetNewFileName();
|
|
|
|
|
|
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("焊口台账总览" + filename, System.Text.Encoding.UTF8) + ".xls");
|
|
|
|
|
|
Response.ContentType = "application/excel";
|
|
|
|
|
|
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
|
|
|
|
|
Response.Write(GetGridTableHtml(Grid1));
|
|
|
|
|
|
Response.End();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 导出方法
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="grid"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
private string GetGridTableHtml(Grid grid)
|
|
|
|
|
|
{
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
|
grid.PageSize = 10000;
|
|
|
|
|
|
BindGrid();
|
|
|
|
|
|
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
|
|
|
|
|
|
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
|
|
|
|
|
|
sb.Append("<tr>");
|
|
|
|
|
|
foreach (GridColumn column in grid.Columns)
|
|
|
|
|
|
{
|
|
|
|
|
|
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
|
|
|
|
|
|
}
|
|
|
|
|
|
sb.Append("</tr>");
|
|
|
|
|
|
foreach (GridRow row in grid.Rows)
|
|
|
|
|
|
{
|
|
|
|
|
|
sb.Append("<tr>");
|
|
|
|
|
|
foreach (GridColumn column in grid.Columns)
|
|
|
|
|
|
{
|
|
|
|
|
|
string html = row.Values[column.ColumnIndex].ToString();
|
|
|
|
|
|
if (column.ColumnID == "tfNumber")
|
|
|
|
|
|
{
|
|
|
|
|
|
html = (row.FindControl("labNumber") as AspNet.Label).Text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sb.AppendFormat("<td>{0}</td>", html);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sb.Append("</tr>");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sb.Append("</table>");
|
|
|
|
|
|
|
|
|
|
|
|
return sb.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2022-10-13 18:52:45 +08:00
|
|
|
|
protected void Grid1_RowClick(object sender, GridRowClickEventArgs e)
|
|
|
|
|
|
{
|
2022-11-03 17:39:51 +08:00
|
|
|
|
var Id = Grid1.SelectedRowIDArray;
|
|
|
|
|
|
List<string> weldjointcodes = new List<string>();
|
|
|
|
|
|
foreach (var item in Id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var WeldJointCode = WeldJointService.GetViewWeldJointById(item).WeldJointCode;
|
|
|
|
|
|
weldjointcodes.Add("/" + WeldJointCode);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//var q = WeldJointService.GetViewWeldJointById(Grid1.SelectedRowID).PipelineCode;
|
|
|
|
|
|
//var pipecode = "/" + q;
|
2022-10-13 18:52:45 +08:00
|
|
|
|
Model.Parameter3D parameter3D = new Model.Parameter3D();
|
|
|
|
|
|
Model.ColorModel colorModel = new Model.ColorModel();
|
|
|
|
|
|
colorModel = BLL.Project_SysSetService.GetColorModel(this.CurrUser.LoginProjectId);
|
|
|
|
|
|
parameter3D.ColorModel = colorModel;
|
2022-11-03 17:39:51 +08:00
|
|
|
|
parameter3D.TagNum = string.Join(",", weldjointcodes);
|
|
|
|
|
|
parameter3D.ButtonType = "2.1";
|
2022-11-09 16:57:01 +08:00
|
|
|
|
parameter3D.Crater_data = "1";
|
2023-02-14 19:59:12 +08:00
|
|
|
|
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
|
2022-10-15 15:40:49 +08:00
|
|
|
|
{
|
|
|
|
|
|
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (this.tvControlItem.SelectedNode.CommandName == "管线")
|
|
|
|
|
|
{
|
|
|
|
|
|
var model = PipelineService.GetPipelineByPipelineId(tvControlItem.SelectedNodeID);
|
|
|
|
|
|
if (model != null && !string.IsNullOrEmpty(model.UnitWorkId))
|
|
|
|
|
|
{
|
|
|
|
|
|
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(model.UnitWorkId);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2022-10-28 17:01:51 +08:00
|
|
|
|
parameter3D.Transparency = colorModel.PipelineComplete;
|
|
|
|
|
|
parameter3D.Finished_color = colorModel.JointCompleteColor;
|
|
|
|
|
|
parameter3D.Incomplete_color = colorModel.JointNOCompleteColor;
|
2023-01-05 17:42:44 +08:00
|
|
|
|
ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName;
|
2022-10-13 18:52:45 +08:00
|
|
|
|
ctlAuditFlow.data = parameter3D;
|
|
|
|
|
|
ctlAuditFlow.BindData();
|
|
|
|
|
|
}
|
2022-09-05 16:36:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|