焊接管理,补充公司级树
This commit is contained in:
@@ -5,9 +5,6 @@ using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
@@ -16,6 +13,20 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
{
|
||||
#region 定义项
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 试压包主键
|
||||
/// </summary>
|
||||
public string PTP_ID
|
||||
@@ -68,13 +79,48 @@ 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.InitDropDownList();
|
||||
this.ucTree.UnitId = this.CurrUser.UnitId;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
////权限按钮方法
|
||||
//this.GetButtonPower();
|
||||
}
|
||||
this.txtReportDate.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
|
||||
|
||||
BLL.UserService.InitUserDropDownList(this.drpPTP_Auditer, this.CurrUser.LoginProjectId, true);//审核人
|
||||
|
||||
this.InitTreeMenu();
|
||||
}
|
||||
}
|
||||
private void InitDropDownList()
|
||||
{
|
||||
BLL.UserService.InitUserDropDownList(this.drpPTP_Auditer, this.ProjectId, true);//审核人
|
||||
}
|
||||
|
||||
/// <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.CurrUser.LoginProjectId))
|
||||
//{
|
||||
// btnNew.Hidden = true;
|
||||
//}
|
||||
//this.GetButtonPower();
|
||||
this.InitTreeMenu();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 加载树装置-单位-工作区
|
||||
@@ -83,6 +129,10 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
/// </summary>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtReportDate.Text.Trim()))
|
||||
{
|
||||
DateTime? startTime = Funs.GetNewDateTime(this.txtReportDate.Text.Trim());
|
||||
@@ -100,16 +150,16 @@ 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
|
||||
@@ -120,7 +170,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
if (!this.txtReportDate.Hidden)
|
||||
{
|
||||
testPackageLists = (from x in Funs.DB.TP_TestPackage
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.PTP_TableDate >= startTime && x.PTP_TableDate < endTime
|
||||
where x.ProjectId == this.ProjectId && x.PTP_TableDate >= startTime && x.PTP_TableDate < endTime
|
||||
select x).ToList();
|
||||
}
|
||||
if (units != null)
|
||||
@@ -514,7 +564,7 @@ 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_TestPackageManageAuditMenuId, button);
|
||||
return BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_TestPackageManageAuditMenuId, button);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -605,7 +655,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 ";
|
||||
@@ -695,7 +745,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
group by weldType.WeldTypeName,detectionType.DetectionTypeCode,checkItem.CHT_CheckResult";
|
||||
DataTable dt0 = SQLHelper.GetDataTableRunText(sqlStr, null);
|
||||
|
||||
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());
|
||||
@@ -1312,10 +1362,10 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
var workarea = WorkAreaService.getWorkAreaByWorkAreaId(iosList[0].WorkAreaId);
|
||||
//var q = BLL.CheckManageService.GetCheckByCHT_CheckID(this.CHT_CheckID);
|
||||
string varValue = string.Empty;
|
||||
var projectName = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
|
||||
var projectName = BLL.ProjectService.GetProjectNameByProjectId(this.ProjectId);
|
||||
var installation = BLL.Project_InstallationService.GetInstallationByInstallationId(workarea.InstallationId);
|
||||
|
||||
//var workarea = WorkAreaService.GetWorkAreaByProjectIdAndInstalltionIdAndUnitId(this.CurrUser.LoginProjectId, q.InstallationId, q.UnitId);
|
||||
//var workarea = WorkAreaService.GetWorkAreaByProjectIdAndInstalltionIdAndUnitId(this.ProjectId, q.InstallationId, q.UnitId);
|
||||
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
|
||||
keyValuePairs.Add("projectName", projectName);
|
||||
keyValuePairs.Add("install", installation != null ? installation.InstallationName : "");
|
||||
|
||||
Reference in New Issue
Block a user