20230220 003焊接修改

This commit is contained in:
2023-02-20 21:59:35 +08:00
parent e2edbb0f51
commit 8e8eecbcfc
28 changed files with 4507 additions and 348 deletions
+159 -1
View File
@@ -10,6 +10,7 @@ using System.IO;
using System.Linq;
using System.Web.UI.DataVisualization.Charting;
using System.Web.UI.WebControls;
using System.Windows.Media.Animation;
using static BLL.PipelineService;
namespace BLL
@@ -221,6 +222,7 @@ namespace BLL
}
if (joint_Field_count == TaskJoints_Field.Count && joint_Field_count > 0)
{
model_pipeline.IsFinished = true;
ActDateEnd_FIELD = TaskJoints_Field.OrderByDescending(x => x.TaskDate).First().TaskDate.Value;
}
model_pipeline.ActStartDate = ActDateStart_FIELD;
@@ -246,7 +248,7 @@ namespace BLL
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public static List<HJGL_Pipeline> GetView_HJGL_Pipelines(HJGL_Pipeline model)
public static List<HJGL_Pipeline> GetHJGL_PipelineList(HJGL_Pipeline model)
{
var db = Funs.DB;
var pipelineList =( from x in Funs.DB.HJGL_Pipeline
@@ -273,6 +275,33 @@ namespace BLL
}
return pipelineList;
}
public static List<View_HJGL_Pipeline> GetView_HJGL_Pipelines(View_HJGL_Pipeline model)
{
var db = Funs.DB;
var pipelineList = (from x in Funs.DB.View_HJGL_Pipeline
where
(string.IsNullOrEmpty(model.ProjectId) || x.ProjectId.Contains(model.ProjectId))
&& (string.IsNullOrEmpty(model.UnitWorkId) || x.UnitWorkId.Contains(model.UnitWorkId))
&& (string.IsNullOrEmpty(model.PipelineCode) || x.PipelineCode.Contains(model.PipelineCode))
&& (string.IsNullOrEmpty(model.SingleName) || x.SingleName.Contains(model.SingleName))
&& (string.IsNullOrEmpty(model.DesignPress) || x.DesignPress.Contains(model.DesignPress))
/* && (string.IsNullOrEmpty(model.MaterialCode) || x.MaterialCode.Contains(model.MaterialCode))*/
select x).ToList();
if (model.IsFinished != null)
{
if (model.IsFinished == true)
{
pipelineList = pipelineList.Where(x => x.IsFinished == true).ToList();
}
else
{
pipelineList = pipelineList.Where(x => x.IsFinished == false || x.IsFinished == null).ToList();
}
}
return pipelineList;
}
/// <summary>
/// 根据unitworkId获取所有管线
/// </summary>
@@ -761,6 +790,135 @@ namespace BLL
}
}
}
/// <summary>
/// 根据组件材料编码查询管线
/// </summary>
/// <param name="node"></param>
/// <param name="pipecode"></param>
/// <param name="MaterialCode"></param>
/// <param name="ProjectId"></param>
/// <param name="pageSize"></param>
public static void BindTreeNodes(FineUIPro.TreeNode node, string pipecode,string MaterialCode, string ProjectId, int pageSize)
{
//var pipeline = (from x in Funs.DB.HJGL_Pipeline
// where x.ProjectId == ProjectId && x.UnitWorkId == node.NodeID
// && x.PipelineCode.Contains(pipecode)
// orderby x.PipelineCode
// select x).ToList();
var pipeline = (from x in Funs.DB.HJGL_Pipeline
join y in Funs.DB.HJGL_PipeLineMat.Where(m => m.MaterialCode.Contains(MaterialCode)) on x.PipelineId equals y.PipelineId
where x.ProjectId == ProjectId && x.UnitWorkId == node.NodeID && x.PipelineCode.Contains(pipecode)
select x).Distinct().ToList();
var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == ProjectId 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)
{
var jotCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId /*&& x.IsTwoJoint == null*/ select x).Count();
FineUIPro.TreeNode newNode = new FineUIPro.TreeNode();
newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】";
newNode.NodeID = item.PipelineId;
newNode.CommandName = "管线";
newNode.EnableClickEvent = true;
node.Nodes.Add(newNode);
}
if (pageindex < pageCount)
{
FineUIPro.TreeNode newNode = new FineUIPro.TreeNode();
newNode.Text = "加载";
newNode.NodeID = SQLHelper.GetNewID();
newNode.CommandName = "加载";
newNode.Icon = FineUIPro.Icon.ArrowDown;
newNode.EnableClickEvent = true;
node.Nodes.Add(newNode);
}
}
}
public static void BindTreeNodes(FineUIPro.TreeNode node,bool isExitWPQId, string pipecode, string ProjectId, int pageSize)
{
if (isExitWPQId)
{
string strSql = "SELECT distinct PipelineId, PipelineCode FROM View_HJGL_WeldJoint WHERE IsTwoJoint IS NULL AND UnitWorkId =@UnitWorkId AND WPQId IS NULL";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@UnitWorkId", node.NodeID));
if (!string .IsNullOrEmpty(pipecode))
{
strSql += " and PipelineCode=@PipelineCode ";
listStr.Add(new SqlParameter("@PipelineCode", ""+ pipecode + ""));
}
SqlParameter[] parameter = listStr.ToArray();
System.Data.DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
var pipeline = Funs.TableToEntity<Model.PipeLineIdCodeItem>(dt);
var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == ProjectId 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)
{
var jotCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId /*&& x.IsTwoJoint == null*/ select x).Count();
FineUIPro.TreeNode newNode = new FineUIPro.TreeNode();
newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】";
newNode.NodeID = item.PipelineId;
newNode.CommandName = "管线";
newNode.EnableClickEvent = true;
node.Nodes.Add(newNode);
}
if (pageindex < pageCount)
{
FineUIPro.TreeNode newNode = new FineUIPro.TreeNode();
newNode.Text = "加载";
newNode.NodeID = SQLHelper.GetNewID();
newNode.CommandName = "加载";
newNode.Icon = FineUIPro.Icon.ArrowDown;
newNode.EnableClickEvent = true;
node.Nodes.Add(newNode);
}
}
}
else
{
var pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.ProjectId == ProjectId && x.UnitWorkId == node.NodeID
&& x.PipelineCode.Contains(pipecode)
orderby x.PipelineCode
select x).ToList();
var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == ProjectId 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)
{
var jotCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId /*&& x.IsTwoJoint == null*/ select x).Count();
FineUIPro.TreeNode newNode = new FineUIPro.TreeNode();
newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】";
newNode.NodeID = item.PipelineId;
newNode.CommandName = "管线";
newNode.EnableClickEvent = true;
node.Nodes.Add(newNode);
}
if (pageindex < pageCount)
{
FineUIPro.TreeNode newNode = new FineUIPro.TreeNode();
newNode.Text = "加载";
newNode.NodeID = SQLHelper.GetNewID();
newNode.CommandName = "加载";
newNode.Icon = FineUIPro.Icon.ArrowDown;
newNode.EnableClickEvent = true;
node.Nodes.Add(newNode);
}
}
}
}
}
}