This commit is contained in:
2025-05-16 17:54:16 +08:00
parent 1d2aee2c7c
commit 1773ec1dde
24 changed files with 1025 additions and 475 deletions
+59 -34
View File
@@ -1,6 +1,7 @@
using BLL;
using FineUIPro.Web.BaseInfo;
using FineUIPro.Web.DataShow;
using FineUIPro.Web.OfficeCheck.Check;
using FineUIPro.Web.SysManage;
using Model;
using Newtonsoft.Json;
@@ -30,7 +31,7 @@ namespace FineUIPro.Web.common
protected string completed = string.Empty;
protected string qualified = string.Empty;
protected string Cumulative_actual_value = string.Empty;
//实际值
@@ -202,7 +203,8 @@ namespace FineUIPro.Web.common
//int wHours = db.SitePerson_PersonInOutNumber.Where(x => x.ProjectId == ProjectId).Max(x => x.WorkHours) ?? 0;
int wHours = 0;
DateTime? sDate = Funs.GetNewDateTime(DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString());
wHours = (from x in db.T_d_EmployInOutRecord where x.ProjectId == ProjectId select x.ManHours ?? 0).ToList().Sum();
//wHours = (from x in db.T_d_EmployInOutRecord where x.ProjectId == ProjectId select x.ManHours ?? 0).ToList().Sum();
wHours = (from x in db.SitePerson_PersonInOutNumber where x.ProjectId == ProjectId orderby x.InOutDate descending select x.WorkHours ?? 0).ToList().FirstOrDefault();
this.divSafeWorkTime.InnerHtml = wHours.ToString();
//本月安全人工时
@@ -215,19 +217,20 @@ namespace FineUIPro.Web.common
this.divSafeWorkTimeMonth.InnerHtml = wHoursMonth.ToString();
//安全培训累计人员
var getTrainRecord = db.EduTrain_TrainRecord.Where(x => x.ProjectId == ProjectId).Sum(x => x.TrainPersonNum) ?? 0;
//var getTrainRecord = db.EduTrain_TrainRecord.Where(x => x.ProjectId == ProjectId).Sum(x => x.TrainPersonNum) ?? 0;
var getTrainRecord = db.View_EduTrain_TrainFind.Where(x => x.ProjectId == ProjectId).Count();
//修改:增加博晟教育中的人数
var boShengCount = db.Bo_Sheng_TrainPerson.Count(x => x.ProjectId == ProjectId && (x.DeleteTag == "False" || x.DeleteTag == null));
this.divSafePersonNum.InnerHtml = (getTrainRecord + boShengCount).ToString();
//安全管理人员
var allSum = from x in Funs.DB.SitePerson_Person
var allSum = from x in db.SitePerson_Person
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
join y in db.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where y.IsHsse == true && x.ProjectId == ProjectId //安管人员
select x;
this.divSafeManagePersonNum.InnerHtml = glAllPerson.Count().ToString();
@@ -260,9 +263,29 @@ namespace FineUIPro.Web.common
var getallin = from x in Funs.DB.T_d_EmployInOutRecord
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
//where x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == DateTime.Now.Date
where x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == Convert.ToDateTime("2023-08-28")
select new { x.IDCardNo, z.PostType };
//var getallin = (from x in Funs.DB.SitePerson_Checking
// join z in Funs.DB.SitePerson_Person on x.PersonId equals z.PersonId into zGroup
// from z in zGroup.DefaultIfEmpty()
// //join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId into yGroup
// //from y in yGroup.DefaultIfEmpty()
// join w in Funs.DB.Base_WorkPost on z.WorkPostId equals w.WorkPostId into wGroup
// from w in wGroup.DefaultIfEmpty()
// where x.ProjectId == this.CurrUser.LoginProjectId && x.IntoOut == "1" && x.IntoOutTime >= DateTime.Now.Date
// select new { x.PersonId, w.PostType }).Union
// (from x in Funs.DB.SitePerson_PersonInOut
// join z in Funs.DB.SitePerson_Person on x.PersonId equals z.PersonId into zGroup
// from z in zGroup.DefaultIfEmpty()
// //join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId into yGroup
// //from y in yGroup.DefaultIfEmpty()
// join w in Funs.DB.Base_WorkPost on z.WorkPostId equals w.WorkPostId into wGroup
// from w in wGroup.DefaultIfEmpty()
// where x.ProjectId == this.CurrUser.LoginProjectId && x.IsIn == true && x.ChangeTime >= DateTime.Now.Date
// select new { x.PersonId, w.PostType });
AllCount = getallin.Count();
if (AllCount > 0)
{
@@ -505,7 +528,8 @@ namespace FineUIPro.Web.common
int allCount = 0;
var getPersonQualitys = from x in Funs.DB.QualityAudit_PersonQuality
join y in Funs.DB.SitePerson_Person on x.PersonId equals y.PersonId
where x.LimitDate.HasValue && x.LimitDate < DateTime.Now && y.ProjectId == ProjectId && y.OutTime == null
join z in Funs.DB.Base_WorkPost on y.WorkPostId equals z.WorkPostId
where x.LimitDate.HasValue && x.LimitDate < DateTime.Now && y.ProjectId == ProjectId && y.OutTime == null && z.PostType == Const.PostType_2
select x;
//// 预警人数
allCount = getPersonQualitys.Count();
@@ -864,19 +888,19 @@ namespace FineUIPro.Web.common
select x).Count().ToString();
var num2 = (from x in db.ProcessControl_InspectionManagement
where x.IsOnceQualified == true && x.ProjectId == ProjectId
where (x.IsOnceQualified == null || x.IsOnceQualified == true) && x.ProjectId == ProjectId
select x).Count();
zlgjfinishNumber = num2.ToString();
var num3 = (from x in db.ProcessControl_InspectionManagement
where (x.IsOnceQualified == false || x.IsOnceQualified == null) && x.ProjectId == ProjectId
select x).Count();
var allnum = (from x in db.ProcessControl_InspectionManagement
where x.ProjectId == ProjectId
select x).Count();
var zgl = "0";
if (num2 != 0)
{
zgl = String.Format("{0:N2}", 100.0 * num2 / (num2 + num3));
zgl = String.Format("{0:N2}", 100.0 * num2 / allnum);
zlgjzgl = zgl.ToString();
zggjzglDataValue = (100 - (100.0 * num2 / (num2 + num3))).ToString();
zggjzglDataValue = (100 - (100.0 * num2 / allnum)).ToString();
}
else
{
@@ -945,8 +969,8 @@ namespace FineUIPro.Web.common
decimal a = 0, b = 0;
if (ndtList.Count > 0)
{
//取每个单位最新的一条数据
var datalist = ndtList.GroupBy(r => r.UnitId).Select(g => g.OrderByDescending(r => r.CreateDate).First()).ToList();
//取每个单位、专业最新的一条数据
var datalist = ndtList.GroupBy(r => new { r.UnitId, r.ProfessionalName }).Select(g => g.OrderByDescending(r => r.CreateDate).First()).ToList();
foreach (var item in datalist)
{
if (item.TotalQuantity.HasValue)
@@ -957,23 +981,23 @@ namespace FineUIPro.Web.common
}
result = Convert.ToDouble(Convert.ToDecimal(100.0) * b / a);
}
else
{
var hjglData =
(from x in db.HJGL_FL_Data
where x.ProjectId == ProjectId
orderby x.CompileDate descending
select x).FirstOrDefault();
if (hjglData != null)
{
a = Funs.GetNewDecimalOrZero(hjglData.OneTimeFilmQualifiedAmount);
b = Funs.GetNewDecimalOrZero(hjglData.OneTimeFilmAmount);
if (a > 0 && b > 0)
{
result = Convert.ToDouble(Convert.ToDecimal(100.0) * b / a);
}
}
}
//else
//{
// var hjglData =
// (from x in db.HJGL_FL_Data
// where x.ProjectId == ProjectId
// orderby x.CompileDate descending
// select x).FirstOrDefault();
// if (hjglData != null)
// {
// a = Funs.GetNewDecimalOrZero(hjglData.OneTimeFilmQualifiedAmount);
// b = Funs.GetNewDecimalOrZero(hjglData.OneTimeFilmAmount);
// if (a > 0 && b > 0)
// {
// result = Convert.ToDouble(Convert.ToDecimal(100.0) * b / a);
// }
// }
//}
if (b > 0)
@@ -1655,7 +1679,8 @@ 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 allcount = list.Count(x => x.State == "0") + list.Count(x => x.State != "0" && x.CompleteDate < DateTime.Now);
//var allcount = list.Count(x => x.State == "0") + list.Count(x => x.State != "0" && x.CompleteDate < DateTime.Now);
var allcount = list.Count();
var closecount = list.Count(x => x.State == "0");
gjsxRate = String.Format("{0:N2}", 100.0 * closecount / allcount);
gjsxRate = gjsxRate.ToString().Replace("NaN", "0") + "%";
@@ -1744,7 +1769,7 @@ where qc.QuantityCompletionId=(select top 1 QuantityCompletionId from[JDGL_Quant
}
//设备材料
var SbclList = Funs.DB.CLGL_ContractListSum.Where(x => x.C1 == "管道" && x.ProjectId == pid);
var SbclList = Funs.DB.CLGL_ContractListSum.Where(x => x.C1 == "设备" && x.ProjectId == pid);
foreach (var item in SbclList)
{
sbclHtml += "<div class=\"row\">";