焊接管理,补充公司级树

This commit is contained in:
2025-04-14 09:53:19 +08:00
parent f5344bddfb
commit c8b553efc6
16 changed files with 832 additions and 383 deletions
@@ -10,7 +10,22 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
public partial class PipelineManage : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
public string treeNodeId
{
get
@@ -34,6 +49,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
#endregion
#region
/// <summary>
/// 加载页面
@@ -44,10 +60,24 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
if (!IsPostBack)
{
//Funs.DropDownPageSize(this.ddlPageSize);
this.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
{
this.ProjectId = Request.Params["projectId"];
}
this.InitDropDownList();
this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.ProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
//this.GetButtonPower();
}
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
BLL.Base_TestMediumService.InitMediumDropDownList(this.drpSer, true);//介质
BLL.Base_DetectionTypeService.InitDetectionTypeDropDownList(this.drpNDT, true);//探伤类型
BLL.Base_MaterialService.InitMaterialDropDownList(this.drpSteId, true,this.CurrUser.LoginProjectId);//材质
ListItem[] lis = new ListItem[3];
lis[0] = new ListItem("- 请选择 -", "");
lis[1] = new ListItem("是","1");
@@ -66,6 +96,28 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
}
private void InitDropDownList()
{
BLL.Base_MaterialService.InitMaterialDropDownList(this.drpSteId, true, this.CurrUser.LoginProjectId);//材质
}
/// <summary>
/// 公司级树加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void changeTree(object sender, EventArgs e)
{
this.ProjectId = this.ucTree.ProjectId;
this.InitDropDownList();
if (string.IsNullOrEmpty(this.ProjectId))
{
btnNew.Hidden = true;
}
//this.GetButtonPower();
this.InitTreeMenu();
}
#endregion
#region --
@@ -74,6 +126,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </summary>
private void InitTreeMenu()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
this.tvControlItem.Nodes.Clear();
TreeNode rootNode = new TreeNode();
rootNode.Text = "装置-单位-工作区";
@@ -81,11 +137,11 @@ namespace FineUIPro.Web.HJGL.WeldingManage
rootNode.Expanded = true;
this.tvControlItem.Nodes.Add(rootNode);
////装置
var pInstallation = (from x in Funs.DB.Project_Installation where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
var pInstallation = (from x in Funs.DB.Project_Installation where x.ProjectId == this.ProjectId select x).ToList();
////区域
var pWorkArea = (from x in Funs.DB.ProjectData_WorkArea where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
var pWorkArea = (from x in Funs.DB.ProjectData_WorkArea where x.ProjectId == this.ProjectId select x).ToList();
////单位
var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.ProjectId select x).ToList();
if (!string.IsNullOrEmpty(this.txtWorkArea.Text))
{
@@ -175,7 +231,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
workAreas = workAreas.OrderByDescending(x => x.WorkAreaCode);
foreach (var q in workAreas)
{
int a = (from x in BLL.Funs.DB.PW_IsoInfo where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitId == node.NodeID.Split('|')[0] && x.WorkAreaId == q.WorkAreaId select x).Count();
int a = (from x in BLL.Funs.DB.PW_IsoInfo where x.ProjectId == this.ProjectId && x.UnitId == node.NodeID.Split('|')[0] && x.WorkAreaId == q.WorkAreaId select x).Count();
TreeNode newNode = new TreeNode();
newNode.Text = q.WorkAreaCode + "【" + a.ToString() + "】管线";
newNode.NodeID = q.WorkAreaId;
@@ -208,6 +264,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </summary>
private void BindGrid(string treeNodeId="")
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
string strSql = @"SELECT iso.ISO_ID,
iso.ProjectId,
iso.ISO_IsoNo,
@@ -260,7 +320,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
+ @" LEFT JOIN Base_PipingClass AS pipingClass ON pipingClass.PipingClassId = iso.PipingClassId"
+ @" WHERE iso.ProjectId=@ProjectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (!string.IsNullOrEmpty(treeNodeId))
{
@@ -512,7 +572,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
}
Project_HJGLData_HJGLService.StatisticalData(this.CurrUser.LoginProjectId, Project_HJGLData_HJGLService.HJGLDateType.ArrivalFactor);
Project_HJGLData_HJGLService.StatisticalData(this.ProjectId, Project_HJGLData_HJGLService.HJGLDateType.ArrivalFactor);
if (!string.IsNullOrEmpty(isoRes))
{
@@ -774,7 +834,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// <returns></returns>
private bool GetButtonPower(string button)
{
return BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_PipelineManageMenuId, button);
return BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_PipelineManageMenuId, button);
}
#endregion
}