焊接管理,补充公司级树
This commit is contained in:
@@ -1,19 +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;
|
||||
|
||||
namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
{
|
||||
public partial class TestPackageImport : PageBase
|
||||
{/// <summary>
|
||||
/// 未通过数
|
||||
/// </summary>
|
||||
{
|
||||
#region 定义项
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 未通过数
|
||||
/// </summary>
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
@@ -36,6 +50,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
ViewState["PTP_ID"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
@@ -46,12 +61,41 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
{
|
||||
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.CurrUser.LoginProjectId))
|
||||
{
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
}
|
||||
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
|
||||
|
||||
this.InitTreeMenu();//加载树
|
||||
this.GetButtonPower();
|
||||
}
|
||||
}
|
||||
/// <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.ProjectId))
|
||||
//{
|
||||
// btnNew.Hidden = true;
|
||||
//}
|
||||
this.GetButtonPower();
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -63,7 +107,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
/// <param name="e"></param>
|
||||
protected void btnImport_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_TestPackageImportMenuId, BLL.Const.BtnSave))
|
||||
if (BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_TestPackageImportMenuId, BLL.Const.BtnSave))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TestPackageDataIn.aspx", "导入 - ")));
|
||||
}
|
||||
@@ -80,6 +124,10 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
/// </summary>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.tvControlItem.Nodes.Clear();
|
||||
TreeNode rootNode = new TreeNode();
|
||||
rootNode.Text = "单位-区域";
|
||||
@@ -91,23 +139,23 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
var unit = BLL.ProjectUnitService.GetProjectUnitById(this.CurrUser.UnitId);
|
||||
if (unit == null || unit.UnitType == BLL.Const.ProjectUnitType_1 || unit.UnitType == BLL.Const.ProjectUnitType_3)
|
||||
{
|
||||
if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.CurrUser.LoginProjectId))
|
||||
if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.ProjectId))
|
||||
{
|
||||
units = (from x in Funs.DB.Base_Unit
|
||||
join y in Funs.DB.ProjectData_WorkArea on x.UnitId equals y.UnitId
|
||||
where (x.UnitId == this.CurrUser.UnitId || y.SupervisorUnitId == this.CurrUser.UnitId) && y.ProjectId == this.CurrUser.LoginProjectId
|
||||
where (x.UnitId == this.CurrUser.UnitId || y.SupervisorUnitId == this.CurrUser.UnitId) && y.ProjectId == this.ProjectId
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, "2");
|
||||
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.ProjectId, "2");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
units = (from x in Funs.DB.Base_Unit where x.UnitId == this.CurrUser.UnitId select x).ToList();
|
||||
}
|
||||
List<Model.TP_TestPackageImport> testPackageLists = Funs.DB.TP_TestPackageImport.Where(x => x.ProjectId == this.CurrUser.LoginProjectId).ToList(); ///试压包
|
||||
List<Model.TP_TestPackageImport> testPackageLists = Funs.DB.TP_TestPackageImport.Where(x => x.ProjectId == this.ProjectId).ToList(); ///试压包
|
||||
|
||||
if (units != null)
|
||||
{
|
||||
@@ -577,11 +625,11 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
/// <returns></returns>
|
||||
private bool GetButtonPower(string button)
|
||||
{
|
||||
return BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_TestPackageImportMenuId, button);
|
||||
return BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_TestPackageImportMenuId, button);
|
||||
}
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_TestPackageImportMenuId);
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_TestPackageImportMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
@@ -696,7 +744,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
// 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.AddFastreportParameter(keyValuePairs);
|
||||
|
||||
// string strSql = @"SELECT '' WED_Code, '' WED_Name,'' JOT_WeldDate_Month,''JOT_WeldDate_Day,jointInfo.JOT_ID,
|
||||
@@ -760,7 +808,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
// + @" WHERE jointInfo.ProjectId= @projectId ";
|
||||
// List<SqlParameter> listStr = new List<SqlParameter>
|
||||
//{
|
||||
// new SqlParameter("@projectId", this.CurrUser.LoginProjectId),
|
||||
// new SqlParameter("@projectId", this.ProjectId),
|
||||
|
||||
//};
|
||||
// strSql += "AND jointInfo.ISO_ID in ('" + isoIds + "') order by jointInfo.ISO_ID ,JOT_JointNo ";
|
||||
@@ -852,7 +900,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
|
||||
// }
|
||||
|
||||
// var Unit1 = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_3);
|
||||
// var Unit1 = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.ProjectId, BLL.Const.ProjectUnitType_3);
|
||||
// if (Unit1 != null)
|
||||
// {
|
||||
// var unitNames1 = string.Join(",", Unit1.Select(x => x.UnitName).ToArray());
|
||||
@@ -1113,7 +1161,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
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.AddFastreportParameter(keyValuePairs);
|
||||
|
||||
string strSql = @"SELECT '' WED_Code, '' WED_Name,'' JOT_WeldDate_Month,''JOT_WeldDate_Day,jointInfo.JOT_ID,
|
||||
@@ -1177,7 +1225,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
+ @" WHERE jointInfo.ProjectId= @projectId ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@projectId", this.CurrUser.LoginProjectId),
|
||||
new SqlParameter("@projectId", this.ProjectId),
|
||||
|
||||
};
|
||||
strSql += "AND jointInfo.ISO_ID in ('" + isoIds + "') order by jointInfo.ISO_ID ,JOT_JointNo ";
|
||||
@@ -1270,7 +1318,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
|
||||
}
|
||||
|
||||
var Unit1 = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_3);
|
||||
var Unit1 = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.ProjectId, BLL.Const.ProjectUnitType_3);
|
||||
if (Unit1 != null)
|
||||
{
|
||||
var unitNames1 = string.Join(",", Unit1.Select(x => x.UnitName).ToArray());
|
||||
|
||||
Reference in New Issue
Block a user