From fcb9ebe8dbe367dbc727d16dc49a3a6e1a5f0ddf Mon Sep 17 00:00:00 2001 From: ZONES <765289303@qq.com> Date: Thu, 5 Jun 2025 14:49:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8F=AD=E5=89=8D=E4=BC=9A=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=20=E7=89=A9=E8=B4=A8=E7=AE=A1=E7=90=86=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/FineUIPro.Web/ErrLog.txt | 51 +++++++++++++++++++ .../HSSE/Meeting/ClassMeeting.aspx.cs | 6 +-- .../Controllers/MaterialsBasicsController.cs | 47 ++++++++--------- 3 files changed, 76 insertions(+), 28 deletions(-) diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt index b10d259..559d1d4 100644 --- a/SGGL/FineUIPro.Web/ErrLog.txt +++ b/SGGL/FineUIPro.Web/ErrLog.txt @@ -7372,3 +7372,54 @@ IP地址:::1 出错时间:05/14/2025 17:37:21 + +错误信息开始=====> +错误类型:NullReferenceException +错误信息:未将对象引用设置到对象的实例。 +错误堆栈: + 在 FineUIPro.Web.HSSE.Meeting.ClassMeeting.Page_Load(Object sender, EventArgs e) 位置 E:\COMPANYPROJECT\河北安装\SGGL_HBAZ\SGGL\FineUIPro.Web\HSSE\Meeting\ClassMeeting.aspx.cs:行号 40 + 在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) + 在 System.Web.UI.Control.OnLoad(EventArgs e) + 在 System.Web.UI.Control.LoadRecursive() + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:06/04/2025 09:55:34 +出错文件:http://localhost:4528/HSSE/Meeting/ClassMeeting.aspx +IP地址:::1 + +出错时间:06/04/2025 09:55:34 + + + +错误信息开始=====> +错误类型:NullReferenceException +错误信息:未将对象引用设置到对象的实例。 +错误堆栈: + 在 FineUIPro.Web.HSSE.Meeting.ClassMeeting.Page_Load(Object sender, EventArgs e) 位置 E:\COMPANYPROJECT\河北安装\SGGL_HBAZ\SGGL\FineUIPro.Web\HSSE\Meeting\ClassMeeting.aspx.cs:行号 40 + 在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) + 在 System.Web.UI.Control.OnLoad(EventArgs e) + 在 System.Web.UI.Control.LoadRecursive() + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:06/04/2025 10:21:52 +出错文件:http://localhost:4528/HSSE/Meeting/ClassMeeting.aspx +IP地址:::1 + +出错时间:06/04/2025 10:21:52 + + + +错误信息开始=====> +错误类型:NullReferenceException +错误信息:未将对象引用设置到对象的实例。 +错误堆栈: + 在 FineUIPro.Web.HSSE.Meeting.ClassMeeting.Page_Load(Object sender, EventArgs e) 位置 E:\COMPANYPROJECT\河北安装\SGGL_HBAZ\SGGL\FineUIPro.Web\HSSE\Meeting\ClassMeeting.aspx.cs:行号 40 + 在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) + 在 System.Web.UI.Control.OnLoad(EventArgs e) + 在 System.Web.UI.Control.LoadRecursive() + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:06/05/2025 14:16:02 +出错文件:http://localhost:4528/HSSE/Meeting/ClassMeeting.aspx +IP地址:::1 + +出错时间:06/05/2025 14:16:02 + + diff --git a/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx.cs index eca5ab2..9d86d8d 100644 --- a/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/Meeting/ClassMeeting.aspx.cs @@ -89,12 +89,12 @@ namespace FineUIPro.Web.HSSE.Meeting } if (!string.IsNullOrEmpty(txtStartTime.Text.Trim())) { - strSql += " AND ClassMeeting.CompileDate >= @StartTime"; + strSql += " AND ClassMeeting.ClassMeetingDate >= @StartTime"; listStr.Add(new SqlParameter("@StartTime", string.Format("{0} {1}", this.txtStartTime.Text.Trim(), "00:00:00"))); } if (!string.IsNullOrEmpty(this.txtEndTime.Text.Trim())) { - strSql += " AND ClassMeeting.CompileDate <= @EndTime ORDER BY TeamGroupId ASC"; + strSql += " AND ClassMeeting.ClassMeetingDate <= @EndTime ORDER BY TeamGroupId ASC"; listStr.Add(new SqlParameter("@EndTime", string.Format("{0} {1}", this.txtEndTime.Text.Trim(), "23:59:59"))); } SqlParameter[] parameter = listStr.ToArray(); @@ -216,7 +216,7 @@ namespace FineUIPro.Web.HSSE.Meeting DateTime end = DateTime.Parse(string.Format("{0} 23:59:59", this.txtEndTime.Text.Trim())); try { - str = Funs.DB.Meeting_ClassMeeting.Where(x => x.TeamGroupId == groupId && x.CompileDate >= start && x.CompileDate <= end && x.ProjectId == this.CurrUser.LoginProjectId).Sum(p => p.AttentPersonNum).ToString(); + str = Funs.DB.Meeting_ClassMeeting.Where(x => x.TeamGroupId == groupId && x.ClassMeetingDate >= start && x.ClassMeetingDate <= end && x.ProjectId == this.CurrUser.LoginProjectId).Sum(p => p.AttentPersonNum).ToString(); } catch (Exception ex) { diff --git a/SGGL/WebAPI/Controllers/MaterialsBasicsController.cs b/SGGL/WebAPI/Controllers/MaterialsBasicsController.cs index 7039d2f..f56463a 100644 --- a/SGGL/WebAPI/Controllers/MaterialsBasicsController.cs +++ b/SGGL/WebAPI/Controllers/MaterialsBasicsController.cs @@ -137,31 +137,28 @@ namespace WebAPI.Controllers Model.ResponeData responeData = new Model.ResponeData(); try { - var list = ( - from cl in Funs.DB.Cl_w_comp - join bm in Funs.DB.CL_B_Material on cl.MaterialID equals bm.MaterialID - join bi in Funs.DB.Cl_b_Installation on cl.InstallationId equals bi.InstallationId - where cl.ProjectId == ProjectId && cl.InstallationId == InstallationId && cl.Ghfs == ghfs && cl.TAreaMaterialMID == area - select new - { - ProjectId = cl.ProjectId, // 项目ID - InstallationId = cl.InstallationId, // 专业ID - Installationname = bi.InstallationName, // 专业名称 - ghfs = cl.Ghfs, // 采购方类别 - MaterialID = bm.MaterialID, // 物资ID - MaterialName = bm.MaterialName, // 物资名称 - Specificationtype = bm.Specificationtype, // 规格 - TechnicalConditions = bm.TechnicalConditions, - StandardSpecification = bm.StandardSpecification, - MaterialQuality = bm.MaterialQuality, - Unit = bm.Unit, // 单位 - SystemCode = bm.SystemCode, // 编号 - AreaCode = cl.TAreaMaterialMID, // 工区 - jh_quantity = cl.Pquantity, // 计划量 - ck_quantity = cl.Pquantity - cl.OQuantity, // 最大允许出库量 - kc_quantity = cl.SQuantity - cl.OQuantity + cl.RQuantity - cl.HQuantity // 库存量 - } - ).ToList(); + var list = (from bm in Funs.DB.CL_B_Material + where bm.ProjectId == ProjectId + select new + { + ProjectId = bm.ProjectId, // 项目ID + InstallationId = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).InstallationId, // 专业ID + Installationname = Funs.DB.Cl_b_Installation.FirstOrDefault(x => x.InstallationId == InstallationId).InstallationName, // 专业名称 + ghfs = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).Ghfs, // 采购方类别 + MaterialID = bm.MaterialID, // 物资ID + MaterialName = bm.MaterialName, // 物资名称 + Specificationtype = bm.Specificationtype, // 规格 + TechnicalConditions = bm.TechnicalConditions, + StandardSpecification = bm.StandardSpecification, + MaterialQuality = bm.MaterialQuality, + Unit = bm.Unit, // 单位 + SystemCode = bm.SystemCode, // 编号 + AreaCode = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).TAreaMaterialMID, // 工区 + jh_quantity = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).Pquantity, // 计划量 + ck_quantity = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).Pquantity - Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).OQuantity, // 最大允许出库量 + kc_quantity = Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).SQuantity - Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).OQuantity + Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).RQuantity - Funs.DB.Cl_w_comp.FirstOrDefault(x => x.MaterialID == bm.MaterialID).HQuantity // 库存量 + } + ).ToList(); responeData.data = list; } catch (System.Exception ex)