焊接管理,补充公司级树

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
@@ -5,7 +5,6 @@ using System.Data;
using System.Data.SqlClient;
using System.Text;
using AspNet = System.Web.UI.WebControls;
using System.Linq;
using System.IO;
using NPOI.XSSF.UserModel;
using NPOI.SS.UserModel;
@@ -15,10 +14,24 @@ namespace FineUIPro.Web.HJGL.WeldingReport
{
public partial class JointComprehensive : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
public static int percent { get; set; }
public static string url { get; set; }
#endregion
#region
/// <summary>
/// 加载页面
@@ -33,28 +46,59 @@ namespace FineUIPro.Web.HJGL.WeldingReport
url = "";
Funs.DropDownPageSize(this.ddlPageSize);
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
//单位
// var unit = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId);
// if (unit != null && unit.UnitTypeId == BLL.Const.ProjectUnitType_2)
if (CommonService.GetProjectUnitType(this.CurrUser.LoginProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UnitId != Const.hfnbdId)
this.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
{
BLL.WorkAreaService.InitWorkAreaProjectUnitDropDownList(this.drpWorkArea, this.CurrUser.LoginProjectId, this.CurrUser.UnitId, true);
this.ProjectId = Request.Params["projectId"];
}
else
this.InitDropDownList();
this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
var supervisonUnit = BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.CurrUser.LoginProjectId);
if (supervisonUnit)
{
BLL.WorkAreaService.InitWorkAreaProjectUnitDropDownList(this.drpWorkArea, this.CurrUser.LoginProjectId, this.CurrUser.UnitId, true);
}
else
{
BLL.WorkAreaService.InitWorkAreaByProjectId(this.drpWorkArea, this.CurrUser.LoginProjectId, true);
}
this.panelLeftRegion.Hidden = true;
////权限按钮方法
//this.GetButtonPower();
}
}
}
private void InitDropDownList()
{
//单位
// var unit = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId);
// if (unit != null && unit.UnitTypeId == BLL.Const.ProjectUnitType_2)
if (CommonService.GetProjectUnitType(this.ProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UnitId != Const.hfnbdId)
{
BLL.WorkAreaService.InitWorkAreaProjectUnitDropDownList(this.drpWorkArea, this.ProjectId, this.CurrUser.UnitId, true);
}
else
{
var supervisonUnit = BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.ProjectId);
if (supervisonUnit)
{
BLL.WorkAreaService.InitWorkAreaProjectUnitDropDownList(this.drpWorkArea, this.ProjectId, this.CurrUser.UnitId, true);
}
else
{
BLL.WorkAreaService.InitWorkAreaByProjectId(this.drpWorkArea, 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.BindGrid();
}
#endregion
#region BindGrid
@@ -68,20 +112,24 @@ namespace FineUIPro.Web.HJGL.WeldingReport
/// </summary>
private void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
string strSql = @"SELECT v.*,"
+ @" (select top 1 CHT_CheckDate from CH_Check c left join CH_CheckItem ci on ci.CHT_CheckID = c.CHT_CheckID where ci.JOT_ID = v.JOT_ID order by CHT_CheckDate desc) as CHT_CheckDate,"
+ @" (select top 1 CHT_CheckCode from CH_Check c left join CH_CheckItem ci on ci.CHT_CheckID = c.CHT_CheckID where ci.JOT_ID = v.JOT_ID order by CHT_CheckDate desc) as CHT_CheckCode"
+ @" FROM V_JOINTVIEW v WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (this.drpWorkArea.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpWorkArea.SelectedValue))
{
strSql += " AND WorkAreaId =@workareaId";
listStr.Add(new SqlParameter("@workareaId", this.drpWorkArea.SelectedValue));
}
if (CommonService.GetProjectUnitType(this.CurrUser.LoginProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UserId != Const.hfnbdId)
if (CommonService.GetProjectUnitType(this.ProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UserId != Const.hfnbdId)
{
strSql += " AND UnitId = @UnitId";
listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId));
@@ -161,14 +209,14 @@ namespace FineUIPro.Web.HJGL.WeldingReport
+ @" FROM V_JOINTVIEW WHERE ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (this.drpWorkArea.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpWorkArea.SelectedValue))
{
strSql += " AND WorkAreaId =@workareaId";
listStr.Add(new SqlParameter("@workareaId", this.drpWorkArea.SelectedValue));
}
if (CommonService.GetProjectUnitType(this.CurrUser.LoginProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UserId != Const.hfnbdId)
if (CommonService.GetProjectUnitType(this.ProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UserId != Const.hfnbdId)
{
strSql += " AND UnitId = @UnitId";
listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId));
@@ -311,7 +359,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
filess.Flush();
filess.Close();
}
//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)));
percent = 100;
url = ReportFileName.Replace(Server.MapPath("~/"), "");
//