焊接管理,补充公司级树

This commit is contained in:
2025-04-14 15:31:57 +08:00
parent c8b553efc6
commit bb10b1f54e
111 changed files with 6980 additions and 4039 deletions
@@ -1,23 +1,32 @@
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;
using NPOI.SS.Util;
using NPOI.HSSF.UserModel;
namespace FineUIPro.Web.HJGL.CheckManage
{
public partial class CheckManageAudit : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
/// <summary>
/// 检测主键
/// </summary>
public string CHT_CheckID
@@ -78,9 +87,21 @@ namespace FineUIPro.Web.HJGL.CheckManage
{
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.ProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
//this.GetButtonPower();
}
this.txtCheckTime.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
BLL.UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpCheckUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_5, true);//查询检测单位
BLL.UserService.InitUserDropDownList(this.ddlAuditMan, this.CurrUser.LoginProjectId, true);//审核人
this.InitTreeMenu();//加载树
@@ -92,6 +113,30 @@ namespace FineUIPro.Web.HJGL.CheckManage
//Funs.FineUIPleaseSelect(this.drpPrintType);
}
}
private void InitDropDownList()
{
BLL.UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpCheckUnit, this.ProjectId, BLL.Const.ProjectUnitType_5, true);//查询检测单位
BLL.UserService.InitUserDropDownList(this.ddlAuditMan, 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 --
@@ -100,6 +145,7 @@ namespace FineUIPro.Web.HJGL.CheckManage
/// </summary>
private void InitTreeMenu()
{
this.InitDropDownList();
if (!string.IsNullOrEmpty(this.txtCheckTime.Text.Trim()))
{
DateTime? startTime = Funs.GetNewDateTime(this.txtCheckTime.Text.Trim());
@@ -113,19 +159,19 @@ namespace FineUIPro.Web.HJGL.CheckManage
this.tvControlItem.Nodes.Add(rootNode);
List<Model.Base_Unit> units = null;
var unit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId);
var unit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.ProjectId, this.CurrUser.UnitId);
if (unit == null || unit.UnitType == BLL.Const.ProjectUnitType_1 || unit.UnitType == BLL.Const.ProjectUnitType_5 || 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
@@ -136,19 +182,19 @@ namespace FineUIPro.Web.HJGL.CheckManage
if (!this.txtCheckTime.Hidden)
{
checkLists = (from x in Funs.DB.CH_Check
where x.ProjectId == this.CurrUser.LoginProjectId && x.CHT_CheckDate >= startTime && x.CHT_CheckDate < endTime
where x.ProjectId == this.ProjectId && x.CHT_CheckDate >= startTime && x.CHT_CheckDate < endTime
select x).ToList();
}
else
{
checkLists = (from x in Funs.DB.CH_Check
where x.ProjectId == this.CurrUser.LoginProjectId && x.CHT_CheckCode.Contains(this.txtSearchCode.Text.Trim())
where x.ProjectId == this.ProjectId && x.CHT_CheckCode.Contains(this.txtSearchCode.Text.Trim())
select x).ToList();
}
if (this.drpCheckUnit.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpCheckUnit.SelectedValue))
{
checkLists = (from x in Funs.DB.CH_Check
where x.ProjectId == this.CurrUser.LoginProjectId && x.ContractualUnits == this.drpCheckUnit.SelectedValue
where x.ProjectId == this.ProjectId && x.ContractualUnits == this.drpCheckUnit.SelectedValue
select x).ToList();
}
if (units != null)
@@ -577,7 +623,7 @@ namespace FineUIPro.Web.HJGL.CheckManage
/// <returns></returns>
private bool GetButtonPower(string button)
{
return BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_CheckManageAuditMenuId, button);
return BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_CheckManageAuditMenuId, button);
}
#endregion
@@ -599,7 +645,7 @@ namespace FineUIPro.Web.HJGL.CheckManage
{
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 installationName = BLL.Project_InstallationService.GetInstallationByInstallationId(q.InstallationId).InstallationName;
var unitName = BLL.UnitService.GetUnitNameByUnitId(q.UnitId);
@@ -653,7 +699,7 @@ namespace FineUIPro.Web.HJGL.CheckManage
////{
//// varValue = Microsoft.JScript.GlobalObject.escape(varValue.Replace("/", ","));
////}
////PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.CheckReportId, reportId, varValue, this.CurrUser.LoginProjectId)));
////PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.CheckReportId, reportId, varValue, this.ProjectId)));
//string rootPath = Server.MapPath("~/") + Const.ExcelUrl;
@@ -761,7 +807,7 @@ namespace FineUIPro.Web.HJGL.CheckManage
//{
// 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();
@@ -785,7 +831,7 @@ namespace FineUIPro.Web.HJGL.CheckManage
{
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 installationName = BLL.Project_InstallationService.GetInstallationByInstallationId(q.InstallationId).InstallationName;
var unitName = BLL.UnitService.GetUnitNameByUnitId(q.UnitId);
@@ -795,7 +841,7 @@ namespace FineUIPro.Web.HJGL.CheckManage
//{
// varValue = Microsoft.JScript.GlobalObject.escape(varValue.Replace("/", ","));
//}
//PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.CheckReportId, reportId, varValue, this.CurrUser.LoginProjectId)));
//PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.CheckReportId, reportId, varValue, this.ProjectId)));
string rootPath = Server.MapPath("~/") + Const.ExcelUrl;
@@ -913,7 +959,7 @@ namespace FineUIPro.Web.HJGL.CheckManage
{
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();
@@ -936,7 +982,7 @@ namespace FineUIPro.Web.HJGL.CheckManage
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 installationName = BLL.Project_InstallationService.GetInstallationByInstallationId(q.InstallationId).InstallationName;
var unitName = BLL.UnitService.GetUnitNameByUnitId(q.UnitId);
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
@@ -988,10 +1034,10 @@ namespace FineUIPro.Web.HJGL.CheckManage
{
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(q.InstallationId);
var unitName = BLL.UnitService.GetUnitNameByUnitId(q.UnitId);
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 : "");