2022-12-09 焊接任务单树修改

This commit is contained in:
李鹏飞 2022-12-09 18:08:25 +08:00
parent 832d945a1d
commit fe4a0933ec
2 changed files with 149 additions and 76 deletions

View File

@ -229,6 +229,8 @@ namespace BLL
// 一、材质类别相等 // 一、材质类别相等
var wpq1 = from x in wpq where x.Material1Class == x.Material2Class select x; var wpq1 = from x in wpq where x.Material1Class == x.Material2Class select x;
foreach (var item in wpq1) foreach (var item in wpq1)
{
try
{ {
// 满足WPS第一个条件焊接方法为“PAW、SMAW、SAW、GMAW、FCAW、GTAW”且材质类别属于Fe-1~Fe-5A // 满足WPS第一个条件焊接方法为“PAW、SMAW、SAW、GMAW、FCAW、GTAW”且材质类别属于Fe-1~Fe-5A
if ((item.WeldingMethodCode == "PAW" || item.WeldingMethodCode == "SMAW" || item.WeldingMethodCode == "SAW" || item.WeldingMethodCode == "GMAW" || item.WeldingMethodCode == "FCAW" || item.WeldingMethodCode == "GTAW") if ((item.WeldingMethodCode == "PAW" || item.WeldingMethodCode == "SMAW" || item.WeldingMethodCode == "SAW" || item.WeldingMethodCode == "GMAW" || item.WeldingMethodCode == "FCAW" || item.WeldingMethodCode == "GTAW")
@ -367,6 +369,13 @@ namespace BLL
} }
} }
} }
catch (Exception ex )
{
ErrLogInfo.WriteLog(ex.ToString());
continue ;
}
}
// 一、材质类别不相等 // 一、材质类别不相等
var wpq2 = from x in wpq where x.Material1Class != x.Material2Class select x; var wpq2 = from x in wpq where x.Material1Class != x.Material2Class select x;
foreach (var item in wpq2) foreach (var item in wpq2)

View File

@ -1,10 +1,13 @@
using Aspose.Words; using Aspose.Words;
using BLL; using BLL;
using Model;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Linq; using System.Linq;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using System.Windows.Forms;
namespace FineUIPro.Web.HJGL.WeldingManage namespace FineUIPro.Web.HJGL.WeldingManage
{ {
public partial class SelectTaskWeldJoint : PageBase public partial class SelectTaskWeldJoint : PageBase
@ -81,7 +84,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage
ViewState["SelectedList"] = value; ViewState["SelectedList"] = value;
} }
} }
public List<HJGL_Pipeline> Tree_hJGL_Pipelines;
public int pageindex=1;
public int pageindex_2=1;
public int page;
#endregion #endregion
#region #region
@ -96,7 +102,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{ {
HJGL_MaterialService.materialStockItems_FIELD = new List<Model.MaterialStockItem>(); HJGL_MaterialService.materialStockItems_FIELD = new List<Model.MaterialStockItem>();
HJGL_MaterialService.materialStockItems_SHOP = new List<Model.MaterialStockItem>(); HJGL_MaterialService.materialStockItems_SHOP = new List<Model.MaterialStockItem>();
pageindex = 1;
pageindex_2 = 1;
Tree_hJGL_Pipelines =new List<HJGL_Pipeline> ();
this.txtTaskDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(1)); this.txtTaskDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(1));
this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text); this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text);
BLL.Base_WeldingLocationServie.InitWeldingLocationDropDownList(drpWeldingLocation, true); BLL.Base_WeldingLocationServie.InitWeldingLocationDropDownList(drpWeldingLocation, true);
@ -158,6 +166,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </summary> /// </summary>
private void InitTreeMenu() private void InitTreeMenu()
{ {
pageindex = 1;
pageindex_2 = 1;
this.tvControlItem.Nodes.Clear(); this.tvControlItem.Nodes.Clear();
TreeNode rootNode1 = new TreeNode(); TreeNode rootNode1 = new TreeNode();
rootNode1.NodeID = BLL.PipelineService.PipeArea_SHOP; rootNode1.NodeID = BLL.PipelineService.PipeArea_SHOP;
@ -204,11 +214,29 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
void AddTreeNode(string PipeArea , TreeNode node ) void AddTreeNode(string PipeArea , TreeNode node )
{ {
var iso = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipeArea orderby x.PipelineCode select x).ToList(); var iso = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipeArea orderby x.PipelineCode select x).ToList();
if (!string.IsNullOrEmpty(this.txtPipelineCode.Text)) if (!string.IsNullOrEmpty(this.txtPipelineCode.Text))
{ {
iso = (from x in iso where x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) orderby x.PipelineCode select x).ToList(); iso = (from x in iso where x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) orderby x.PipelineCode select x).ToList();
} }
int pagenum = 1 ;
switch (PipeArea)
{
case "1":
pagenum = pageindex;
break;
case "2":
pagenum = pageindex_2;
break;
}
var Count = iso.Count();
if (pagenum <= Count)
{
iso = iso.Skip(30 * (pagenum - 1)).Take(30).ToList(); ;
}
var joints = from x in WeldJointService.hJGL_WeldJoints select x; var joints = from x in WeldJointService.hJGL_WeldJoints select x;
foreach (var item in iso) foreach (var item in iso)
{ {
@ -225,6 +253,17 @@ namespace FineUIPro.Web.HJGL.WeldingManage
newNode.ToolTip = item.PipelineCode; newNode.ToolTip = item.PipelineCode;
newNode.EnableClickEvent = true; newNode.EnableClickEvent = true;
node.Nodes.Add(newNode); node.Nodes.Add(newNode);
}
if (pagenum < Count)
{
TreeNode newNode = new TreeNode();
newNode.Text = "下一页";
newNode.NodeID = "下一页";
newNode.Icon = Icon.ArrowDown;
newNode.CommandName = PipeArea;
newNode.EnableClickEvent = true;
node.Nodes.Add(newNode);
} }
} }
protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e) protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
@ -320,8 +359,33 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
{
if (e.NodeID == "下一页")
{
if (e.Node.CommandName == "1")
{
pageindex = pageindex + 1;
TreeNode treeNode = e.Node.ParentNode;
treeNode.Nodes.Remove(e.Node);
AddTreeNode(BLL.PipelineService.PipeArea_SHOP, e.Node.ParentNode);
}
else if (e.Node.CommandName == "2")
{
pageindex_2 = pageindex_2 + 1;
TreeNode treeNode = e.Node.ParentNode;
treeNode.Nodes.Remove(e.Node);
AddTreeNode(BLL.PipelineService.PipeArea_FIELD, e.Node.ParentNode);
}
}
else
{ {
this.BindGrid(); this.BindGrid();
}
} }
#endregion #endregion
#region #region