From a7044c64ea21e15c96d756c6bc03563d15d6b12d Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Thu, 2 Apr 2026 09:19:01 +0800 Subject: [PATCH 1/8] 1 --- SGGL/BLL/Common/NPOIHelper.cs | 88 +++++++++++++++++ .../HSSE/SitePerson/PersonInfoIn.aspx.cs | 99 ++++++++++--------- 2 files changed, 140 insertions(+), 47 deletions(-) diff --git a/SGGL/BLL/Common/NPOIHelper.cs b/SGGL/BLL/Common/NPOIHelper.cs index bfe84611..a6814daf 100644 --- a/SGGL/BLL/Common/NPOIHelper.cs +++ b/SGGL/BLL/Common/NPOIHelper.cs @@ -502,5 +502,93 @@ namespace BLL return value.ToString(); } #endregion + + public static DataTable ExcelToDataTable1(string filePath) + { + var dt = new DataTable(); + using (var file = new FileStream(filePath, FileMode.Open, FileAccess.Read)) + { + var hssfworkbook = new HSSFWorkbook(file); + var sheet = hssfworkbook.GetSheetAt(0); + var rows = sheet.GetRowEnumerator(); + rows.MoveNext(); + var row = (HSSFRow)rows.Current; + for (var j = 0; j < row.LastCellNum; j++) + { + var cell = row.GetCell(j); + if (cell != null) + { + dt.Columns.Add(cell.StringCellValue); + } + else + { + dt.Columns.Add("collum" + j); + } + + } + while (rows.MoveNext()) + { + row = (HSSFRow)rows.Current; + var dr = dt.NewRow(); + for (var i = 0; i < row.LastCellNum; i++) + { + var cell = row.GetCell(i); + if (cell == null) + { + dr[i] = null; + } + else + { + try + { + switch (cell.CellType) + { + case CellType.Blank: + //dr[i] = "[null]"; + break; + case CellType.Boolean: + dr[i] = cell.BooleanCellValue; + break; + case CellType.Numeric: + dr[i] = cell.ToString(); + break; + case CellType.String: + dr[i] = cell.StringCellValue; + break; + case CellType.Error: + dr[i] = cell.ErrorCellValue; + break; + case CellType.Formula: + try + { + dr[i] = cell.NumericCellValue; + } + catch + { + try + { + dr[i] = cell.StringCellValue; + } + catch + { + dr[i] = null; + } + } + break; + default: + dr[i] = "=" + cell.CellFormula; + break; + } + } + catch (Exception ex) + { + } + } + } + dt.Rows.Add(dr); + } + } + return dt; + } } } diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfoIn.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfoIn.aspx.cs index 194791a4..935d475a 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfoIn.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonInfoIn.aspx.cs @@ -120,35 +120,38 @@ namespace FineUIPro.Web.HSSE.SitePerson { try { - string oleDBConnString = String.Empty; - oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; - oleDBConnString += "Data Source="; - oleDBConnString += fileName; - oleDBConnString += ";Extended Properties=Excel 8.0;"; - OleDbConnection oleDBConn = null; - OleDbDataAdapter oleAdMaster = null; - DataTable m_tableName = new DataTable(); - DataSet ds = new DataSet(); + //string oleDBConnString = String.Empty; + //oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + //oleDBConnString += "Data Source="; + //oleDBConnString += fileName; + //oleDBConnString += ";Extended Properties=Excel 8.0;"; + //OleDbConnection oleDBConn = null; + //OleDbDataAdapter oleAdMaster = null; + //DataTable m_tableName = new DataTable(); + //DataSet ds = new DataSet(); - oleDBConn = new OleDbConnection(oleDBConnString); - oleDBConn.Open(); - m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + //oleDBConn = new OleDbConnection(oleDBConnString); + //oleDBConn.Open(); + //m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); - if (m_tableName != null && m_tableName.Rows.Count > 0) - { + //if (m_tableName != null && m_tableName.Rows.Count > 0) + //{ - m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + // m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); - } - string sqlMaster; - sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; - oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); - oleAdMaster.Fill(ds, "m_tableName"); - oleAdMaster.Dispose(); - oleDBConn.Close(); - oleDBConn.Dispose(); + //} + //string sqlMaster; + //sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + //oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + //oleAdMaster.Fill(ds, "m_tableName"); + //oleAdMaster.Dispose(); + //oleDBConn.Close(); + //oleDBConn.Dispose(); - AddDatasetToSQL(ds.Tables[0]); + //AddDatasetToSQL(ds.Tables[0]); + DataTable dt = NPOIHelper.ExcelToDataTable1(fileName); + + this.AddDatasetToSQL(dt); } catch (Exception ex) { @@ -304,33 +307,35 @@ namespace FineUIPro.Web.HSSE.SitePerson { try { - string oleDBConnString = String.Empty; - oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; - oleDBConnString += "Data Source="; - oleDBConnString += fileName; - oleDBConnString += ";Extended Properties=Excel 8.0;"; - OleDbConnection oleDBConn = null; - OleDbDataAdapter oleAdMaster = null; - DataTable m_tableName = new DataTable(); - DataSet ds = new DataSet(); + //string oleDBConnString = String.Empty; + //oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + //oleDBConnString += "Data Source="; + //oleDBConnString += fileName; + //oleDBConnString += ";Extended Properties=Excel 8.0;"; + //OleDbConnection oleDBConn = null; + //OleDbDataAdapter oleAdMaster = null; + //DataTable m_tableName = new DataTable(); + //DataSet ds = new DataSet(); - oleDBConn = new OleDbConnection(oleDBConnString); - oleDBConn.Open(); - m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + //oleDBConn = new OleDbConnection(oleDBConnString); + //oleDBConn.Open(); + //m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); - if (m_tableName != null && m_tableName.Rows.Count > 0) - { + //if (m_tableName != null && m_tableName.Rows.Count > 0) + //{ - m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + // m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); - } - string sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; - oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); - oleAdMaster.Fill(ds, "m_tableName"); - oleAdMaster.Dispose(); - oleDBConn.Close(); - oleDBConn.Dispose(); - AddDatasetToSQL2(ds.Tables[0]); + //} + //string sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + //oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + //oleAdMaster.Fill(ds, "m_tableName"); + //oleAdMaster.Dispose(); + //oleDBConn.Close(); + //oleDBConn.Dispose(); + DataTable dt = NPOIHelper.ExcelToDataTable1(fileName); + + this.AddDatasetToSQL2(dt); } catch (Exception ex) { From eaa0147cb1ca2717383fb2f1d0fdb6a5621012c4 Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Thu, 2 Apr 2026 10:15:56 +0800 Subject: [PATCH 2/8] 1 --- SGGL/BLL/Person/Person_DutyService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SGGL/BLL/Person/Person_DutyService.cs b/SGGL/BLL/Person/Person_DutyService.cs index 63850fb3..5d8c918b 100644 --- a/SGGL/BLL/Person/Person_DutyService.cs +++ b/SGGL/BLL/Person/Person_DutyService.cs @@ -30,6 +30,9 @@ namespace BLL /// public static IEnumerable getListData(string personId, Grid Grid1) { + Model.SGGLDB db = Funs.DB; + var getDataLists = from x in db.Person_Duty + select x; IQueryable getDataList = getDataLists.Where(x => x.DutyPersonId == personId); count = getDataList.Count(); if (count == 0) @@ -46,7 +49,7 @@ namespace BLL x.CompilePersonId, x.CompileTime, x.WorkPostId, - WorkPostName = Funs.DB.Base_WorkPost.First(U => U.WorkPostId == x.WorkPostId).WorkPostName, + WorkPostName = db.Base_WorkPost.First(U => U.WorkPostId == x.WorkPostId).WorkPostName, x.ApprovePersonId, x.ApproveTime, x.State, From 48785fbdaed22ea2b1993ff83363b9a25cec2eeb Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Thu, 2 Apr 2026 10:21:46 +0800 Subject: [PATCH 3/8] 1 --- SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs index 3a34a626..776a7f52 100644 --- a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs +++ b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs @@ -17,11 +17,6 @@ namespace BLL set; } - /// - /// 定义变量 - /// - private static IQueryable getDataLists = from x in Funs.DB.SitePerson_PersonItem select x; - /// /// 获取分页列表 /// @@ -36,6 +31,8 @@ namespace BLL /// public static IEnumerable getListData(string projectId, string unitId, string personId, string name, string idCard, DateTime? startDate, DateTime? endDate, Grid Grid1) { + Model.SGGLDB db = Funs.DB; + var getDataLists = from x in db.SitePerson_PersonItem select x; IQueryable getDataList = getDataLists.Where(e => e.PersonId == personId); if (!string.IsNullOrEmpty(projectId) && projectId != Const._Null) { From 7715352579d9d48c28f8f2dad12f2b4fff1c4e4a Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Thu, 2 Apr 2026 11:55:50 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E7=84=8A=E6=8E=A5=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=8D=95=E7=94=9F=E6=88=90=E5=87=BA=E5=BA=93=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=8D=95=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/BLL/CLGL/TwInOutplanmasterService.cs | 4 ++-- SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 2 +- .../HJGL/WeldingManage/WeldTask.aspx.cs | 2 -- .../HiddenRectificationList.aspx | 1 + .../common/mainMenu_HJGL3.aspx.cs | 19 +++++++++++-------- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/SGGL/BLL/CLGL/TwInOutplanmasterService.cs b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs index 39b09813..94db0e6a 100644 --- a/SGGL/BLL/CLGL/TwInOutplanmasterService.cs +++ b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs @@ -750,7 +750,7 @@ namespace BLL ProjectId = weldTask.ProjectId, // CusBillCode = string.Format("{0:yyyyMMdd}", DateTime.Now) + UnitService.GetUnitCodeByUnitId(weldTask.UnitId) + "-" + UnitWorkService.getUnitWorkByUnitWorkId(weldTask.UnitWorkId)?.UnitWorkCode + "AP-PF01", CusBillCode = TwInOutplanmasterService.GetCusBillCodeByTaskCode(weldTaskCode, TwConst.TypeInt.领料出库, TwConst.Category.管件), - WarehouseCode = PipelineService.GetPipeArea().Where(x => x.Value == PipelineService.GetPipelineByPipelineId(weldTask.PipelineId).PipeArea).Select(x => x.Text).FirstOrDefault(), + WarehouseCode = BLL.Base_WarehouseService.GetWarehouseByWarehouseId(PipelineService.GetPipelineByPipelineId(weldTask.PipelineId).WarehouseId).WarehouseName, Source = 1, InOutType = (int)TwConst.InOutType.出库, TypeInt = (int)TwConst.TypeInt.领料出库, @@ -789,7 +789,7 @@ namespace BLL Id = Guid.NewGuid().ToString(), ProjectId = weldTask.ProjectId, CusBillCode = TwInOutplanmasterService.GetCusBillCodeByTaskCode(weldTaskCode, TwConst.TypeInt.领料出库, TwConst.Category.管段), - WarehouseCode = PipelineService.GetPipeArea().Where(x => x.Value == PipelineService.GetPipelineByPipelineId(weldTask.PipelineId).PipeArea).Select(x => x.Text).FirstOrDefault(), + WarehouseCode = BLL.Base_WarehouseService.GetWarehouseByWarehouseId(PipelineService.GetPipelineByPipelineId(weldTask.PipelineId).WarehouseId).WarehouseName, Source = 1, InOutType = (int)TwConst.InOutType.出库, TypeInt = (int)TwConst.TypeInt.领料出库, diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 223f44ea..11586171 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -17017,7 +17017,7 @@ - + diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs index 01992a81..15d9cfe6 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldTask.aspx.cs @@ -1316,8 +1316,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage } } - - protected void btnPrintJoint_Click(object sender, EventArgs e) { var rows = Grid1.SelectedRowIndexArray; diff --git a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx index 953968eb..84c16e77 100644 --- a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx +++ b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx @@ -69,6 +69,7 @@ + <%-- --%>