合并最新
This commit is contained in:
@@ -299,7 +299,7 @@ namespace FineUIPro.Web.JDGL.WBSPlan
|
||||
}
|
||||
else //不存在子单位工程,加载分部工程
|
||||
{
|
||||
var wbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.Flag == 1 && x.UnitProjectId == e.Node.NodeID && x.IsApprove == true && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x;
|
||||
var wbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == null && x.UnitProjectId == e.Node.NodeID && x.IsApprove == true && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x;
|
||||
if (wbsSet1s.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet1 in wbsSet1s)
|
||||
@@ -332,7 +332,7 @@ namespace FineUIPro.Web.JDGL.WBSPlan
|
||||
}
|
||||
else //单位工程下直接是分项内容,如质量行为
|
||||
{
|
||||
var wbsSet3s = from x in Funs.DB.Wbs_WbsSet where x.Flag == 3 && x.UnitProjectId == e.Node.NodeID && x.IsApprove == true && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x;
|
||||
var wbsSet3s = from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == null && x.UnitProjectId == e.Node.NodeID && x.IsApprove == true && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x;
|
||||
if (wbsSet3s.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet3 in wbsSet3s)
|
||||
@@ -368,7 +368,7 @@ namespace FineUIPro.Web.JDGL.WBSPlan
|
||||
}
|
||||
else if (e.Node.CommandName == "childUnitProject") //展开子单位工程节点
|
||||
{
|
||||
var wbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.Flag == 1 && x.UnitProjectId == e.Node.NodeID && x.IsApprove == true && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x;
|
||||
var wbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == null && x.UnitProjectId == e.Node.NodeID && x.IsApprove == true && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x;
|
||||
foreach (var wbsSet1 in wbsSet1s)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
@@ -1381,21 +1381,7 @@ namespace FineUIPro.Web.JDGL.WBSPlan
|
||||
{
|
||||
var q = from x in Funs.DB.WbsDetail
|
||||
join y in Funs.DB.Wbs_WbsSet on x.ToWbs equals y.WbsSetId
|
||||
where y.UnitProjectId == id && y.Flag == 1 && y.IsApprove == true
|
||||
group new { x.PlanValue, x.CompleteValue, x.RealValue } by new { x.Months }
|
||||
into g
|
||||
select new
|
||||
{
|
||||
Months = g.Key.Months,
|
||||
PlanValue = g.Sum(x => x.PlanValue ?? 0),
|
||||
CompleteValue = g.Sum(x => x.CompleteValue ?? 0),
|
||||
RealValue = g.Sum(x => x.RealValue ?? 0)
|
||||
};
|
||||
|
||||
// 质量行为
|
||||
var z = from x in Funs.DB.WbsDetail
|
||||
join y in Funs.DB.Wbs_WbsSet on x.ToWbs equals y.WbsSetId
|
||||
where y.UnitProjectId == id && y.Flag == 3 && y.IsApprove == true
|
||||
where y.UnitProjectId == id && y.SuperWbsSetId == null && y.IsApprove == true
|
||||
group new { x.PlanValue, x.CompleteValue, x.RealValue } by new { x.Months }
|
||||
into g
|
||||
select new
|
||||
@@ -1428,13 +1414,6 @@ namespace FineUIPro.Web.JDGL.WBSPlan
|
||||
AddWbsSetDetail(id, Convert.ToDateTime(wbsSet.Months), Convert.ToDecimal(wbsSet.PlanValue), Convert.ToDecimal(wbsSet.CompleteValue), Convert.ToDecimal(wbsSet.RealValue), 3);
|
||||
}
|
||||
}
|
||||
if (z.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet in z)
|
||||
{
|
||||
AddWbsSetDetail(id, Convert.ToDateTime(wbsSet.Months), Convert.ToDecimal(wbsSet.PlanValue), Convert.ToDecimal(wbsSet.CompleteValue), Convert.ToDecimal(wbsSet.RealValue), 3);
|
||||
}
|
||||
}
|
||||
if (c.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet in c)
|
||||
@@ -1447,7 +1426,7 @@ namespace FineUIPro.Web.JDGL.WBSPlan
|
||||
{
|
||||
var q = from x in Funs.DB.WbsDetail
|
||||
join y in Funs.DB.Wbs_WbsSet on x.ToWbs equals y.WbsSetId
|
||||
where y.UnitProjectId == id && y.Flag == 1 && y.IsApprove == true
|
||||
where y.UnitProjectId == id && y.SuperWbsSetId == null && y.IsApprove == true
|
||||
group new { x.PlanValue, x.CompleteValue, x.RealValue } by new { x.Months }
|
||||
into g
|
||||
select new
|
||||
@@ -1736,7 +1715,7 @@ namespace FineUIPro.Web.JDGL.WBSPlan
|
||||
// 分部分项
|
||||
var wbsSetList4 = from x in db.WbsDetail
|
||||
join y in db.Wbs_WbsSet on x.ToWbs equals y.WbsSetId
|
||||
where y.CnProfessionId == cnProfessionId && y.Flag == 4 && y.IsApprove == true && y.SuperWbsSetId != null
|
||||
where y.CnProfessionId == cnProfessionId && y.IsApprove == true && y.SuperWbsSetId != null
|
||||
group new { x.PlanValue, x.CompleteValue, x.RealValue } by new { y.SuperWbsSetId, x.Months }
|
||||
into g
|
||||
select new
|
||||
@@ -1756,76 +1735,11 @@ namespace FineUIPro.Web.JDGL.WBSPlan
|
||||
}
|
||||
}
|
||||
|
||||
var wbsSetList3 = from x in db.WbsDetail
|
||||
join y in db.Wbs_WbsSet on x.ToWbs equals y.WbsSetId
|
||||
where y.CnProfessionId == cnProfessionId && y.Flag == 3 && y.IsApprove == true && y.SuperWbsSetId != null
|
||||
group new { x.PlanValue, x.CompleteValue, x.RealValue } by new { y.SuperWbsSetId, x.Months }
|
||||
into g
|
||||
select new
|
||||
{
|
||||
ToWbs = g.Key.SuperWbsSetId,
|
||||
Months = g.Key.Months,
|
||||
PlanValue = g.Sum(x => x.PlanValue ?? 0),
|
||||
CompleteValue = g.Sum(x => x.CompleteValue ?? 0),
|
||||
RealValue = g.Sum(x => x.RealValue ?? 0)
|
||||
};
|
||||
if (wbsSetList3.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet in wbsSetList3)
|
||||
{
|
||||
AddWbsSetDetail(wbsSet.ToWbs, Convert.ToDateTime(wbsSet.Months), Convert.ToDecimal(wbsSet.PlanValue), Convert.ToDecimal(wbsSet.CompleteValue), Convert.ToDecimal(wbsSet.RealValue), 4);
|
||||
}
|
||||
}
|
||||
|
||||
var wbsSetList2 = from x in db.WbsDetail
|
||||
join y in db.Wbs_WbsSet on x.ToWbs equals y.WbsSetId
|
||||
where y.CnProfessionId == cnProfessionId && y.Flag == 2 && y.IsApprove == true && y.SuperWbsSetId != null
|
||||
group new { x.PlanValue, x.CompleteValue, x.RealValue } by new { y.SuperWbsSetId, x.Months }
|
||||
into g
|
||||
select new
|
||||
{
|
||||
ToWbs = g.Key.SuperWbsSetId,
|
||||
Months = g.Key.Months,
|
||||
PlanValue = g.Sum(x => x.PlanValue ?? 0),
|
||||
CompleteValue = g.Sum(x => x.CompleteValue ?? 0),
|
||||
RealValue = g.Sum(x => x.RealValue ?? 0)
|
||||
};
|
||||
if (wbsSetList2.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet in wbsSetList2)
|
||||
{
|
||||
AddWbsSetDetail(wbsSet.ToWbs, Convert.ToDateTime(wbsSet.Months), Convert.ToDecimal(wbsSet.PlanValue), Convert.ToDecimal(wbsSet.CompleteValue), Convert.ToDecimal(wbsSet.RealValue), 4);
|
||||
}
|
||||
}
|
||||
|
||||
// 单位工程及子单位工程
|
||||
//质量行为
|
||||
var wbsSetList = from x in db.WbsDetail
|
||||
join y in db.Wbs_WbsSet on x.ToWbs equals y.WbsSetId
|
||||
join z in db.Wbs_UnitProject on y.UnitProjectId equals z.UnitProjectId
|
||||
where y.CnProfessionId == cnProfessionId && y.IsApprove == true && y.Flag == 3 && y.SuperWbsSetId == null
|
||||
group new { x.PlanValue, x.CompleteValue, x.RealValue } by new { z.UnitProjectId, x.Months }
|
||||
into g
|
||||
select new
|
||||
{
|
||||
ToWbs = g.Key.UnitProjectId,
|
||||
Months = g.Key.Months,
|
||||
PlanValue = g.Sum(x => x.PlanValue ?? 0),
|
||||
CompleteValue = g.Sum(x => x.CompleteValue ?? 0),
|
||||
RealValue = g.Sum(x => x.RealValue ?? 0)
|
||||
};
|
||||
if (wbsSetList.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet in wbsSetList)
|
||||
{
|
||||
AddWbsSetDetail(wbsSet.ToWbs, Convert.ToDateTime(wbsSet.Months), Convert.ToDecimal(wbsSet.PlanValue), Convert.ToDecimal(wbsSet.CompleteValue), Convert.ToDecimal(wbsSet.RealValue), 3);
|
||||
}
|
||||
}
|
||||
// 单位工程及子单位工程
|
||||
var wbsSetList1 = from x in db.WbsDetail
|
||||
join y in db.Wbs_WbsSet on x.ToWbs equals y.WbsSetId
|
||||
join z in db.Wbs_UnitProject on y.UnitProjectId equals z.UnitProjectId
|
||||
where y.CnProfessionId == cnProfessionId && y.IsApprove == true && z.IsApprove == true && y.Flag == 1
|
||||
where y.CnProfessionId == cnProfessionId && y.IsApprove == true && z.IsApprove == true && y.SuperWbsSetId == null
|
||||
group new { x.PlanValue, x.CompleteValue, x.RealValue } by new { z.UnitProjectId, x.Months }
|
||||
into g
|
||||
select new
|
||||
@@ -1899,7 +1813,7 @@ namespace FineUIPro.Web.JDGL.WBSPlan
|
||||
// 分部分项
|
||||
var wbsSetList4 = from x in db.WbsDetail
|
||||
join y in db.Wbs_WbsSet on x.ToWbs equals y.WbsSetId
|
||||
where y.UnitProjectId == unitProjectId && y.Flag == 4 && y.IsApprove == true && y.SuperWbsSetId != null
|
||||
where y.UnitProjectId == unitProjectId && y.IsApprove == true && y.SuperWbsSetId != null
|
||||
group new { x.PlanValue, x.CompleteValue, x.RealValue } by new { y.SuperWbsSetId, x.Months }
|
||||
into g
|
||||
select new
|
||||
@@ -1918,77 +1832,11 @@ namespace FineUIPro.Web.JDGL.WBSPlan
|
||||
AddWbsSetDetail(wbsSet.ToWbs, Convert.ToDateTime(wbsSet.Months), Convert.ToDecimal(wbsSet.PlanValue), Convert.ToDecimal(wbsSet.CompleteValue), Convert.ToDecimal(wbsSet.RealValue), 4);
|
||||
}
|
||||
}
|
||||
|
||||
var wbsSetList3 = from x in db.WbsDetail
|
||||
join y in db.Wbs_WbsSet on x.ToWbs equals y.WbsSetId
|
||||
where y.UnitProjectId == unitProjectId && y.Flag == 3 && y.IsApprove == true && y.SuperWbsSetId != null
|
||||
group new { x.PlanValue, x.CompleteValue, x.RealValue } by new { y.SuperWbsSetId, x.Months }
|
||||
into g
|
||||
select new
|
||||
{
|
||||
ToWbs = g.Key.SuperWbsSetId,
|
||||
Months = g.Key.Months,
|
||||
PlanValue = g.Sum(x => x.PlanValue ?? 0),
|
||||
CompleteValue = g.Sum(x => x.CompleteValue ?? 0),
|
||||
RealValue = g.Sum(x => x.RealValue ?? 0)
|
||||
};
|
||||
if (wbsSetList3.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet in wbsSetList3)
|
||||
{
|
||||
AddWbsSetDetail(wbsSet.ToWbs, Convert.ToDateTime(wbsSet.Months), Convert.ToDecimal(wbsSet.PlanValue), Convert.ToDecimal(wbsSet.CompleteValue), Convert.ToDecimal(wbsSet.RealValue), 4);
|
||||
}
|
||||
}
|
||||
|
||||
var wbsSetList2 = from x in db.WbsDetail
|
||||
join y in db.Wbs_WbsSet on x.ToWbs equals y.WbsSetId
|
||||
where y.UnitProjectId == unitProjectId && y.Flag == 2 && y.IsApprove == true && y.SuperWbsSetId != null
|
||||
group new { x.PlanValue, x.CompleteValue, x.RealValue } by new { y.SuperWbsSetId, x.Months }
|
||||
into g
|
||||
select new
|
||||
{
|
||||
ToWbs = g.Key.SuperWbsSetId,
|
||||
Months = g.Key.Months,
|
||||
PlanValue = g.Sum(x => x.PlanValue ?? 0),
|
||||
CompleteValue = g.Sum(x => x.CompleteValue ?? 0),
|
||||
RealValue = g.Sum(x => x.RealValue ?? 0)
|
||||
};
|
||||
if (wbsSetList2.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet in wbsSetList2)
|
||||
{
|
||||
AddWbsSetDetail(wbsSet.ToWbs, Convert.ToDateTime(wbsSet.Months), Convert.ToDecimal(wbsSet.PlanValue), Convert.ToDecimal(wbsSet.CompleteValue), Convert.ToDecimal(wbsSet.RealValue), 4);
|
||||
}
|
||||
}
|
||||
|
||||
// 单位工程及子单位工程
|
||||
//质量行为
|
||||
var wbsSetList = from x in db.WbsDetail
|
||||
join y in db.Wbs_WbsSet on x.ToWbs equals y.WbsSetId
|
||||
join z in db.Wbs_UnitProject on y.UnitProjectId equals z.UnitProjectId
|
||||
where y.UnitProjectId == unitProjectId && y.IsApprove == true && y.Flag == 3 && y.SuperWbsSetId == null
|
||||
group new { x.PlanValue, x.CompleteValue, x.RealValue } by new { z.UnitProjectId, x.Months }
|
||||
into g
|
||||
select new
|
||||
{
|
||||
ToWbs = g.Key.UnitProjectId,
|
||||
Months = g.Key.Months,
|
||||
PlanValue = g.Sum(x => x.PlanValue ?? 0),
|
||||
CompleteValue = g.Sum(x => x.CompleteValue ?? 0),
|
||||
RealValue = g.Sum(x => x.RealValue ?? 0)
|
||||
};
|
||||
if (wbsSetList.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet in wbsSetList)
|
||||
{
|
||||
AddWbsSetDetail(wbsSet.ToWbs, Convert.ToDateTime(wbsSet.Months), Convert.ToDecimal(wbsSet.PlanValue), Convert.ToDecimal(wbsSet.CompleteValue), Convert.ToDecimal(wbsSet.RealValue), 3);
|
||||
}
|
||||
}
|
||||
// 单位工程及子单位工程
|
||||
var wbsSetList1 = from x in db.WbsDetail
|
||||
join y in db.Wbs_WbsSet on x.ToWbs equals y.WbsSetId
|
||||
join z in db.Wbs_UnitProject on y.UnitProjectId equals z.UnitProjectId
|
||||
where y.UnitProjectId == unitProjectId && y.IsApprove == true && z.IsApprove == true && y.Flag == 1
|
||||
where y.UnitProjectId == unitProjectId && y.IsApprove == true && z.IsApprove == true && y.SuperWbsSetId == null
|
||||
group new { x.PlanValue, x.CompleteValue, x.RealValue } by new { z.UnitProjectId, x.Months }
|
||||
into g
|
||||
select new
|
||||
@@ -2185,8 +2033,15 @@ namespace FineUIPro.Web.JDGL.WBSPlan
|
||||
}
|
||||
}
|
||||
}
|
||||
else //总图
|
||||
else
|
||||
{
|
||||
//专业
|
||||
var profession = BLL.CnProfessionService.GetCnProfessionByInstallation(installation.InstallationId);
|
||||
foreach (var pro in profession)
|
||||
{
|
||||
MergeWbsSetDetail(pro.CnProfessionId);
|
||||
}
|
||||
|
||||
//单位工程
|
||||
var unitProjects = BLL.UnitProjectService.GetUnitProjectsByInstallationId(installationId);
|
||||
foreach (var unitProject in unitProjects)
|
||||
|
||||
Reference in New Issue
Block a user