焊接管理,补充公司级树

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
@@ -3,16 +3,29 @@ using BLL.Common;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Threading;
namespace FineUIPro.Web.HJGL.CheckManage
{
public partial class CheckManageImport : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
@@ -24,6 +37,20 @@ 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.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.ProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
//this.GetButtonPower();
}
if (percent == null)
{
percent = new Dictionary<string, int>();
@@ -38,6 +65,22 @@ namespace FineUIPro.Web.HJGL.CheckManage
BindGrid();
}
}
/// <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.BindGrid();
}
#endregion
#region
@@ -46,13 +89,17 @@ namespace FineUIPro.Web.HJGL.CheckManage
/// </summary>
private void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
string strSql = @"SELECT TempId,ProjectId,UserId,Time,RowNo,ToopValue,Value1,Value2,Value3,Value4,Value5,Value6,Value7,Value8,Value9,Value10"
+ @" ,Value11,Value12,Value13,Value14,Value15,Value16,Value17,Value18,Value19,Value20,Value21,Value22,Value23,Value24,Value25,Value26,Value27,Value28,Value29,Value30"
+ @" ,Value31,Value32,Value33,Value34,Value35,Value36,Value37,Value38,Value39,Value40,Value41,Value42,Value43,Value44,Value45,Value46,Value47,Value48,Value49,Value50,ToopValue,Type"
+ @" FROM HJGL_CheckImportTemp "
+ @" WHERE ProjectId=@ProjectId AND UserId=@UserId ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
listStr.Add(new SqlParameter("@UserId", this.CurrUser.UserId));
//if (!string.IsNullOrEmpty(this.txtValue1.Text.Trim()))
//{
@@ -90,7 +137,7 @@ namespace FineUIPro.Web.HJGL.CheckManage
Grid1.DataBind();
var dataInTempAll = from x in Funs.DB.HJGL_CheckImportTemp
where x.ProjectId == this.CurrUser.LoginProjectId && x.UserId == this.CurrUser.UserId
where x.ProjectId == this.ProjectId && x.UserId == this.CurrUser.UserId
select x;
for (int i = 0; i < Grid1.Rows.Count; i++)
{
@@ -164,7 +211,7 @@ namespace FineUIPro.Web.HJGL.CheckManage
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
BLL.CheckManageImportTempService.DeleteDataInTempByDataInTempID(rowID);
//BLL.Sys_LogService.AddLog(Const.System_7, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除导入信息");
//BLL.Sys_LogService.AddLog(Const.System_7, this.ProjectId, this.CurrUser.UserId, "删除导入信息");
}
ShowNotify("删除成功!", MessageBoxIcon.Success);
@@ -312,7 +359,7 @@ namespace FineUIPro.Web.HJGL.CheckManage
{
Model.HJGL_CheckImportTemp newDataInTemp = new Model.HJGL_CheckImportTemp();
newDataInTemp.TempId = SQLHelper.GetNewID(typeof(Model.Sys_DataInTemp));
newDataInTemp.ProjectId = this.CurrUser.LoginProjectId;
newDataInTemp.ProjectId = this.ProjectId;
newDataInTemp.UserId = this.CurrUser.UserId;
newDataInTemp.Time = System.DateTime.Now;
newDataInTemp.RowNo = i + 2;
@@ -361,11 +408,11 @@ namespace FineUIPro.Web.HJGL.CheckManage
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
btnSaveMethod(this.CurrUser.LoginProjectId, this.CurrUser.UserId);
btnSaveMethod(this.ProjectId, this.CurrUser.UserId);
}
protected void btnSaveCheck_Click(object sender, EventArgs e)
{
btnSaveCheckMethod(this.CurrUser.LoginProjectId, this.CurrUser.UserId);
btnSaveCheckMethod(this.ProjectId, this.CurrUser.UserId);
}
protected void btnRefresh_Click(object sender, EventArgs e)
{
@@ -380,10 +427,10 @@ namespace FineUIPro.Web.HJGL.CheckManage
where y.ProjectId == LoginProjectId
select x;
var isos = from x in Funs.DB.PW_IsoInfo
where x.ProjectId == CurrUser.LoginProjectId
where x.ProjectId == ProjectId
select x;
var jointInfos = from x in Funs.DB.PW_JointInfo
where x.ProjectId == CurrUser.LoginProjectId
where x.ProjectId == ProjectId
select x;
var workAreas = from x in Funs.DB.ProjectData_WorkArea where x.ProjectId == LoginProjectId select x;
@@ -607,11 +654,11 @@ namespace FineUIPro.Web.HJGL.CheckManage
{
Model.BO_Point point = new Model.BO_Point();
string date = pointDate.Trim().Replace("-", "");
point.PW_PointNo = BLL.SQLHelper.RunProcNewId("SpGetNewCode3ByProjectPrefix", "dbo.BO_Point", "PW_PointNo", this.CurrUser.LoginProjectId, date + "-");
point.PW_PointNo = BLL.SQLHelper.RunProcNewId("SpGetNewCode3ByProjectPrefix", "dbo.BO_Point", "PW_PointNo", this.ProjectId, date + "-");
point.PW_PointID = Guid.NewGuid().ToString();
point.UnitId = units.FirstOrDefault(x => x.UnitCode == unitCode).UnitId;
point.PW_PointDate = Convert.ToDateTime(pointDate);
point.ProjectId = this.CurrUser.LoginProjectId;
point.ProjectId = this.ProjectId;
point.InstallationId = workAreas.FirstOrDefault(x => x.WorkAreaCode == WorkArea).InstallationId;
point.PW_TablerDate = DateTime.Now;
point.PW_Tabler = this.CurrUser.UserId;
@@ -639,7 +686,7 @@ namespace FineUIPro.Web.HJGL.CheckManage
var firstDataTemp = dataInTemp.FirstOrDefault(x => x.Value6 == trust);
Model.CH_Trust newTrust = new Model.CH_Trust();
newTrust.CH_TrustID = Guid.NewGuid().ToString();
newTrust.ProjectId = this.CurrUser.LoginProjectId;
newTrust.ProjectId = this.ProjectId;
newTrust.CH_TrustCode = firstDataTemp.Value6;
var iso = isos.FirstOrDefault(x => x.ISO_IsoNo == firstDataTemp.Value3);
var unit = units.FirstOrDefault(x => x.UnitCode == firstDataTemp.Value1);
@@ -765,7 +812,7 @@ namespace FineUIPro.Web.HJGL.CheckManage
var trust = newTrusts.FirstOrDefault(x => x.CH_TrustCode == firstDataTemp.Value6);
Model.CH_Check check = new Model.CH_Check();
check.CHT_CheckID = Guid.NewGuid().ToString();
check.ProjectId = this.CurrUser.LoginProjectId;
check.ProjectId = this.ProjectId;
check.CHT_CheckCode = checkCode;
check.CH_TrustID = trust.CH_TrustID;
check.UnitId = trust.CH_TrustUnit;
@@ -890,10 +937,10 @@ namespace FineUIPro.Web.HJGL.CheckManage
where y.ProjectId == LoginProjectId
select x;
var isos = from x in Funs.DB.PW_IsoInfo
where x.ProjectId == CurrUser.LoginProjectId
where x.ProjectId == ProjectId
select x;
var jointInfos = from x in Funs.DB.PW_JointInfo
where x.ProjectId == CurrUser.LoginProjectId
where x.ProjectId == ProjectId
select x;
var workAreas = from x in Funs.DB.ProjectData_WorkArea where x.ProjectId == LoginProjectId select x;
@@ -1072,10 +1119,10 @@ namespace FineUIPro.Web.HJGL.CheckManage
{
var firstDataTemp = dataInTemp.FirstOrDefault(x => x.Value8 == checkCode);
var trust = Funs.DB.CH_Trust.FirstOrDefault(x => x.ProjectId==CurrUser.LoginProjectId && x.CH_TrustCode == firstDataTemp.Value6);
var trust = Funs.DB.CH_Trust.FirstOrDefault(x => x.ProjectId==ProjectId && x.CH_TrustCode == firstDataTemp.Value6);
Model.CH_Check check = new Model.CH_Check();
check.CHT_CheckID = Guid.NewGuid().ToString();
check.ProjectId = this.CurrUser.LoginProjectId;
check.ProjectId = this.ProjectId;
check.CHT_CheckCode = checkCode;
check.CH_TrustID = trust.CH_TrustID;
check.UnitId = trust.CH_TrustUnit;
@@ -1201,7 +1248,7 @@ namespace FineUIPro.Web.HJGL.CheckManage
{
////先删除临时表中 该人员以前导入的数据
BLL.CheckManageImportTempService.DeleteDataInTempByProjectIdUserId(this.CurrUser.LoginProjectId, this.CurrUser.UserId);
BLL.CheckManageImportTempService.DeleteDataInTempByProjectIdUserId(this.ProjectId, this.CurrUser.UserId);
this.BindGrid();
ShowNotify("删除成功!", MessageBoxIcon.Success);
this.lbDataCout.Text = string.Empty;