2023-02-20 001 焊接修改

This commit is contained in:
2023-02-20 10:49:51 +08:00
parent 7e66339f48
commit ef6bbc170e
37 changed files with 1649 additions and 306 deletions
@@ -9,6 +9,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
public partial class WeldMatMatch : PageBase
{
public int pageSize = PipelineService.pageSize;
public string PipeArea
{
get
@@ -105,7 +107,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
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)
@@ -123,6 +125,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
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 == PipeArea select x).Count();
// var NowComPipelineCode = PipelineService.GetNoComPipelinesByUnitWordId(q.UnitWorkId);
//int a = NowComPipelineCode.Count();
var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId;
@@ -132,7 +136,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
tn2.Expanded = true;
}
tn2.ToolTip = "施工单位:" + u.UnitName;
tn2.CommandName = "单位工程";
tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
tn2.EnableExpandEvent = true;
tn2.EnableClickEvent= true;
rootNode2.Nodes.Add(tn2);
@@ -147,50 +151,56 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
}
private void BindNodes(TreeNode node)
{
var NowComPipelineCode = PipelineService.GetNoComPipelinesByUnitWordId(node.NodeID);
if (!node.Text.Contains("|"))
{
node.Text += "|" + NowComPipelineCode.Count();
}
var pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
orderby x.PipelineCode
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();
foreach (var item in pipeline)
{
if (!NowComPipelineCode.Contains(item.PipelineCode))
{
continue;
}
TreeNode newNode = new TreeNode();
newNode.Text = item.PipelineCode ;
newNode.NodeID = item.PipelineId;
newNode.CommandName = "管线";
newNode.EnableClickEvent = true;
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);
}
}
}
protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
{
e.Node.Nodes.Clear();
if (e.Node.CommandName == "单位工程")
if (e.Node.Nodes[0].NodeID == "加载管线...")
{
var pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID && x.PipeArea == PipeArea
orderby x.PipelineCode
select x).ToList();
if (!string .IsNullOrEmpty (txtPipelineCode.Text.Trim()))
{
pipeline= pipeline.Where(x => x.PipelineCode.Contains(txtPipelineCode.Text.Trim())).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();
//if (jotCount > weldJotCount)
//{
// newNode.Text = "<font color='#EE0000'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
//}
//else
//{
// newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】";
//}
TreeNode newNode = new TreeNode();
string suf = " (0%)";
bool istrue = BLL.HJGL_MaterialService.isInStockByPipeline(item.PipelineId, this.CurrUser.LoginProjectId);
if (istrue)
{
suf = " (100%)";
newNode.CssClass = "tn-color-green";
}
newNode.Text = item.PipelineCode+suf; //+ "【" + jotCount.ToString() + " " + "焊口" + "】";
newNode.CommandName = "管线";
newNode.NodeID = item.PipelineId;
newNode.EnableClickEvent = true;
e.Node.Nodes.Add(newNode);
}
e.Node.Nodes.Clear();
BindNodes(e.Node);
}
}
@@ -208,6 +218,25 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// <param name="sender"></param>
/// <param name="e"></param>
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
{
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);
}
else
{
this.BindGrid();
}
}
#endregion
#region
protected void btnrefresh_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
@@ -218,11 +247,11 @@ namespace FineUIPro.Web.HJGL.WeldingManage
parameter3D.TagNum = "";
parameter3D.ButtonType = "3";
if (this.tvControlItem.SelectedNode.CommandName == "单位工程")
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
{
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
var pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == e.Node.NodeID && x.PipeArea == PipeArea
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == tvControlItem.SelectedNodeID && x.PipeArea == PipeArea
orderby x.PipelineCode
select x).ToList();
List<string> pipelineList = new List<string>();
@@ -235,8 +264,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
parameter3D.TagNum= string.Join(",", pipelineList);
//parameter3D.Line_No = string.Join(",", pipelineList);
parameter3D.TagNum = string.Join(",", pipelineList);
parameter3D.Line_No = string.Join(",", pipelineList);
}
else if (this.tvControlItem.SelectedNode.CommandName == "管线")
{
@@ -274,17 +303,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage
parameter3D.TagNum = pipecode;
}
}
}
ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName;
ctlAuditFlow.data = parameter3D;
ctlAuditFlow.BindData();
}
}
#endregion
#region
private void BindGrid()
{
string strSql = @"SELECT lib.MaterialCode,lib.MaterialName,lib.MaterialUnit,
@@ -325,7 +351,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
#endregion
#region
/// <summary>
/// 排序
@@ -383,6 +408,20 @@ namespace FineUIPro.Web.HJGL.WeldingManage
ctlAuditFlow.data = parameter3D;
ctlAuditFlow.BindData();
}
protected void btnStatisticsMat_Click(object sender, EventArgs e)
{
Model.WBS_UnitWork unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(this.tvControlItem.SelectedNodeID);
if (unitWork != null)
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("WeldMatMatchGet.aspx?UnitWorkId={0}&&PipeArea={1}", this.tvControlItem.SelectedNodeID, PipeArea, "匹配 - ")));
}
else
{
ShowNotify("请先选择单位工程!", MessageBoxIcon.Warning);
}
}
/// <summary>
/// 查询
/// </summary>