diff --git a/SGGL/FineUIPro.Web/CQMS/ProcessControl/InspectionManagement.aspx b/SGGL/FineUIPro.Web/CQMS/ProcessControl/InspectionManagement.aspx index a4d61fba..5c95bb92 100644 --- a/SGGL/FineUIPro.Web/CQMS/ProcessControl/InspectionManagement.aspx +++ b/SGGL/FineUIPro.Web/CQMS/ProcessControl/InspectionManagement.aspx @@ -9,7 +9,7 @@
- + @@ -59,13 +59,13 @@ - - <%-- --%> @@ -79,13 +79,13 @@ - - + - + diff --git a/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs b/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs index 16acbcea..14d95cb9 100644 --- a/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs +++ b/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs @@ -4,6 +4,7 @@ using FineUIPro.Web.DataShow; using FineUIPro.Web.SysManage; using Model; using Newtonsoft.Json; +using NPOI.HSSF.Record; using NPOI.Util; using System; using System.Collections; @@ -258,7 +259,7 @@ namespace FineUIPro.Web.common join z in Funs.DB.Base_WorkPost on x.PostId equals z.WorkPostId into zGroup from z in zGroup.DefaultIfEmpty() where x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == DateTime.Now.Date - select new {x.IDCardNo, z.PostType }; + select new { x.IDCardNo, z.PostType }; AllCount = getallin.Count(); if (AllCount > 0) @@ -937,23 +938,20 @@ namespace FineUIPro.Web.common // } // } // } - - var ndtList = - (from x in db.ProcessControl_NondestructiveTest_New - where x.ProjectId == ProjectId - select x).ToList(); + + var ndtList = (from x in db.ProcessControl_NondestructiveTest_New where x.ProjectId == ProjectId select x).ToList(); decimal a = 0, b = 0; if (ndtList.Count > 0) { - foreach (var item in ndtList) + //取每个单位最新的一条数据 + var datalist = ndtList.GroupBy(r => r.UnitId).Select(g => g.OrderByDescending(r => r.CreateDate).First()).ToList(); + foreach (var item in datalist) { if (item.TotalQuantity.HasValue) { - a += Math.Floor(item.TotalQuantity.Value * Funs.GetNewDecimalOrZero(item.TotalRate) / - 100); + a += Math.Floor(item.TotalQuantity.Value * Funs.GetNewDecimalOrZero(item.TotalRate) / 100); b += item.TotalQuantity.Value; } - } result = Convert.ToDouble(Convert.ToDecimal(100.0) * b / a); } @@ -974,8 +972,8 @@ namespace FineUIPro.Web.common } } } - - + + if (b > 0) { hjallNumber = b.ToString(); @@ -1654,7 +1652,7 @@ where qc.QuantityCompletionId=(select top 1 QuantityCompletionId from[JDGL_Quant SqlParameter[] Staticparameter = listStaticListStr.ToArray(); DataTable statcitbDataTable = SQLHelper.GetDataTableRunProc("Sp_GJSXStatistic", Staticparameter); - var list = from x in Funs.DB.GJSX where x.ProjectId == this.CurrUser.LoginProjectId && x.State!="1" select x; + var list = from x in Funs.DB.GJSX where x.ProjectId == this.CurrUser.LoginProjectId && x.State != "1" select x; var allcount = list.Count(x => x.State == "0") + list.Count(x => x.State != "0" && x.CompleteDate < DateTime.Now); var closecount = list.Count(x => x.State == "0"); gjsxRate = String.Format("{0:N2}", 100.0 * closecount / allcount);