焊接管理,补充公司级树
This commit is contained in:
@@ -1,20 +1,33 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.IO;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using NPOI.SS.UserModel;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
public partial class JointInfo : PageBase
|
||||
{
|
||||
#region 定义项
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
@@ -25,6 +38,20 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
|
||||
{
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
|
||||
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();
|
||||
this.InitTreeMenu();//加载树
|
||||
//显示列
|
||||
@@ -35,6 +62,22 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 公司级树加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
|
||||
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
btnNew.Hidden = true;
|
||||
}
|
||||
//this.GetButtonPower();
|
||||
this.InitTreeMenu();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载树装置-单位-工作区
|
||||
@@ -43,6 +86,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 = "装置-单位-工作区";
|
||||
@@ -50,14 +97,14 @@ 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();
|
||||
|
||||
var workAreaIdList = (from x in BLL.Funs.DB.PW_IsoInfo
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.ISO_IsoNo.Contains(this.txtIsono.Text.Trim())
|
||||
where x.ProjectId == this.ProjectId && x.ISO_IsoNo.Contains(this.txtIsono.Text.Trim())
|
||||
orderby x.ISO_IsoNo
|
||||
select x.WorkAreaId).Distinct().ToList();
|
||||
pWorkArea = pWorkArea.Where(x => workAreaIdList.Contains(x.WorkAreaId)).OrderBy(x => x.WorkAreaCode).ToList();
|
||||
@@ -145,14 +192,14 @@ 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 && x.Is_Standard== true 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 && x.Is_Standard== true select x).Count();
|
||||
TreeNode newNode1 = new TreeNode();
|
||||
newNode1.Text = q.WorkAreaCode + "【" + a.ToString() + "非标管线】";
|
||||
newNode1.NodeID = q.WorkAreaId+ "_NoStandard";
|
||||
newNode1.EnableExpandEvent = true;
|
||||
newNode1.ToolTip = "区域非标管线";
|
||||
node.Nodes.Add(newNode1);
|
||||
int b = (from x in BLL.Funs.DB.PW_IsoInfo where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitId == node.NodeID.Split('|')[0] && x.WorkAreaId == q.WorkAreaId && x.Is_Standard != true select x).Count();
|
||||
int b = (from x in BLL.Funs.DB.PW_IsoInfo where x.ProjectId == this.ProjectId && x.UnitId == node.NodeID.Split('|')[0] && x.WorkAreaId == q.WorkAreaId && x.Is_Standard != true select x).Count();
|
||||
TreeNode newNode2 = new TreeNode();
|
||||
newNode2.Text = q.WorkAreaCode + "【" + b.ToString() + "标准管线】";
|
||||
newNode2.NodeID = q.WorkAreaId+ "_Standard";
|
||||
@@ -193,7 +240,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
e.Node.Nodes.Clear();
|
||||
List<Model.PW_IsoInfo> isoInfo = new List<Model.PW_IsoInfo>();
|
||||
isoInfo = (from x in BLL.Funs.DB.PW_IsoInfo
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.WorkAreaId == e.Node.NodeID.Split('_')[0] && x.Is_Standard==true
|
||||
where x.ProjectId == this.ProjectId && x.WorkAreaId == e.Node.NodeID.Split('_')[0] && x.Is_Standard==true
|
||||
&& x.ISO_IsoNo.Contains(this.txtIsono.Text.Trim())
|
||||
orderby x.ISO_IsoNo
|
||||
select x).ToList();
|
||||
@@ -221,7 +268,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
e.Node.Nodes.Clear();
|
||||
List<Model.PW_IsoInfo> isoInfo = new List<Model.PW_IsoInfo>();
|
||||
isoInfo = (from x in BLL.Funs.DB.PW_IsoInfo
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.WorkAreaId == e.Node.NodeID.Split('_')[0] && x.Is_Standard == false
|
||||
where x.ProjectId == this.ProjectId && x.WorkAreaId == e.Node.NodeID.Split('_')[0] && x.Is_Standard == false
|
||||
&& x.ISO_IsoNo.Contains(this.txtIsono.Text.Trim())
|
||||
orderby x.ISO_IsoNo
|
||||
select x).ToList();
|
||||
@@ -350,7 +397,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
+ @" WHERE jointInfo.ProjectId= @projectId AND jointInfo.ISO_ID=@isoId";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@projectId", this.CurrUser.LoginProjectId),
|
||||
new SqlParameter("@projectId", this.ProjectId),
|
||||
new SqlParameter("@isoId", this.tvControlItem.SelectedNodeID),
|
||||
};
|
||||
if (!string.IsNullOrEmpty(this.txtJOT_JointNo.Text.Trim()))
|
||||
@@ -561,11 +608,11 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
else if (judgementDelete(rowID, isShow))
|
||||
{
|
||||
BLL.PW_JointInfoService.DeleteJointInfo(rowID);
|
||||
//BLL.Sys_LogService.AddLog(BLL.Const.System_7, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除焊口信息");
|
||||
//BLL.Sys_LogService.AddLog(BLL.Const.System_7, this.ProjectId, this.CurrUser.UserId, "删除焊口信息");
|
||||
}
|
||||
|
||||
}
|
||||
Project_HJGLData_HJGLService.StatisticalData(this.CurrUser.LoginProjectId, Project_HJGLData_HJGLService.HJGLDateType.ArrivalFactor);
|
||||
Project_HJGLData_HJGLService.StatisticalData(this.ProjectId, Project_HJGLData_HJGLService.HJGLDateType.ArrivalFactor);
|
||||
//ShowNotify("删除成功!", MessageBoxIcon.Success);
|
||||
this.BindGrid();
|
||||
}
|
||||
@@ -597,7 +644,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
var install = BLL.Project_InstallationService.GetInstallationByInstallationId(workArea.InstallationId);
|
||||
keyValuePairs.Add("InstallationName", install.InstallationName);
|
||||
keyValuePairs.Add("WorkAreaName", workArea.WorkAreaName);
|
||||
keyValuePairs.Add("ProjectName", ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId));
|
||||
keyValuePairs.Add("ProjectName", ProjectService.GetProjectNameByProjectId(this.ProjectId));
|
||||
BLL.Common.FastReportService.ResetData();
|
||||
BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs);
|
||||
|
||||
@@ -668,7 +715,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@projectId", this.CurrUser.LoginProjectId),
|
||||
new SqlParameter("@projectId", this.ProjectId),
|
||||
new SqlParameter("@isoId", this.tvControlItem.SelectedNodeID),
|
||||
};
|
||||
|
||||
@@ -825,7 +872,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
// + @" WHERE jointInfo.ProjectId= @projectId AND jointInfo.ISO_ID=@isoId order by JOT_JointNo ";
|
||||
// List<SqlParameter> listStr = new List<SqlParameter>
|
||||
//{
|
||||
// new SqlParameter("@projectId", this.CurrUser.LoginProjectId),
|
||||
// new SqlParameter("@projectId", this.ProjectId),
|
||||
// new SqlParameter("@isoId", this.tvControlItem.SelectedNodeID),
|
||||
//};
|
||||
|
||||
@@ -889,7 +936,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
// {
|
||||
// hssfworkbook.Write(filess);
|
||||
// }
|
||||
// //PageContext.RegisterStartupScript(Window5.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReportId, isoId, varValue, this.CurrUser.LoginProjectId)));
|
||||
// //PageContext.RegisterStartupScript(Window5.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReportId, isoId, varValue, this.ProjectId)));
|
||||
|
||||
// FileInfo filet = new FileInfo(ReportFileName);
|
||||
// Response.Clear();
|
||||
@@ -996,7 +1043,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
+ @" WHERE jointInfo.ProjectId= @projectId AND jointInfo.ISO_ID=@isoId ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@projectId", this.CurrUser.LoginProjectId),
|
||||
new SqlParameter("@projectId", this.ProjectId),
|
||||
new SqlParameter("@isoId", this.tvControlItem.SelectedNodeID),
|
||||
};
|
||||
if (!string.IsNullOrEmpty(this.txtJOT_JointNo.Text.Trim()))
|
||||
@@ -1085,7 +1132,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
//{
|
||||
// hssfworkbook.Write(filess);
|
||||
//}
|
||||
////PageContext.RegisterStartupScript(Window5.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReportId, isoId, varValue, this.CurrUser.LoginProjectId)));
|
||||
////PageContext.RegisterStartupScript(Window5.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReportId, isoId, varValue, this.ProjectId)));
|
||||
|
||||
//FileInfo filet = new FileInfo(ReportFileName);
|
||||
//Response.Clear();
|
||||
@@ -1136,7 +1183,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
|
||||
List<SqlParameter> listStr1 = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@projectId", this.CurrUser.LoginProjectId),
|
||||
new SqlParameter("@projectId", this.ProjectId),
|
||||
new SqlParameter("@isoId", this.tvControlItem.SelectedNodeID),
|
||||
};
|
||||
if (!string.IsNullOrEmpty(this.txtJOT_JointNo.Text.Trim()))
|
||||
@@ -1399,7 +1446,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_JointInfoMenuId, button);
|
||||
return BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_JointInfoMenuId, button);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user