焊接管理,补充公司级树

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,17 +1,10 @@
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.TrustManage
{
@@ -19,6 +12,20 @@ namespace FineUIPro.Web.HJGL.TrustManage
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
/// <summary>
/// 委托主键
/// </summary>
public string CH_TrustID
@@ -52,6 +59,20 @@ namespace FineUIPro.Web.HJGL.TrustManage
{
if (!IsPostBack&&string.IsNullOrEmpty(CH_TrustID))
{
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.txtMonth.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
this.InitTreeMenu();//加载树
@@ -60,25 +81,47 @@ namespace FineUIPro.Web.HJGL.TrustManage
}
}
/// <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();
}
#region -
/// <summary>
/// 加载树
/// </summary>
private void InitTreeMenu()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
if (!string.IsNullOrEmpty(this.txtMonth.Text.Trim()))
{
this.tvControlItem.Nodes.Clear();
List<Model.Base_Unit> units = null;
var getUnit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId);
var getUnit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.ProjectId, this.CurrUser.UnitId);
if (getUnit != null && getUnit.UnitType == BLL.Const.ProjectUnitType_2)
{
units = (from x in Funs.DB.Base_Unit where x.UnitId == this.CurrUser.UnitId select x).ToList();
}
else
{
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2);
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.ProjectId, BLL.Const.ProjectUnitType_2);
}
if (units != null)
@@ -94,7 +137,7 @@ namespace FineUIPro.Web.HJGL.TrustManage
var instaRe = (from x in Funs.DB.CH_Trust
join y in Funs.DB.Project_Installation
on x.InstallationId equals y.InstallationId
where x.CH_TrustUnit == unit.UnitId && x.ProjectId == this.CurrUser.LoginProjectId && x.CH_TrustType == "1"
where x.CH_TrustUnit == unit.UnitId && x.ProjectId == this.ProjectId && x.CH_TrustType == "1"
select y).Distinct();
foreach (var ins in instaRe)
{
@@ -217,7 +260,7 @@ namespace FineUIPro.Web.HJGL.TrustManage
CH_TrustID = this.tvControlItem.SelectedNodeID;
this.drpCH_AuditMan.DataTextField = "UserName";
this.drpCH_AuditMan.DataValueField = "UserId";
this.drpCH_AuditMan.DataSource = BLL.UserService.GetProjectUserListByProjectId(this.CurrUser.LoginProjectId);
this.drpCH_AuditMan.DataSource = BLL.UserService.GetProjectUserListByProjectId(this.ProjectId);
this.drpCH_AuditMan.DataBind();
Funs.FineUIPleaseSelect(this.drpCH_AuditMan);
Model.CH_Trust trust = BLL.TrustManageEditService.GetCH_TrustByID(CH_TrustID);
@@ -425,7 +468,7 @@ namespace FineUIPro.Web.HJGL.TrustManage
/// <param name="e"></param>
protected void btnAudit_Click(object sender, EventArgs e)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.TrustManageAuditMenuId, BLL.Const.BtnAuditing))
if (BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.TrustManageAuditMenuId, BLL.Const.BtnAuditing))
{
var updatetrust = BLL.TrustManageEditService.GetCH_TrustByID(CH_TrustID);
if (updatetrust != null && !String.IsNullOrEmpty(this.CH_TrustID))
@@ -470,7 +513,7 @@ namespace FineUIPro.Web.HJGL.TrustManage
/// <param name="e"></param>
protected void btnCancelAudit_Click(object sender, EventArgs e)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.TrustManageAuditMenuId, BLL.Const.BtnCancelAuditing))
if (BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.TrustManageAuditMenuId, BLL.Const.BtnCancelAuditing))
{
var updatetrust = BLL.TrustManageEditService.GetCH_TrustByID(CH_TrustID);
if (updatetrust != null && !String.IsNullOrEmpty(this.CH_TrustID))
@@ -564,7 +607,7 @@ namespace FineUIPro.Web.HJGL.TrustManage
// if (q != null)
// {
// 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);
@@ -575,24 +618,24 @@ namespace FineUIPro.Web.HJGL.TrustManage
// varValue = Microsoft.JScript.GlobalObject.escape(varValue.Replace("/", ","));
// }
// if (BLL.Project_SysSetService.IsAuto("3", this.CurrUser.LoginProjectId) == true) //3表示无损委托
// if (BLL.Project_SysSetService.IsAuto("3", this.ProjectId) == true) //3表示无损委托
// {
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReportId, reportId, varValue, this.CurrUser.LoginProjectId)));
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReportId, reportId, varValue, this.ProjectId)));
// }
// else if (BLL.Project_SysSetService.IsAuto("3", this.CurrUser.LoginProjectId) == false)
// else if (BLL.Project_SysSetService.IsAuto("3", this.ProjectId) == false)
// {
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReport2Id, reportId, varValue, this.CurrUser.LoginProjectId)));
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReport2Id, reportId, varValue, this.ProjectId)));
// }
// else if (BLL.Project_SysSetService.IsAuto("3", this.CurrUser.LoginProjectId) == null)
// else if (BLL.Project_SysSetService.IsAuto("3", this.ProjectId) == null)
// {
// var p = BLL.Project_SysSetService.GetSysSetBySetId("3", this.CurrUser.LoginProjectId);
// var p = BLL.Project_SysSetService.GetSysSetBySetId("3", this.ProjectId);
// if (p.SetValue == "3")
// {
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReport3Id, reportId, varValue, this.CurrUser.LoginProjectId)));
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReport3Id, reportId, varValue, this.ProjectId)));
// }
// else // 4表示为神化委托单
// {
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReport4Id, reportId, varValue, this.CurrUser.LoginProjectId)));
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.TrustReport4Id, reportId, varValue, this.ProjectId)));
// }
// }
@@ -643,7 +686,7 @@ namespace FineUIPro.Web.HJGL.TrustManage
if (trust != null)
{
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(trust.InstallationId);
dr["ProjectName"] = projectName;
@@ -776,7 +819,7 @@ namespace FineUIPro.Web.HJGL.TrustManage
// Session["CH_TrustID"] = reportId;
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
var sysSet = Funs.DB.Project_Sys_Set.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.SetId == "3").FirstOrDefault();
var sysSet = Funs.DB.Project_Sys_Set.Where(x => x.ProjectId == this.ProjectId && x.SetId == "3").FirstOrDefault();
if (sysSet != null && sysSet.IsAuto.HasValue && sysSet.IsAuto.Value)
{
initTemplatePath = "File\\Fastreport\\管道焊口检测委托单NoPic.frx";
@@ -794,7 +837,7 @@ namespace FineUIPro.Web.HJGL.TrustManage
//if (trust != null)
//{
// 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(trust.InstallationId);
@@ -1024,7 +1067,7 @@ namespace FineUIPro.Web.HJGL.TrustManage
// {
// 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();
@@ -1081,7 +1124,7 @@ namespace FineUIPro.Web.HJGL.TrustManage
if (trust != null)
{
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(trust.InstallationId);
dr["ProjectName"] = projectName;
@@ -1214,7 +1257,7 @@ namespace FineUIPro.Web.HJGL.TrustManage
// Session["CH_TrustID"] = reportId;
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
var sysSet = Funs.DB.Project_Sys_Set.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.SetId == "3").FirstOrDefault();
var sysSet = Funs.DB.Project_Sys_Set.Where(x => x.ProjectId == this.ProjectId && x.SetId == "3").FirstOrDefault();
if (sysSet != null && sysSet.IsAuto.HasValue && sysSet.IsAuto.Value)
{
initTemplatePath = "File\\Fastreport\\设备焊口检测委托单NoPic.frx";
@@ -1232,7 +1275,7 @@ namespace FineUIPro.Web.HJGL.TrustManage
//if (trust != null)
//{
// 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(trust.InstallationId);
@@ -1462,7 +1505,7 @@ namespace FineUIPro.Web.HJGL.TrustManage
// {
// 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();
@@ -1495,7 +1538,7 @@ namespace FineUIPro.Web.HJGL.TrustManage
// if (trust != null)
// {
// 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(trust.InstallationId);
@@ -1725,7 +1768,7 @@ namespace FineUIPro.Web.HJGL.TrustManage
// {
// 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();