This commit is contained in:
jackchenyang
2024-05-26 08:28:18 +08:00
parent c873aecca8
commit 914f20c238
12 changed files with 548 additions and 32 deletions
@@ -1,4 +1,6 @@
using BLL;
using Model;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
@@ -15,6 +17,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
string ProjectId = string.Empty;
string PMIId = string.Empty;
string weldJointIds=string.Empty;
string installId=string.Empty;
#region
/// <summary>
/// 加载页面
@@ -27,6 +30,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
this.ProjectId = this.CurrUser.LoginProjectId;
this.PMIId = Request.Params["PMIId"] ?? "";
this.weldJointIds = Request.Params["weldJointIds"] ?? "";
this.installId = Request.Params["installId"];
if (!IsPostBack)
{
this.InitTreeMenu();//加载树
@@ -54,13 +58,23 @@ namespace FineUIPro.Web.WeldingProcess.PMI
b in Funs.DB.PMI_DelegationDetails.AsQueryable() on
a.Id equals b.PMIId
select b.JointId
).Distinct().ToList();
).Distinct().ToList();
//查询带有PMI处理的管线数据
var iso = from x in Funs.DB.View_Pipeline_WeldJoint
where x.ProjectId == this.ProjectId && x.IsPMI == true && x.UnitId == this.UnitId
select new { x.PipelineCode, x.PipelineId,x.WeldJointId }; //from x in Funs.DB.Pipeline_Pipeline where x.ProjectId == this.ProjectId && x.UnitId == this.UnitId select x;
var iso = (from a in Funs.DB.Pipeline_Pipeline join b
in Funs.DB.Project_WorkArea on a.WorkAreaId equals b.WorkAreaId
join c in Funs.DB.Pipeline_WeldJoint on a.PipelineId equals c.PipelineId
where a.ProjectId==this.ProjectId && a.UnitId==this.UnitId &&
a.InstallationId==this.installId && c.IsPMI==true
select new {
a.PipelineCode,
a.PipelineId,
b.WorkAreaId,
b.WorkAreaCode,
c.WeldJointId,
c.WeldJointCode
});
if (listData.Count > 0)
{
iso = iso.Where(e => !listData.Contains(e.WeldJointId));
@@ -69,14 +83,14 @@ namespace FineUIPro.Web.WeldingProcess.PMI
{
iso = iso.Where(e => e.PipelineCode.Contains(this.txtIsono.Text.Trim()));
}
var isoList = iso.Select(x => new {x.PipelineId,x.PipelineCode }).OrderBy(x => x.PipelineCode).Distinct().ToList();
var isoList = iso.Select(x => new { x.PipelineId,x.PipelineCode,x.WorkAreaCode}).OrderBy(x => x.PipelineCode).Distinct().ToList();
if (isoList.Count > 0)
{
foreach (var q in isoList)
{
TreeNode newNode = new TreeNode();
newNode.NodeID = q.PipelineId;
newNode.Text = q.PipelineCode;
newNode.Text = q.PipelineCode + "(" + q.WorkAreaCode + ")";
newNode.EnableClickEvent = true;
rootNode.Nodes.Add(newNode);
}
@@ -128,7 +142,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
).Distinct().ToList();
string[] arr = this.weldJointIds.Split('|');
var query = Funs.DB.View_Pipeline_WeldJoint.Where(t => t.IsPMI == true);
var query = Funs.DB.View_Pipeline_WeldJoint.Where(t => t.IsPMI == true && t.PipelineId == this.tvControlItem.SelectedNodeID);
if (arr.Length > 0)
{
listData.Add(arr[0]);
@@ -141,10 +155,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
{
query = query.Where(t => t.WeldJointCode == this.txtJointNo.Text);
}
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
query = query.Where(t => t.PipelineId == this.tvControlItem.SelectedNodeID);
}
var data= query.ToList() ;
if (!string.IsNullOrEmpty(weldJointIds))
{