20230904 wbs维度数据仓库实现
This commit is contained in:
@@ -87,28 +87,102 @@ namespace FineUIPro.Web.DigData
|
||||
this.lbExpertArgument.Text = (from x in Funs.DB.Solution_LargerHazardListItem
|
||||
join y in Funs.DB.Solution_LargerHazardList on x.LargerHazardListId equals y.LargerHazardListId
|
||||
where x.WorkPackageId.Contains(workPackageId) && y.States == Const.State_1
|
||||
&& (controlItemAndCycleId == null || x.WorkPackageId.Contains(controlItemAndCycleId))
|
||||
&& (controlItemAndCycleId == null || x.WorkPackageId.Contains(controlItemAndCycleId))
|
||||
select x).Count().ToString();
|
||||
|
||||
this.lbAccident.Text = (from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
where x.WorkPackageId.Contains(workPackageId)
|
||||
&& x.States == Const.State_2
|
||||
&& (controlItemAndCycleId == null || x.WorkPackageId.Contains(controlItemAndCycleId))
|
||||
select x).Count().ToString();
|
||||
}
|
||||
if (item == "CQMS")
|
||||
{
|
||||
this.gpCQMS.Hidden = false;
|
||||
var getDetail = from x in Funs.DB.Check_SpotCheckDetail
|
||||
//// 实体验收 资料验收
|
||||
var getSpotCheckDetail = from x in Funs.DB.Check_SpotCheckDetail
|
||||
join y in Funs.DB.Check_SpotCheck on x.SpotCheckCode equals y.SpotCheckCode
|
||||
where x.WorkPackageId.Contains(workPackageId) //&& y.States == Const.State_1
|
||||
where x.WorkPackageId.Contains(workPackageId) && y.State == "8"
|
||||
&& (controlItemAndCycleId == null || x.WorkPackageId.Contains(controlItemAndCycleId))
|
||||
select x;
|
||||
int all = getDetail.Count();
|
||||
this.lbSpotCheck1.Text = all.ToString();
|
||||
int all = getSpotCheckDetail.Count();
|
||||
// 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%";
|
||||
|
||||
int okCount = getDetail.Where(x => x.IsOK == true).Count();
|
||||
this.lbSpotCheck2.Text = okCount.ToString();
|
||||
/// 资料验收合格项目
|
||||
var getOKSpotCheckDetail = getSpotCheckDetail.Where(x => x.IsOK == true);
|
||||
int okYSCount = getOKSpotCheckDetail.Count(); //验收合格
|
||||
int okDateCount = getSpotCheckDetail.Where(x => x.IsDataOK == "1").Count(); //资料合格
|
||||
this.lbSpotCheckDataRate.Text = okYSCount > 0 ? Math.Round(okDateCount * 100.0 / (okYSCount * 1.0)).ToString() + "%" : "0%";
|
||||
|
||||
this.lbSpotCheck.Text = all > 0 ? Math.Round(okCount * 1.0 / (all * 1.0)).ToString() : "0";
|
||||
/////实体质量问题整改率
|
||||
//int allNoOk = all - onesOKCount; ///问题数
|
||||
//int oKCount = getSpotCheckDetail.Where(x => x.IsOK == true).Count(); //合格数
|
||||
//int zgCount = oKCount - onesOKCount; ///整改数
|
||||
//this.lbSpotCheckOkRate.Text = allNoOk > 0 ? Math.Round(zgCount * 100.0 / (allNoOk * 1.0)).ToString() + "%" : "0%";
|
||||
|
||||
//////控制点
|
||||
//var getControlItemAndCycle = from x in Funs.DB.WBS_ControlItemAndCycle
|
||||
// where x.WorkPackageId.Contains(workPackageId)
|
||||
// && (controlItemAndCycleId == null || x.WorkPackageId.Contains(controlItemAndCycleId))
|
||||
// && x.ControlPoint.Contains("A") && x.CheckNum > 0
|
||||
// select x;
|
||||
/////A级控制点总量
|
||||
//int allControlItemCount = getControlItemAndCycle.Count();
|
||||
/////已完成A级控制点数
|
||||
//var getOKSpotCheckDetailCheckNum = from x in getOKSpotCheckDetail
|
||||
// group x by x.ControlItemAndCycleId
|
||||
// into g
|
||||
// select new { g.First().ControlItemAndCycleId, num = g.Count() };
|
||||
|
||||
//var getOKControlItemAndCycle = from x in getControlItemAndCycle
|
||||
// join y in getOKSpotCheckDetailCheckNum on x.ControlItemAndCycleId equals y.ControlItemAndCycleId
|
||||
// where x.CheckNum == y.num
|
||||
// select x;
|
||||
//int okControlItemCount = getOKControlItemAndCycle.Count();
|
||||
//this.lbControlItemRate.Text = allControlItemCount > 0 ? Math.Round(okControlItemCount * 100.0 / (allControlItemCount * 1.0)).ToString() + "%" : "0%";
|
||||
}
|
||||
if (item == "JDGL")
|
||||
{
|
||||
this.gpJDGL.Hidden = false;
|
||||
//double totalSJCost = 0; ////累计实际费用
|
||||
//decimal totalPlanCost = 0; ////计划费用
|
||||
//var getWorkPackageDetail = Funs.DB.View_WBS_WorkPackageDetail.FirstOrDefault(x => x.InitWorkPackageCode == workPackageId);
|
||||
//if (getWorkPackageDetail != null)
|
||||
//{
|
||||
// ///末级节点
|
||||
// var getMaxSJCost = Funs.DB.View_WBS_WorkPackageDetail.Where(x => x.InitWorkPackageCode == 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.InitWorkPackageCode == 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.ProjectType == workPackageId select x;
|
||||
// if (getUnitWorkByType.Count() > 0)
|
||||
// {
|
||||
// totalPlanCost = getUnitWorkByType.Sum(x => x.PlanCost ?? 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