diff --git a/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs b/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs index 13b97970..aaa3f460 100644 --- a/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs +++ b/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs @@ -65,12 +65,12 @@ namespace FineUIPro.Web.common //安全管理人员 var allSum = from x in Funs.DB.SitePerson_Person - where x.ProjectId == ProjectId && x.IsUsed == true && x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime.Value > DateTime.Now) + where x.ProjectId == ProjectId && x.IsUsed == true && x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime.Value > DateTime.Now) select x; var glAllPerson = from x in allSum join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId - where y.IsHsse==true && x.ProjectId == ProjectId //安管人员 + where y.IsHsse == true && x.ProjectId == ProjectId //安管人员 select x; this.divSafeManagePersonNum.InnerHtml = glAllPerson.Count().ToString(); @@ -179,7 +179,7 @@ namespace FineUIPro.Web.common div_zgsj.InnerHtml = (GetGeneralClosedNum() + GetGeneralNotClosedNum()).ToString(); div_zgywc.InnerHtml = GetGeneralClosedNum().ToString(); div_zgwwc.InnerHtml = GetGeneralNotClosedNum().ToString(); - div_zgwcl.InnerHtml = String.Format("{0:N2}", 100.0 * GetGeneralClosedNum() / (GetGeneralNotClosedNum() + GetGeneralClosedNum())).Replace("NaN","0") + "%"; + div_zgwcl.InnerHtml = String.Format("{0:N2}", 100.0 * GetGeneralClosedNum() / (GetGeneralNotClosedNum() + GetGeneralClosedNum())).Replace("NaN", "0") + "%"; } /// @@ -299,7 +299,7 @@ namespace FineUIPro.Web.common } var allowExtensions = new List { - + "jpg", "jpeg", "png", "bmp", "gif", // 图片文件类型 }; @@ -318,15 +318,15 @@ namespace FineUIPro.Web.common if (File.Exists(atturl) && allowExtensions.Contains(fileType)) { - isHiddDefaultImg=true; - divProjectImg += string.Format("
", atturl.Replace(Funs.RootPath,"/")); + isHiddDefaultImg = true; + divProjectImg += string.Format("
", atturl.Replace(Funs.RootPath, "/")); //this.divProjectImgs.Src = divProjectImg; } } } - divProjectImg= divProjectImg.Replace("
", ""); + divProjectImg = divProjectImg.Replace("
", ""); /*string firtstUrl = Funs.GetStrListByStr(url, ',').FirstOrDefault(); if (!string.IsNullOrEmpty(firtstUrl)) { @@ -500,7 +500,7 @@ namespace FineUIPro.Web.common } protected int getAllCount() { - var result = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId ).ToList().Count; + var result = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId).ToList().Count; return result; } /// @@ -509,12 +509,12 @@ namespace FineUIPro.Web.common /// protected int getWrokCount0() { - var result = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId && x.LicenseTypeName == "动火作业许可证" &&x.WorkStatesStr=="作业中").ToList().Count; + var result = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId && x.LicenseTypeName == "动火作业许可证" && x.WorkStatesStr == "作业中").ToList().Count; return result; } protected int getALLWrokCount0() { - var result = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId && x.LicenseTypeName == "动火作业许可证" ).ToList().Count; + var result = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId && x.LicenseTypeName == "动火作业许可证").ToList().Count; return result; } protected int getWrokCount1() @@ -524,7 +524,7 @@ namespace FineUIPro.Web.common } protected int getALLWrokCount1() { - var result = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId && x.LicenseTypeName == "高处作业许可证" ).ToList().Count; + var result = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId && x.LicenseTypeName == "高处作业许可证").ToList().Count; return result; } @@ -548,7 +548,7 @@ namespace FineUIPro.Web.common protected int getALLWrokCount3() { var result = Funs.DB.View_License_LicenseManager.Where(x => x.ProjectId == ProjectId - && x.LicenseTypeName != "动火作业许可证" && x.LicenseTypeName != "高处作业许可证" && x.LicenseTypeName != "吊装作业许可证" ).ToList().Count; + && x.LicenseTypeName != "动火作业许可证" && x.LicenseTypeName != "高处作业许可证" && x.LicenseTypeName != "吊装作业许可证").ToList().Count; return result; } #endregion @@ -576,7 +576,7 @@ namespace FineUIPro.Web.common select x).Count(); var zgl = String.Format("{0:N2}", 100.0 * num2 / (num2 + num3)); - zlzgl = zgl.ToString().Replace("NaN", "0") ; + zlzgl = zgl.ToString().Replace("NaN", "0"); zgzglDataValue = (100 - (100.0 * num2 / (num2 + num3))).ToString(); } #endregion @@ -633,35 +633,59 @@ namespace FineUIPro.Web.common List listdata = new List(); double result = 0; Model.SGGLDB db = Funs.DB; - //一次检测合格焊口数 - int oneCheckJotNum = (from x in db.HJGL_Batch_NDEItem - join y in db.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId - join z in db.HJGL_Batch_PointBatchItem on y.PointBatchItemId equals z.PointBatchItemId - join a in db.HJGL_Batch_NDE on x.NDEID equals a.NDEID - where z.PointDate != null && z.PointState == "1" && y.RepairRecordId == null - && a.ProjectId == ProjectId - select x.NDEItemID).Count(); - //一次检测返修焊口数 - int oneCheckRepairJotNum = (from x in db.HJGL_Batch_NDEItem - join y in db.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId - join z in db.HJGL_Batch_PointBatchItem on y.PointBatchItemId equals z.PointBatchItemId - join a in db.HJGL_Batch_NDE on x.NDEID equals a.NDEID - where z.PointDate != null && z.PointState == "1" && y.RepairRecordId == null && x.CheckResult == "2" - && a.ProjectId == ProjectId - select x.NDEItemID).Count(); - if (oneCheckJotNum > 0) + var ndtLists = from x in db.HJGL_FL_NdtList where x.ProjectId == ProjectId select x; + ////一次检测合格焊口数 + //int oneCheckJotNum = (from x in db.HJGL_Batch_NDEItem + // join y in db.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId + // join z in db.HJGL_Batch_PointBatchItem on y.PointBatchItemId equals z.PointBatchItemId + // join a in db.HJGL_Batch_NDE on x.NDEID equals a.NDEID + // where z.PointDate != null && z.PointState == "1" && y.RepairRecordId == null + // && a.ProjectId == ProjectId + // select x.NDEItemID).Count(); + ////一次检测返修焊口数 + //int oneCheckRepairJotNum = (from x in db.HJGL_Batch_NDEItem + // join y in db.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId + // join z in db.HJGL_Batch_PointBatchItem on y.PointBatchItemId equals z.PointBatchItemId + // join a in db.HJGL_Batch_NDE on x.NDEID equals a.NDEID + // where z.PointDate != null && z.PointState == "1" && y.RepairRecordId == null && x.CheckResult == "2" + // && a.ProjectId == ProjectId + // select x.NDEItemID).Count(); + if (ndtLists.Count() > 0) { - var a = Convert.ToDouble(oneCheckJotNum - oneCheckRepairJotNum); - var b = Convert.ToDouble(oneCheckJotNum); - result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 0)); + decimal a = 0, b = 0; + foreach (var item in ndtLists) + { + a += Funs.GetNewDecimalOrZero(item.OneTimeFilmQualifiedAmount); + b += Funs.GetNewDecimalOrZero(item.OneTimeFilmAmount); + } + if (b > 0) + { + result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 2)); - hjallNumber = b.ToString(); - hjfinishNumber = a.ToString(); - hjzgl = result.ToString(); - hjDataValue = (100 - result).ToString(); + hjallNumber = b.ToString(); + hjfinishNumber = a.ToString(); + hjzgl = result.ToString(); + hjDataValue = (100 - result).ToString(); + } } + else + { + var data = (from x in db.HJGL_FL_Data where x.ProjectId == ProjectId orderby x.CompileDate descending select x).FirstOrDefault(); + if(data!=null) + { + decimal a = Funs.GetNewDecimalOrZero(data.OneTimeFilmQualifiedAmount); + decimal b = Funs.GetNewDecimalOrZero(data.OneTimeFilmAmount); + if (b > 0) + { + result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 2)); - + hjallNumber = b.ToString(); + hjfinishNumber = a.ToString(); + hjzgl = result.ToString(); + hjDataValue = (100 - result).ToString(); + } + } + } } #endregion @@ -682,16 +706,16 @@ namespace FineUIPro.Web.common { index++; swgclHtml += "
"; - swgclHtml += string.Format("

{0}

",index); - swgclHtml += string.Format("

{0}

",item.Name); - swgclHtml += string.Format("

{0}

",item.Unit); - swgclHtml += string.Format("

{0}

",item.DesignNum); - swgclHtml += string.Format("

{0}{1}{2}

",item.PlanNum,item.RealNum,item.Rate); - swgclHtml += string.Format("

{0}{1}{2}

",item.TotalPlanNum,item.TotalRealNum,item.TotalRate); - swgclHtml += string.Format("

{0}

",item.SumRate); + swgclHtml += string.Format("

{0}

", index); + swgclHtml += string.Format("

{0}

", item.Name); + swgclHtml += string.Format("

{0}

", item.Unit); + swgclHtml += string.Format("

{0}

", item.DesignNum); + swgclHtml += string.Format("

{0}{1}{2}

", item.PlanNum, item.RealNum, item.Rate); + swgclHtml += string.Format("

{0}{1}{2}

", item.TotalPlanNum, item.TotalRealNum, item.TotalRate); + swgclHtml += string.Format("

{0}

", item.SumRate); swgclHtml += "
"; } - + } protected string Two { @@ -963,14 +987,15 @@ namespace FineUIPro.Web.common item.DataTime.ToString().Replace('/', '-').Split(' ')[0] + ""; } } - else { + else + { returnDbHtml = "
"; } this.div_dbsxlist.InnerHtml = returnDbHtml; } - + /// /// 加载关键事项 /// @@ -1018,20 +1043,20 @@ namespace FineUIPro.Web.common List listStaticListStr = new List(); - listStaticListStr.Add(new SqlParameter("@UserID", null)); - listStaticListStr.Add(new SqlParameter("@unit", null)); - listStaticListStr.Add(new SqlParameter("@projectid", this.CurrUser.LoginProjectId)); - listStaticListStr.Add(new SqlParameter("@CNProfessional_ID", null)); - listStaticListStr.Add(new SqlParameter("@questionType", null)); - listStaticListStr.Add(new SqlParameter("@processMan", null)); listStaticListStr.Add(new SqlParameter("@User_Acceptance", null)); + listStaticListStr.Add(new SqlParameter("@UserID", null)); + listStaticListStr.Add(new SqlParameter("@unit", null)); + listStaticListStr.Add(new SqlParameter("@projectid", this.CurrUser.LoginProjectId)); + listStaticListStr.Add(new SqlParameter("@CNProfessional_ID", null)); + listStaticListStr.Add(new SqlParameter("@questionType", null)); + listStaticListStr.Add(new SqlParameter("@processMan", null)); listStaticListStr.Add(new SqlParameter("@User_Acceptance", null)); SqlParameter[] Staticparameter = listStaticListStr.ToArray(); DataTable statcitbDataTable = SQLHelper.GetDataTableRunProc("Sp_GJSXStatistic", Staticparameter); - var allcount = Funs.GetNewIntOrZero(statcitbDataTable.Rows[0]["allcount"].ToString()) ; - var closecount = Funs.GetNewIntOrZero(statcitbDataTable.Rows[0]["closecount"].ToString()); + var allcount = Funs.GetNewIntOrZero(statcitbDataTable.Rows[0]["allcount"].ToString()); + var closecount = Funs.GetNewIntOrZero(statcitbDataTable.Rows[0]["closecount"].ToString()); gjsxRate = String.Format("{0:N2}", 100.0 * closecount / allcount); - gjsxRate = gjsxRate.ToString().Replace("NaN", "0")+"%"; + gjsxRate = gjsxRate.ToString().Replace("NaN", "0") + "%"; } #endregion diff --git a/SGGL/FineUIPro.Web/common/main_new.aspx.cs b/SGGL/FineUIPro.Web/common/main_new.aspx.cs index a190d6ea..22251a95 100644 --- a/SGGL/FineUIPro.Web/common/main_new.aspx.cs +++ b/SGGL/FineUIPro.Web/common/main_new.aspx.cs @@ -565,30 +565,38 @@ namespace FineUIPro.Web.common List listdata = new List(); double result = 0; Model.SGGLDB db = Funs.DB; - //一次检测合格焊口数 - int oneCheckJotNum = (from x in db.HJGL_Batch_NDEItem - join y in db.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId - join z in db.HJGL_Batch_PointBatchItem on y.PointBatchItemId equals z.PointBatchItemId - join a in db.HJGL_Batch_NDE on x.NDEID equals a.NDEID - where z.PointDate != null && z.PointState == "1" && y.RepairRecordId == null - select x.NDEItemID).Count(); - //一次检测返修焊口数 - int oneCheckRepairJotNum = (from x in db.HJGL_Batch_NDEItem - join y in db.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId - join z in db.HJGL_Batch_PointBatchItem on y.PointBatchItemId equals z.PointBatchItemId - join a in db.HJGL_Batch_NDE on x.NDEID equals a.NDEID - where z.PointDate != null && z.PointState == "1" && y.RepairRecordId == null && x.CheckResult == "2" - select x.NDEItemID).Count(); - if (oneCheckJotNum > 0) + var ndtLists = from x in db.HJGL_FL_NdtList select x; + ////一次检测合格焊口数 + //int oneCheckJotNum = (from x in db.HJGL_Batch_NDEItem + // join y in db.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId + // join z in db.HJGL_Batch_PointBatchItem on y.PointBatchItemId equals z.PointBatchItemId + // join a in db.HJGL_Batch_NDE on x.NDEID equals a.NDEID + // where z.PointDate != null && z.PointState == "1" && y.RepairRecordId == null + // select x.NDEItemID).Count(); + ////一次检测返修焊口数 + //int oneCheckRepairJotNum = (from x in db.HJGL_Batch_NDEItem + // join y in db.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId + // join z in db.HJGL_Batch_PointBatchItem on y.PointBatchItemId equals z.PointBatchItemId + // join a in db.HJGL_Batch_NDE on x.NDEID equals a.NDEID + // where z.PointDate != null && z.PointState == "1" && y.RepairRecordId == null && x.CheckResult == "2" + // select x.NDEItemID).Count(); + if (ndtLists.Count() > 0) { - var a = Convert.ToDouble(oneCheckJotNum - oneCheckRepairJotNum); - var b = Convert.ToDouble(oneCheckJotNum); - result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 0)); + decimal a = 0, b = 0; + foreach (var item in ndtLists) + { + a += Funs.GetNewDecimalOrZero(item.OneTimeFilmQualifiedAmount); + b += Funs.GetNewDecimalOrZero(item.OneTimeFilmAmount); + } + if (b > 0) + { + result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 2)); - hjallNumber = b.ToString(); - hjfinishNumber = a.ToString(); - hjzgl = result.ToString(); - hjDataValue = (100 - result).ToString(); + hjallNumber = b.ToString(); + hjfinishNumber = a.ToString(); + hjzgl = result.ToString(); + hjDataValue = (100 - result).ToString(); + } }