焊接管理,补充公司级树

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.RepairManage
@@ -20,6 +13,20 @@ namespace FineUIPro.Web.HJGL.RepairManage
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
/// <summary>
/// 委托主键
/// </summary>
public string CH_TrustID
@@ -50,14 +57,41 @@ namespace FineUIPro.Web.HJGL.RepairManage
{
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.txtReportDate.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
this.txtCH_AuditDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
BLL.UserService.InitUserDropDownList(this.drpCH_AuditMan, this.CurrUser.LoginProjectId, true);//审核人
this.drpCH_AuditMan.SelectedValue = this.CurrUser.UserId;
this.InitTreeMenu();
}
}
private void InitDropDownList()
{
BLL.UserService.InitUserDropDownList(this.drpCH_AuditMan, 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();
this.InitTreeMenu();
}
#endregion
#region --
@@ -66,6 +100,10 @@ namespace FineUIPro.Web.HJGL.RepairManage
/// </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());
@@ -79,19 +117,19 @@ namespace FineUIPro.Web.HJGL.RepairManage
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_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
@@ -102,13 +140,13 @@ namespace FineUIPro.Web.HJGL.RepairManage
if (!this.txtReportDate.Hidden)
{
trustLists = (from x in Funs.DB.CH_Trust
where x.CH_TrustType == "2" && x.ProjectId == this.CurrUser.LoginProjectId && x.CH_TrustDate >= startTime && x.CH_TrustDate < endTime
where x.CH_TrustType == "2" && x.ProjectId == this.ProjectId && x.CH_TrustDate >= startTime && x.CH_TrustDate < endTime
select x).ToList();
}
else
{
trustLists = (from x in Funs.DB.CH_Trust
where x.CH_TrustType == "2" && x.ProjectId == this.CurrUser.LoginProjectId && x.CH_TrustCode.Contains(this.txtSearchCode.Text.Trim())
where x.CH_TrustType == "2" && x.ProjectId == this.ProjectId && x.CH_TrustCode.Contains(this.txtSearchCode.Text.Trim())
select x).ToList();
}
if (units != null)
@@ -543,7 +581,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
/// <returns></returns>
private bool GetButtonPower(string button)
{
return BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_RepairManageAuditMenuId, button);
return BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_RepairManageAuditMenuId, button);
}
#endregion
@@ -561,7 +599,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
// 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);
@@ -572,24 +610,24 @@ namespace FineUIPro.Web.HJGL.RepairManage
// 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)));
// }
// }
@@ -636,7 +674,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
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;
@@ -766,7 +804,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
// 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";
@@ -821,7 +859,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
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;
@@ -956,7 +994,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
// 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";
@@ -974,7 +1012,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
//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);
@@ -1204,7 +1242,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
// {
// 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();
@@ -1278,7 +1316,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
keyValuePairs.Add("InstallationName", installation.InstallationName);
}
var proejct = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
var proejct = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == ProjectId);
keyValuePairs.Add("ProjectName", proejct.ProjectName);
@@ -1347,7 +1385,7 @@ namespace FineUIPro.Web.HJGL.RepairManage
keyValuePairs.Add("WorkAreaName", PworkArea.WorkAreaName);
}
}
var proejct = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
var proejct = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == ProjectId);
keyValuePairs.Add("ProjectName", proejct.ProjectName);