20230906
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.DigData
|
||||
@@ -63,33 +64,61 @@ namespace FineUIPro.Web.DigData
|
||||
if (item == "HSSE")
|
||||
{
|
||||
this.gpHSSE.Hidden = false;
|
||||
this.lbExpertArgument.Text = (from x in Funs.DB.Solution_LargerHazardListItem
|
||||
join y in Funs.DB.Solution_LargerHazardList on x.LargerHazardListId equals y.LargerHazardListId
|
||||
where y.ProjectId == this.ProjectId
|
||||
&& y.States == Const.State_1
|
||||
|
||||
select x).Count().ToString();
|
||||
this.lbAccident.Text = (from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
where x.ProjectId == this.ProjectId
|
||||
&& x.States == Const.State_2
|
||||
|
||||
select x).Count().ToString();
|
||||
this.lbSitePersons.Text = (from x in Funs.DB.SitePerson_Person
|
||||
where x.ProjectId == this.ProjectId //&& y.States == Const.State_1
|
||||
select x).Count().ToString();
|
||||
var getPersonInOutNumber = (from x in Funs.DB.SitePerson_PersonInOutNumber
|
||||
where x.ProjectId == this.ProjectId
|
||||
select x).OrderByDescending(x => x.InOutDate).FirstOrDefault();
|
||||
if (getPersonInOutNumber != null)
|
||||
{
|
||||
this.lbWorkHours.Text = (getPersonInOutNumber.WorkHours ?? 0).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.lbWorkHours.Text = "0";
|
||||
}
|
||||
this.lbEduCount.Text = (from x in Funs.DB.EduTrain_TrainRecord
|
||||
where x.ProjectId == this.ProjectId && x.States == BLL.Const.State_2
|
||||
select x).Count().ToString();
|
||||
|
||||
var getAllHazardRegister = from x in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
where x.ProjectId == this.ProjectId && x.States != null && x.States != "4" && x.States != "0"
|
||||
select x;
|
||||
int allHazardCount = getAllHazardRegister.Count();
|
||||
int cHazardCount = getAllHazardRegister.Where(x => x.States == "3").Count();
|
||||
this.lbRectifyRate.Text = allHazardCount > 0 ? Math.Round(cHazardCount * 100.0 / (allHazardCount * 1.0)).ToString() + "%" : "0%";
|
||||
|
||||
this.lbMeetingCount.Text = (Funs.DB.Meeting_AttendMeeting.Where(x => x.ProjectId == this.ProjectId && x.States == BLL.Const.State_2).Count()
|
||||
+ Funs.DB.Meeting_ClassMeeting.Where(x => x.ProjectId == this.ProjectId && x.States == BLL.Const.State_2).Count()
|
||||
+ Funs.DB.Meeting_MonthMeeting.Where(x => x.ProjectId == this.ProjectId && x.States == BLL.Const.State_2).Count()
|
||||
+ Funs.DB.Meeting_SpecialMeeting.Where(x => x.ProjectId == this.ProjectId && x.States == BLL.Const.State_2).Count()
|
||||
+ Funs.DB.Meeting_WeekMeeting.Where(x => x.ProjectId == this.ProjectId && x.States == BLL.Const.State_2).Count()).ToString();
|
||||
|
||||
var getCostManges = Funs.DB.CostGoods_CostManage.Where(x => x.ProjectId == this.ProjectId && x.States == Const.State_2);
|
||||
if (getCostManges.Count() > 0)
|
||||
{
|
||||
this.lbHSECost.Text = getCostManges.Sum(x => x.SumMoney ?? 0).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.lbHSECost.Text = "0";
|
||||
}
|
||||
}
|
||||
if (item == "CQMS")
|
||||
{
|
||||
this.gpCQMS.Hidden = false;
|
||||
//// 实体验收 资料验收
|
||||
var getSpotCheckDetail = from x in Funs.DB.Check_SpotCheckDetail
|
||||
join y in Funs.DB.Check_SpotCheck on x.SpotCheckCode equals y.SpotCheckCode
|
||||
where y.ProjectId == this.ProjectId
|
||||
&& y.State == "8"
|
||||
select x;
|
||||
join y in Funs.DB.Check_SpotCheck on x.SpotCheckCode equals y.SpotCheckCode
|
||||
where y.ProjectId == this.ProjectId && y.State == "8"
|
||||
select x;
|
||||
int all = getSpotCheckDetail.Count();
|
||||
// this.lbSpotCheck1.Text = all.ToString();
|
||||
int onesOKCount = getSpotCheckDetail.Where(x => x.IsOnesOK == true).Count(); //一次合格
|
||||
// this.lbSpotCheck2.Text= okCount.ToString();
|
||||
// this.lbSpotCheck1.Text = all.ToString();
|
||||
int onesOKCount = getSpotCheckDetail.Where(x => x.IsOnesOK == true).Count(); //一次合格
|
||||
// this.lbSpotCheck2.Text= okCount.ToString();
|
||||
|
||||
this.lbSpotCheckRate.Text= all > 0 ? Math.Round(onesOKCount * 100.0 / (all * 1.0)).ToString()+"%" : "0%";
|
||||
this.lbSpotCheckRate.Text = all > 0 ? Math.Round(onesOKCount * 100.0 / (all * 1.0)).ToString() + "%" : "0%";
|
||||
|
||||
/// 资料验收合格项目
|
||||
var getOKSpotCheckDetail = getSpotCheckDetail.Where(x => x.IsOK == true);
|
||||
@@ -127,49 +156,25 @@ namespace FineUIPro.Web.DigData
|
||||
{
|
||||
this.gpJDGL.Hidden = false;
|
||||
|
||||
//double totalSJCost = 0; ////累计实际费用
|
||||
//decimal totalPlanCost = 0; ////计划费用
|
||||
//var getWorkPackageDetail = Funs.DB.WBS_WorkPackageDetail.FirstOrDefault(x => x.WorkPackageId == workPackageId);
|
||||
//if (getWorkPackageDetail != null)
|
||||
//{
|
||||
// ///末级节点
|
||||
// var getMaxSJCost = Funs.DB.View_WBS_WorkPackageDetail.Where(x => x.WorkPackageId == workPackageId).OrderByDescending(x => x.Months).FirstOrDefault();
|
||||
// if (getMaxSJCost != null)
|
||||
// {
|
||||
// totalSJCost = getMaxSJCost.TotalThisValue ?? 0;
|
||||
// totalPlanCost = getMaxSJCost.PlanCost ?? 0;
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// ///非末级节点
|
||||
// var getMaxSJCost = Funs.DB.View_WBS_WorkPackageParentDetail.Where(x =>x.ProjectId == this.ProjectId
|
||||
// && x.ParentId == workPackageId).OrderByDescending(x => x.Months).FirstOrDefault();
|
||||
// if (getMaxSJCost != null)
|
||||
// {
|
||||
// totalSJCost = getMaxSJCost.TotalThisValue ?? 0;
|
||||
// totalPlanCost = getMaxSJCost.PlanCost ?? 0;
|
||||
// }
|
||||
//}
|
||||
////// 根 节点 建筑工程 安装工程
|
||||
//if (workPackageId == "1" || workPackageId == "2")
|
||||
//{
|
||||
// var getUnitWorkByType = from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.ProjectId && x.ProjectType == workPackageId select x;
|
||||
// if (getUnitWorkByType.Count() > 0)
|
||||
// {
|
||||
// totalPlanCost = getUnitWorkByType.Sum(x => x.PlanCost ?? 0);
|
||||
// }
|
||||
//}
|
||||
double totalSJCost = 0; ////累计实际费用
|
||||
decimal totalPlanCost = 0; ////计划费用
|
||||
var getViewWorkPackageParentDetail = from x in Funs.DB.View_WBS_WorkPackageParentDetail
|
||||
where x.ProjectId == this.ProjectId && (x.ParentId == "1" || x.ParentId == "2")
|
||||
select x;
|
||||
if (getViewWorkPackageParentDetail.Count() > 0)
|
||||
{
|
||||
totalSJCost = getViewWorkPackageParentDetail.Sum(x => x.TotalThisValue ?? 0);
|
||||
}
|
||||
|
||||
//var getUnitWork = Funs.DB.WBS_UnitWork.FirstOrDefault(x => x.ProjectId == this.ProjectId && x.UnitWorkId == workPackageId);
|
||||
//if (getUnitWork != null)
|
||||
//{
|
||||
// totalPlanCost= getUnitWork.PlanCost ?? 0;
|
||||
//}
|
||||
var getUnitWork = from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.ProjectId select x;
|
||||
if (getUnitWork.Count() > 0)
|
||||
{
|
||||
totalPlanCost = getUnitWork.Sum(x => x.PlanCost ?? 0);
|
||||
}
|
||||
|
||||
/////项目进度完成百分比
|
||||
//decimal s = Convert.ToDecimal(totalSJCost);
|
||||
//this.lbJDRate.Text = totalPlanCost > 0 ? Math.Round(s / totalPlanCost).ToString() + "%" : "0%";
|
||||
///项目进度完成百分比
|
||||
decimal s = Convert.ToDecimal(totalSJCost);
|
||||
this.lbJDRate.Text = totalPlanCost > 0 ? Math.Round(s / totalPlanCost).ToString() + "%" : "0%";
|
||||
|
||||
}
|
||||
if (item == "HTGL")
|
||||
|
||||
Reference in New Issue
Block a user