焊接管理,补充公司级树

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
@@ -14,6 +14,20 @@ namespace FineUIPro.Web.HJGL.DataIn
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
/// <summary>
/// 是否PDMS
/// </summary>
private string IsPDMS
@@ -39,18 +53,26 @@ namespace FineUIPro.Web.HJGL.DataIn
{
if (!IsPostBack)
{
this.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.ProjectId)
{
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();
}
if (percent == null)
{
percent = new Dictionary<string, int>();
}
this.id.Text = this.CurrUser.UserId;
this.IsPDMS = "0";
var set = BLL.Project_SysSetService.GetSysSetBySetId("8", this.CurrUser.LoginProjectId);
if (set != null && set.IsAuto == true)
{
this.IsPDMS = "1";
this.FileExcel.EmptyText = "请上传PDMS模板的EXCEl格式文件";
}
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
@@ -61,6 +83,27 @@ namespace FineUIPro.Web.HJGL.DataIn
BindGrid();
}
}
private void InitDropDownList()
{
var set = BLL.Project_SysSetService.GetSysSetBySetId("8", this.ProjectId);
if (set != null && set.IsAuto == true)
{
this.IsPDMS = "1";
this.FileExcel.EmptyText = "请上传PDMS模板的EXCEl格式文件";
}
}
/// <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
@@ -69,13 +112,17 @@ namespace FineUIPro.Web.HJGL.DataIn
/// </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 Sys_DataInTemp "
+ @" WHERE ProjectId=@ProjectId AND UserId=@UserId AND Type=@Type";
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));
listStr.Add(new SqlParameter("@Type", this.IsPDMS));
//if (!string.IsNullOrEmpty(this.txtValue1.Text.Trim()))
@@ -114,7 +161,7 @@ namespace FineUIPro.Web.HJGL.DataIn
Grid1.DataBind();
var dataInTempAll = from x in Funs.DB.Sys_DataInTemp
where x.ProjectId == this.CurrUser.LoginProjectId && x.UserId == this.CurrUser.UserId && x.Type == this.IsPDMS
where x.ProjectId == this.ProjectId && x.UserId == this.CurrUser.UserId && x.Type == this.IsPDMS
select x;
for (int i = 0; i < Grid1.Rows.Count; i++)
{
@@ -177,7 +224,7 @@ namespace FineUIPro.Web.HJGL.DataIn
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_DataInMenuId, Const.BtnIn))
if (CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, Const.HJGL_DataInMenuId, Const.BtnIn))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DataInEdit.aspx?TempId={0}", Grid1.SelectedRowID, "维护 - ")));
}
@@ -196,7 +243,7 @@ namespace FineUIPro.Web.HJGL.DataIn
/// <param name="e"></param>
protected void btnMenuEdit_Click(object sender, EventArgs e)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_DataInMenuId, BLL.Const.BtnIn))
if (BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_DataInMenuId, BLL.Const.BtnIn))
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
@@ -218,7 +265,7 @@ namespace FineUIPro.Web.HJGL.DataIn
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_DataInMenuId, Const.BtnIn))
if (CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, Const.HJGL_DataInMenuId, Const.BtnIn))
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
@@ -230,7 +277,7 @@ namespace FineUIPro.Web.HJGL.DataIn
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
BLL.DataInTempService.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);
@@ -265,7 +312,7 @@ namespace FineUIPro.Web.HJGL.DataIn
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
/// <summary>
/// 排序
/// </summary>
@@ -275,8 +322,8 @@ namespace FineUIPro.Web.HJGL.DataIn
{
BindGrid();
}
#endregion
#endregion
#region
/// <summary>
/// 文件上传
@@ -345,7 +392,7 @@ namespace FineUIPro.Web.HJGL.DataIn
//oleDBConn.Close();
//oleDBConn.Dispose();
//this.AddDatasetToSQL(ds.Tables[0]);
DataTable dt = NPOIHelper.ExcelToDataTable1(fileUrl);
DataTable dt = NPOIHelper.ExcelToDataTable1(fileUrl);
this.AddDatasetToSQL(dt);
@@ -398,7 +445,7 @@ namespace FineUIPro.Web.HJGL.DataIn
{
Model.Sys_DataInTemp newDataInTemp = new Model.Sys_DataInTemp();
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.Type = this.IsPDMS;
@@ -491,7 +538,7 @@ namespace FineUIPro.Web.HJGL.DataIn
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
Thread t = new Thread(new ThreadStart(() => { btnSaveMethod(this.CurrUser.LoginProjectId, this.CurrUser.UserId, this.IsPDMS); }));
Thread t = new Thread(new ThreadStart(() => { btnSaveMethod(this.ProjectId, this.CurrUser.UserId, this.IsPDMS); }));
t.Start();
if (percent.ContainsKey(this.CurrUser.UserId))
{
@@ -502,15 +549,15 @@ namespace FineUIPro.Web.HJGL.DataIn
percent.Add(CurrUser.UserId, 0);
}
PageContext.RegisterStartupScript("printX()");
PageContext.RegisterStartupScript("printX()");
}
protected void btnRefresh_Click(object sender, EventArgs e)
{
this.BindGrid();
}
protected void btnSaveMethod(string LoginProjectId,string UserId, string IsPDMS)
protected void btnSaveMethod(string LoginProjectId, string UserId, string IsPDMS)
{
//beginProgress();
var units = from x in Funs.DB.Base_Unit
@@ -530,7 +577,7 @@ namespace FineUIPro.Web.HJGL.DataIn
var components = from x in Funs.DB.Base_Components select x;
var dns = from x in Funs.DB.Base_DNCompare select x;
var dataInTemp = from x in Funs.DB.Sys_DataInTemp
where x.ProjectId == LoginProjectId && x.UserId ==UserId && x.Type == IsPDMS
where x.ProjectId == LoginProjectId && x.UserId == UserId && x.Type == IsPDMS
select x;
int okCount = 0;
int i = 0;
@@ -538,7 +585,7 @@ namespace FineUIPro.Web.HJGL.DataIn
string erreMessage = "";
foreach (var tempData in dataInTemp)
{
//if (i % (ir / 100 + 1) == 0 && i < ir && i > 0)
//{
// setProgress(i / (ir / 100 + 1));
@@ -548,11 +595,11 @@ namespace FineUIPro.Web.HJGL.DataIn
//}
//i++;
if (tempData != null)
{
i++;
{
i++;
percent[UserId] = (int)(100 * i / ir);
string errInfo = string.Empty;
var isExitValue = Funs.DB.View_JointInfoAndIsoInfo.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.UnitCode == tempData.Value1
var isExitValue = Funs.DB.View_JointInfoAndIsoInfo.FirstOrDefault(x => x.ProjectId == this.ProjectId && x.UnitCode == tempData.Value1
&& x.WorkAreaCode == tempData.Value2 && x.ISO_IsoNo == tempData.Value3 && x.JOT_JointNo == tempData.Value4);
if (isExitValue == null || this.ckUpdate.Checked)
{
@@ -562,7 +609,7 @@ namespace FineUIPro.Web.HJGL.DataIn
isoInfo.Is_Standard = false;
if (!string.IsNullOrEmpty(tempData.Value1))
{
var unit = units.FirstOrDefault(x => x.UnitCode == tempData.Value1 );
var unit = units.FirstOrDefault(x => x.UnitCode == tempData.Value1);
if (unit == null)
{
errInfo += "单位代码[" + tempData.Value1 + "]不存在;";
@@ -625,7 +672,7 @@ namespace FineUIPro.Web.HJGL.DataIn
jointInfo.MaterialType = materialType.MaterialTypeId;
}
}
if (!string.IsNullOrEmpty(tempData.Value8))
{
jointInfo.Material1 = tempData.Value8;
@@ -757,7 +804,7 @@ namespace FineUIPro.Web.HJGL.DataIn
{
try
{
isoInfo.ISO_DesignTemperature = tempData.Value24;
}
catch (Exception)
@@ -1151,9 +1198,9 @@ namespace FineUIPro.Web.HJGL.DataIn
if (string.IsNullOrEmpty(errInfo)) ////所有信息正确的话 这插入管线焊口
{
isoInfo.ProjectId = this.CurrUser.LoginProjectId;
jointInfo.ProjectId = this.CurrUser.LoginProjectId;
var isExitISOValue = Funs.DB.View_JointInfoAndIsoInfo.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.UnitCode == tempData.Value1
isoInfo.ProjectId = this.ProjectId;
jointInfo.ProjectId = this.ProjectId;
var isExitISOValue = Funs.DB.View_JointInfoAndIsoInfo.FirstOrDefault(x => x.ProjectId == this.ProjectId && x.UnitCode == tempData.Value1
&& x.WorkAreaCode == tempData.Value2 && x.ISO_IsoNo == tempData.Value3);
if (isExitISOValue != null) ///管线已存在
{
@@ -1167,7 +1214,7 @@ namespace FineUIPro.Web.HJGL.DataIn
jointInfo.ISO_ID = isoInfo.ISO_ID;
BLL.PW_IsoInfoService.AddIsoInfo(isoInfo);
}
var isExitJotNoValue = Funs.DB.View_JointInfoAndIsoInfo.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.UnitCode == tempData.Value1
var isExitJotNoValue = Funs.DB.View_JointInfoAndIsoInfo.FirstOrDefault(x => x.ProjectId == this.ProjectId && x.UnitCode == tempData.Value1
&& x.WorkAreaCode == tempData.Value2 && x.ISO_IsoNo == tempData.Value3 && x.JOT_JointNo == tempData.Value4 && x.JOT_JointStatus != "104");
if (isExitJotNoValue == null)
{
@@ -1200,7 +1247,7 @@ namespace FineUIPro.Web.HJGL.DataIn
}
}
Project_HJGLData_HJGLService.StatisticalData(this.CurrUser.LoginProjectId, Project_HJGLData_HJGLService.HJGLDateType.ArrivalFactor);
Project_HJGLData_HJGLService.StatisticalData(this.ProjectId, Project_HJGLData_HJGLService.HJGLDateType.ArrivalFactor);
//if (!string.IsNullOrEmpty(erreMessage))
//{
// // ShowNotify(erreMessage, MessageBoxIcon.Error);
@@ -1233,7 +1280,7 @@ namespace FineUIPro.Web.HJGL.DataIn
protected void btnAllDelete_Click(object sender, EventArgs e)
{
////先删除临时表中 该人员以前导入的数据
BLL.DataInTempService.DeleteDataInTempByProjectIdUserId(this.CurrUser.LoginProjectId, this.CurrUser.UserId, this.IsPDMS);
BLL.DataInTempService.DeleteDataInTempByProjectIdUserId(this.ProjectId, this.CurrUser.UserId, this.IsPDMS);
this.BindGrid();
ShowNotify("删除成功!", MessageBoxIcon.Success);
this.lbDataCout.Text = string.Empty;
@@ -1295,8 +1342,8 @@ namespace FineUIPro.Web.HJGL.DataIn
}
#endregion
public static Dictionary<string,int> percent { get; set; }
public static Dictionary<string,string >url { get; set; }
public static Dictionary<string, int> percent { get; set; }
public static Dictionary<string, string> url { get; set; }
[System.Web.Services.WebMethod]
public static int getPercent(string id)