修改进度报表导出
This commit is contained in:
parent
2e4e6d7403
commit
74b11ca61a
|
@ -3141,6 +3141,10 @@ namespace BLL
|
|||
/// 分支机构人员模版文件原始的虚拟路径
|
||||
/// </summary>
|
||||
public const string BranchPersonTemplateUrl = "File\\Excel\\DataIn\\分支机构人员信息模版.xls";
|
||||
/// <summary>
|
||||
/// 施工进度报表模板文件原始虚拟路径
|
||||
/// </summary>
|
||||
public const string JDreportReportTemplateUrl = "File\\Excel\\DataIn\\施工进度报表.xlsx";
|
||||
#endregion
|
||||
|
||||
#region 绩效考核模板文件路径
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace BLL
|
|||
/// 获取模拟树表格
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetTreeDataTable(string projectId, DateTime months, string startDate, string cnProfessionId, string unitProjectCode, string wbsSetCode)
|
||||
public static DataTable GetTreeDataTable(string projectId, DateTime months, string startDate, string cnProfessionId, string unitProjectCode, string wbsSetCode, string equipmentMaterialType)
|
||||
{
|
||||
List<Model.View_WBS_CostControlDetailStatistics> CostControlDetailStatisticsList = new List<Model.View_WBS_CostControlDetailStatistics>();
|
||||
DataTable table = new DataTable();
|
||||
|
@ -36,7 +36,7 @@ namespace BLL
|
|||
table.Columns.Add(new DataColumn("TotalPlanValue", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("TotalPlanCost", typeof(String)));
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var costControls = from x in db.WBS_CostControl where x.ProjectId == projectId select x;
|
||||
var costControls = from x in db.WBS_CostControl where x.ProjectId == projectId where x.IsSelected == true select x;
|
||||
var details = from x in db.View_WBS_CostControlDetail where x.ProjectId == projectId select x;
|
||||
var parentDetails = from x in db.View_WBS_CostControlParentDetail select x;
|
||||
var wbsSets = from x in db.Wbs_WbsSet where x.ProjectId == projectId select x;
|
||||
|
@ -46,6 +46,17 @@ namespace BLL
|
|||
var cnProfessions = from x in db.WBS_CnProfession where x.ProjectId == projectId select x;
|
||||
var cnProfessionInits = from x in db.WBS_CnProfessionInit select x;
|
||||
var installations = from x in db.Project_Installation where x.ProjectId == projectId select x;
|
||||
var totalEquipmentMaterialTypes = from x in db.WBS_EquipmentMaterialType
|
||||
join y in db.WBS_EquipmentMaterialBigType
|
||||
on x.EquipmentMaterialBigTypeId equals y.EquipmentMaterialBigTypeId
|
||||
orderby x.EquipmentMaterialTypeCode
|
||||
select new
|
||||
{
|
||||
x.EquipmentMaterialTypeId,
|
||||
x.EquipmentMaterialTypeName,
|
||||
x.EquipmentMaterialBigTypeId,
|
||||
y.CnProfessionId,
|
||||
};
|
||||
CostControlDetailStatisticsList = (from x in db.View_WBS_CostControlDetailStatistics where x.ProjectId == projectId select x).Distinct().ToList();
|
||||
List<Model.View_WBS_CostControlDetailStatistics> newList = new List<Model.View_WBS_CostControlDetailStatistics>();
|
||||
var installationList = CostControlDetailStatisticsList.Where(x => x.WBSType == "Installation" && x.SupId == "0");
|
||||
|
@ -61,77 +72,312 @@ namespace BLL
|
|||
#region 全部统计
|
||||
if (cnProfessionId == BLL.Const._Null) //全部统计
|
||||
{
|
||||
foreach (Model.View_WBS_CostControlDetailStatistics item in newList)
|
||||
if (string.IsNullOrEmpty(equipmentMaterialType))
|
||||
{
|
||||
row = table.NewRow();
|
||||
row[0] = item.Id;
|
||||
row[1] = item.SupId;
|
||||
row[2] = item.Name;
|
||||
row[3] = item.ProjectId;
|
||||
Model.WBS_CostControl costControl = costControls.FirstOrDefault(x => x.CostControlId == item.Id);
|
||||
if (costControl != null)
|
||||
foreach (Model.View_WBS_CostControlDetailStatistics item in newList)
|
||||
{
|
||||
Model.View_WBS_CostControlDetail detail = details.FirstOrDefault(x => x.CostControlId == item.Id && x.Months == months);
|
||||
if (detail != null)
|
||||
row = table.NewRow();
|
||||
row[0] = item.Id;
|
||||
row[1] = item.SupId;
|
||||
row[2] = item.Name;
|
||||
row[3] = item.ProjectId;
|
||||
Model.WBS_CostControl costControl = costControls.FirstOrDefault(x => x.CostControlId == item.Id);
|
||||
if (costControl != null)
|
||||
{
|
||||
row[4] = detail.Unit;//单位
|
||||
row[5] = decimal.Round(Convert.ToDecimal(detail.TotalNum), 2);//合同工作量
|
||||
row[6] = decimal.Round(Convert.ToDecimal(detail.RealPrice), 2);//成本单价
|
||||
row[7] = decimal.Round(Convert.ToDecimal(detail.PlanNum), 2);//本月计划完成量
|
||||
row[8] = decimal.Round(Convert.ToDecimal(detail.ThisNum), 2);//本月完成量
|
||||
row[9] = decimal.Round(Convert.ToDecimal(detail.PlanPrice), 2);//控制预算单价
|
||||
row[10] = decimal.Round(Convert.ToDecimal(detail.ThisRealCost), 2);//本月实际成本
|
||||
row[11] = decimal.Round(Convert.ToDecimal(detail.ThisPlanValue), 2);//本月计划完成预算
|
||||
row[12] = decimal.Round(Convert.ToDecimal(detail.ThisPlanCost), 2);//本月完成预算
|
||||
row[13] = decimal.Round(Convert.ToDecimal(detail.TotalPlanNum), 2);//累计计划完成量
|
||||
row[14] = decimal.Round(Convert.ToDecimal(detail.TotalThisNum), 2);//累计完成量
|
||||
row[15] = decimal.Round(Convert.ToDecimal(detail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(detail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(detail.TotalPlanCost), 2);//累计完成预算
|
||||
Model.View_WBS_CostControlDetail detail = details.FirstOrDefault(x => x.CostControlId == item.Id && x.Months == months);
|
||||
if (detail != null)
|
||||
{
|
||||
row[4] = detail.Unit;//单位
|
||||
row[5] = decimal.Round(Convert.ToDecimal(detail.TotalNum), 2);//合同工作量
|
||||
row[6] = decimal.Round(Convert.ToDecimal(detail.RealPrice), 2);//成本单价
|
||||
row[7] = decimal.Round(Convert.ToDecimal(detail.PlanNum), 2);//本月计划完成量
|
||||
row[8] = decimal.Round(Convert.ToDecimal(detail.ThisNum), 2);//本月完成量
|
||||
row[9] = decimal.Round(Convert.ToDecimal(detail.PlanPrice), 2);//控制预算单价
|
||||
row[10] = decimal.Round(Convert.ToDecimal(detail.ThisRealCost), 2);//本月实际成本
|
||||
row[11] = decimal.Round(Convert.ToDecimal(detail.ThisPlanValue), 2);//本月计划完成预算
|
||||
row[12] = decimal.Round(Convert.ToDecimal(detail.ThisPlanCost), 2);//本月完成预算
|
||||
row[13] = decimal.Round(Convert.ToDecimal(detail.TotalPlanNum), 2);//累计计划完成量
|
||||
row[14] = decimal.Round(Convert.ToDecimal(detail.TotalThisNum), 2);//累计完成量
|
||||
row[15] = decimal.Round(Convert.ToDecimal(detail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(detail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(detail.TotalPlanCost), 2);//累计完成预算
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.View_WBS_CostControlDetail lastDetail = details.OrderByDescending(x => x.Months).FirstOrDefault(x => x.CostControlId == item.Id);
|
||||
if (lastDetail != null && lastDetail.Months <= months)
|
||||
{
|
||||
row[4] = lastDetail.Unit;//单位
|
||||
row[5] = decimal.Round(Convert.ToDecimal(lastDetail.TotalNum), 2);//合同工作量
|
||||
row[6] = decimal.Round(Convert.ToDecimal(lastDetail.RealPrice), 2);//成本单价
|
||||
row[7] = decimal.Round(Convert.ToDecimal(lastDetail.PlanNum), 2);//本月计划完成量
|
||||
row[8] = decimal.Round(Convert.ToDecimal(lastDetail.ThisNum), 2);//本月完成量
|
||||
row[9] = decimal.Round(Convert.ToDecimal(lastDetail.PlanPrice), 2);//控制预算单价
|
||||
row[13] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanNum), 2);//累计计划完成量
|
||||
row[14] = decimal.Round(Convert.ToDecimal(lastDetail.TotalThisNum), 2);//累计完成量
|
||||
row[15] = decimal.Round(Convert.ToDecimal(lastDetail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanCost), 2);//累计完成预算
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.View_WBS_CostControlDetail lastDetail = details.OrderByDescending(x => x.Months).FirstOrDefault(x => x.CostControlId == item.Id);
|
||||
if (lastDetail != null && lastDetail.Months <= months)
|
||||
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == item.Id && x.Months == months);
|
||||
if (parentDetail != null)
|
||||
{
|
||||
row[4] = lastDetail.Unit;//单位
|
||||
row[5] = decimal.Round(Convert.ToDecimal(lastDetail.TotalNum), 2);//合同工作量
|
||||
row[6] = decimal.Round(Convert.ToDecimal(lastDetail.RealPrice), 2);//成本单价
|
||||
row[7] = decimal.Round(Convert.ToDecimal(lastDetail.PlanNum), 2);//本月计划完成量
|
||||
row[8] = decimal.Round(Convert.ToDecimal(lastDetail.ThisNum), 2);//本月完成量
|
||||
row[9] = decimal.Round(Convert.ToDecimal(lastDetail.PlanPrice), 2);//控制预算单价
|
||||
row[13] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanNum), 2);//累计计划完成量
|
||||
row[14] = decimal.Round(Convert.ToDecimal(lastDetail.TotalThisNum), 2);//累计完成量
|
||||
row[15] = decimal.Round(Convert.ToDecimal(lastDetail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanCost), 2);//累计完成预算
|
||||
row[10] = decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);//本月实际成本
|
||||
row[11] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);//本月计划完成预算
|
||||
row[12] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);//本月完成预算
|
||||
row[15] = decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);//累计完成预算
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == item.Id);
|
||||
if (parentLastDetail != null && parentLastDetail.Months <= months)
|
||||
{
|
||||
row[15] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);//累计完成预算
|
||||
}
|
||||
}
|
||||
}
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
var equipmentMaterialTypes = totalEquipmentMaterialTypes.Where(x => x.EquipmentMaterialTypeName.Contains(equipmentMaterialType));
|
||||
var equipmentMaterialTypeList = newList.Where(x => x.EquipmentMaterialTypeName.Contains(equipmentMaterialType));
|
||||
if (equipmentMaterialTypeList.Count() > 0)
|
||||
{
|
||||
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == item.Id && x.Months == months);
|
||||
if (parentDetail != null)
|
||||
parentRow = table.NewRow();
|
||||
parentRow[0] = equipmentMaterialType;
|
||||
parentRow[1] = "0";
|
||||
parentRow[2] = equipmentMaterialType;
|
||||
parentRow[3] = projectId;
|
||||
var costControl = costControls.FirstOrDefault(x => x.CostControlId == equipmentMaterialTypeList.First().Id);
|
||||
if (costControl != null)
|
||||
{
|
||||
row[10] = decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);//本月实际成本
|
||||
row[11] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);//本月计划完成预算
|
||||
row[12] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);//本月完成预算
|
||||
row[15] = decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);//累计完成预算
|
||||
parentRow[4] = costControl.Unit;//单位
|
||||
}
|
||||
else
|
||||
var costControlList = from x in costControls
|
||||
join y in db.WBS_EquipmentMaterialType
|
||||
on x.EquipmentMaterialTypeId equals y.EquipmentMaterialTypeId
|
||||
where y.EquipmentMaterialTypeName.Contains(equipmentMaterialType)
|
||||
select x;
|
||||
var costControlIdList = costControlList.Select(x => x.CostControlId).ToList();
|
||||
List<string> ids = new List<string>();
|
||||
foreach (var costControlItem in costControlList) //获取所有关联费控清单的父级节点Id
|
||||
{
|
||||
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == item.Id);
|
||||
if (parentLastDetail != null && parentLastDetail.Months <= months)
|
||||
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(costControlItem.WbsSetId);
|
||||
GetAllWbsIds(ids, costControlItem.WbsSetId);
|
||||
ids.Add(wbsSet.UnitProjectId);
|
||||
ids.Add(wbsSet.CnProfessionId);
|
||||
GetAllInsIds(ids, wbsSet.InstallationId);
|
||||
}
|
||||
ids.AddRange(costControlIdList);
|
||||
var parDetails = details.Where(x => costControlIdList.Contains(x.CostControlId) && x.Months == months);
|
||||
parentRow[5] = decimal.Round(costControlList.Sum(x => Convert.ToDecimal(x.TotalNum ?? 0)), 2);//合同工作量
|
||||
//parentRow[6] = decimal.Round(Convert.ToDecimal(detail.RealPrice), 2);//成本单价
|
||||
parentRow[7] = decimal.Round(parDetails.Sum(x => Convert.ToDecimal(x.PlanNum ?? 0)), 2);//本月计划完成量
|
||||
parentRow[8] = decimal.Round(parDetails.Sum(x => Convert.ToDecimal(x.ThisNum ?? 0)), 2);//本月完成量
|
||||
//parentRow[9] = decimal.Round(Convert.ToDecimal(detail.PlanPrice), 2);//控制预算单价
|
||||
parentRow[10] = decimal.Round(parDetails.Sum(x => Convert.ToDecimal(x.ThisRealCost ?? 0)), 2);//本月实际成本
|
||||
parentRow[11] = decimal.Round(parDetails.Sum(x => Convert.ToDecimal(x.ThisPlanValue ?? 0)), 2);//本月计划完成预算
|
||||
parentRow[12] = decimal.Round(parDetails.Sum(x => Convert.ToDecimal(x.ThisPlanCost ?? 0)), 2);//本月完成预算
|
||||
parentRow[13] = decimal.Round(parDetails.Sum(x => Convert.ToDecimal(x.TotalPlanNum ?? 0)), 2);//累计计划完成量
|
||||
parentRow[14] = decimal.Round(parDetails.Sum(x => Convert.ToDecimal(x.TotalThisNum ?? 0)), 2);//累计完成量
|
||||
parentRow[15] = decimal.Round(parDetails.Sum(x => Convert.ToDecimal(x.TotalRealCost ?? 0)), 2);//累计完成成本
|
||||
parentRow[16] = decimal.Round(parDetails.Sum(x => Convert.ToDecimal(x.TotalPlanValue ?? 0)), 2);//累计计划完成预算
|
||||
parentRow[17] = decimal.Round(parDetails.Sum(x => Convert.ToDecimal(x.TotalPlanCost ?? 0)), 2);//累计完成预算
|
||||
table.Rows.Add(parentRow);
|
||||
foreach (Model.View_WBS_CostControlDetailStatistics item in newList)
|
||||
{
|
||||
if (ids.Contains(item.Id))
|
||||
{
|
||||
row[15] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);//累计完成预算
|
||||
row = table.NewRow();
|
||||
row[0] = item.Id;
|
||||
row[2] = item.Name;
|
||||
row[3] = item.ProjectId;
|
||||
if (item.WBSType == "Installation")
|
||||
{
|
||||
decimal ind10 = 0, ind11 = 0, ind12 = 0, ind15 = 0, ind16 = 0, ind17 = 0;
|
||||
if (item.SupId == "0")
|
||||
{
|
||||
row[1] = equipmentMaterialType;
|
||||
}
|
||||
else
|
||||
{
|
||||
row[1] = item.SupId;
|
||||
}
|
||||
List<string> cnIds = BLL.CnProfessionService.GetCnProfessionIdsByInstallationIdAndOldId(item.Id, cnProfessionId);
|
||||
foreach (var cnId in cnIds)
|
||||
{
|
||||
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == cnId && x.Months == months);
|
||||
if (parentDetail != null)
|
||||
{
|
||||
ind10 += decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);
|
||||
ind11 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);
|
||||
ind12 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);
|
||||
ind15 += decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);
|
||||
ind16 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);
|
||||
ind17 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == cnId);
|
||||
if (parentLastDetail != null && parentLastDetail.Months <= months)
|
||||
{
|
||||
ind15 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);
|
||||
ind16 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);
|
||||
ind17 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ind10 != 0)
|
||||
{
|
||||
row[10] = decimal.Round(ind10, 2);//本月实际成本
|
||||
row[11] = decimal.Round(ind11, 2);//本月计划完成预算
|
||||
row[12] = decimal.Round(ind12, 2);//本月完成预算
|
||||
row[15] = decimal.Round(ind15, 2);//累计完成成本
|
||||
row[16] = decimal.Round(ind16, 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(ind17, 2);//累计完成预算
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ind15 > 0)
|
||||
{
|
||||
row[15] = decimal.Round(ind15, 2);//累计完成成本
|
||||
}
|
||||
if (ind16 > 0)
|
||||
{
|
||||
row[16] = decimal.Round(ind16, 2);//累计计划完成预算
|
||||
}
|
||||
if (ind17 > 0)
|
||||
{
|
||||
row[17] = decimal.Round(ind17, 2);//累计完成预算
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (item.WBSType == "CnProfession")
|
||||
{
|
||||
row[1] = item.SupId;
|
||||
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == item.Id && x.Months == months);
|
||||
if (parentDetail != null)
|
||||
{
|
||||
row[10] = decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);//本月实际成本
|
||||
row[11] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);//本月计划完成预算
|
||||
row[12] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);//本月完成预算
|
||||
row[15] = decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);//累计完成预算
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == item.Id);
|
||||
if (parentLastDetail != null && parentLastDetail.Months <= months)
|
||||
{
|
||||
row[15] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);//累计完成预算
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (item.WBSType == "UnitProject")
|
||||
{
|
||||
row[1] = item.SupId;
|
||||
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == item.Id && x.Months == months);
|
||||
if (parentDetail != null)
|
||||
{
|
||||
row[10] = decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);//本月实际成本
|
||||
row[11] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);//本月计划完成预算
|
||||
row[12] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);//本月完成预算
|
||||
row[15] = decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);//累计完成预算
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == item.Id);
|
||||
if (parentLastDetail != null && parentLastDetail.Months <= months)
|
||||
{
|
||||
row[15] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);//累计完成预算
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (item.WBSType == "WbsSet")
|
||||
{
|
||||
row[1] = item.SupId;
|
||||
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == item.Id && x.Months == months);
|
||||
if (parentDetail != null)
|
||||
{
|
||||
row[10] = decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);//本月实际成本
|
||||
row[11] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);//本月计划完成预算
|
||||
row[12] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);//本月完成预算
|
||||
row[15] = decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);//累计完成预算
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == item.Id);
|
||||
if (parentLastDetail != null && parentLastDetail.Months <= months)
|
||||
{
|
||||
row[15] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);//累计完成预算
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (item.WBSType == "CostControl")
|
||||
{
|
||||
row[1] = item.SupId;
|
||||
Model.View_WBS_CostControlDetail detail = details.FirstOrDefault(x => x.CostControlId == item.Id && x.Months == months);
|
||||
if (detail != null)
|
||||
{
|
||||
row[4] = detail.Unit;//单位
|
||||
row[5] = decimal.Round(Convert.ToDecimal(detail.TotalNum), 2);//合同工作量
|
||||
row[6] = decimal.Round(Convert.ToDecimal(detail.RealPrice), 2);//成本单价
|
||||
row[7] = decimal.Round(Convert.ToDecimal(detail.PlanNum), 2);//本月计划完成量
|
||||
row[8] = decimal.Round(Convert.ToDecimal(detail.ThisNum), 2);//本月完成量
|
||||
row[9] = decimal.Round(Convert.ToDecimal(detail.PlanPrice), 2);//控制预算单价
|
||||
row[10] = decimal.Round(Convert.ToDecimal(detail.ThisRealCost), 2);//本月实际成本
|
||||
row[11] = decimal.Round(Convert.ToDecimal(detail.ThisPlanValue), 2);//本月计划完成预算
|
||||
row[12] = decimal.Round(Convert.ToDecimal(detail.ThisPlanCost), 2);//本月完成预算
|
||||
row[13] = decimal.Round(Convert.ToDecimal(detail.TotalPlanNum), 2);//累计计划完成量
|
||||
row[14] = decimal.Round(Convert.ToDecimal(detail.TotalThisNum), 2);//累计完成量
|
||||
row[15] = decimal.Round(Convert.ToDecimal(detail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(detail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(detail.TotalPlanCost), 2);//累计完成预算
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.View_WBS_CostControlDetail lastDetail = details.OrderByDescending(x => x.Months).FirstOrDefault(x => x.CostControlId == item.Id);
|
||||
if (lastDetail != null && lastDetail.Months <= months)
|
||||
{
|
||||
row[4] = lastDetail.Unit;//单位
|
||||
row[5] = decimal.Round(Convert.ToDecimal(lastDetail.TotalNum), 2);//合同工作量
|
||||
row[6] = decimal.Round(Convert.ToDecimal(lastDetail.RealPrice), 2);//成本单价
|
||||
row[7] = decimal.Round(Convert.ToDecimal(lastDetail.PlanNum), 2);//本月计划完成量
|
||||
row[8] = decimal.Round(Convert.ToDecimal(lastDetail.ThisNum), 2);//本月完成量
|
||||
row[9] = decimal.Round(Convert.ToDecimal(lastDetail.PlanPrice), 2);//控制预算单价
|
||||
row[13] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanNum), 2);//累计计划完成量
|
||||
row[14] = decimal.Round(Convert.ToDecimal(lastDetail.TotalThisNum), 2);//累计完成量
|
||||
row[15] = decimal.Round(Convert.ToDecimal(lastDetail.TotalRealCost), 2);//累计完成成本
|
||||
row[16] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanValue), 2);//累计计划完成预算
|
||||
row[17] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanCost), 2);//累计完成预算
|
||||
}
|
||||
}
|
||||
}
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
@ -2535,6 +2781,26 @@ namespace BLL
|
|||
return table;
|
||||
}
|
||||
|
||||
private static void GetAllWbsIds(List<string> list, string wbsSetId)
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(wbsSetId);
|
||||
if (wbsSet != null)
|
||||
{
|
||||
list.Add(wbsSetId);
|
||||
GetAllWbsIds(list,wbsSet.SuperWbsSetId);
|
||||
}
|
||||
}
|
||||
|
||||
private static void GetAllInsIds(List<string> list, string installationId)
|
||||
{
|
||||
Model.Project_Installation installation = BLL.Project_InstallationService.GetInstallationByInstallationId(installationId);
|
||||
if (installation != null)
|
||||
{
|
||||
list.Add(installationId);
|
||||
GetAllInsIds(list, installation.SuperInstallationId);
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddDetail(List<Model.View_WBS_CostControlDetailStatistics> newList, List<Model.View_WBS_CostControlDetailStatistics> oldList, string id)
|
||||
{
|
||||
var items = oldList.Where(x => x.SupId == id).OrderBy(x => x.Code);
|
||||
|
@ -2626,7 +2892,7 @@ namespace BLL
|
|||
var cnProfessionInits = getCnProfessionInits;
|
||||
var installations = getInstallations.Where(x => x.ProjectId == projectId);
|
||||
|
||||
CostControlDetailStatisticsList = getCostControlDetailStatisticss.Where(x=> x.ProjectId == projectId).Distinct().ToList();
|
||||
CostControlDetailStatisticsList = getCostControlDetailStatisticss.Where(x => x.ProjectId == projectId).Distinct().ToList();
|
||||
List<Model.View_WBS_CostControlDetailStatistics> newList = new List<Model.View_WBS_CostControlDetailStatistics>();
|
||||
var installationList = CostControlDetailStatisticsList.Where(x => x.WBSType == "Installation" && x.SupId == "0");
|
||||
foreach (var item in installationList)
|
||||
|
@ -2710,7 +2976,7 @@ namespace BLL
|
|||
// }
|
||||
// }
|
||||
//}
|
||||
row[14 + (months.Count-1) * 2] = item.Id;
|
||||
row[14 + (months.Count - 1) * 2] = item.Id;
|
||||
//row[10] = decimal.Round(Convert.ToDecimal(detail.ThisRealCost), 2);//本月实际成本
|
||||
//row[11] = decimal.Round(Convert.ToDecimal(detail.ThisPlanValue), 2);//本月计划完成预算
|
||||
//row[12] = decimal.Round(Convert.ToDecimal(detail.ThisPlanCost), 2);//本月完成预算
|
||||
|
|
Binary file not shown.
|
@ -28,7 +28,7 @@
|
|||
<f:Button ID="btnSearch" Text="查询" MarginLeft="40px" EnablePostBack="true" runat="server" Icon="SystemSearch"
|
||||
OnClick="btnSearch_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" Text="导出" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
<f:Button ID="btnOut" OnClick="btnOutExcel_Click" Text="导出" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -36,11 +36,7 @@
|
|||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpUnitProject" OnSelectedIndexChanged="drpUnitProject_SelectedIndexChanged" AutoPostBack="true" runat="server" Label="分部工程" LabelAlign="Right" EnableEdit="true">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpWbsSet" runat="server" Label="工作包" LabelAlign="Right" EnableEdit="true">
|
||||
</f:DropDownList>
|
||||
<f:Button ID="btnSearch" Text="查询" MarginLeft="40px" EnablePostBack="true" runat="server"
|
||||
OnClick="btnSearch_Click">
|
||||
</f:Button>
|
||||
|
||||
<f:Button ID="btnSend" Text="推送数据" EnablePostBack="true" runat="server" Hidden="true"
|
||||
OnClick="btnSend_Click">
|
||||
</f:Button>
|
||||
|
@ -50,6 +46,17 @@
|
|||
<f:Button ID="btnCheck" Text="查询数据" EnablePostBack="true" runat="server" Hidden="true"
|
||||
OnClick="btnCheck_Click">
|
||||
</f:Button>
|
||||
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpWbsSet" runat="server" Label="工作包" LabelAlign="Right" EnableEdit="true">
|
||||
</f:DropDownList>
|
||||
<f:TextBox runat="server" ID="txtEquipmentMaterialType" Label="设备材料分类" LabelAlign="Right" LabelWidth="120px"></f:TextBox>
|
||||
<f:Button ID="btnSearch" Text="查询" MarginLeft="40px" EnablePostBack="true" runat="server"
|
||||
OnClick="btnSearch_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
|
@ -59,7 +66,7 @@
|
|||
<Columns>
|
||||
<f:RowNumberField />
|
||||
<f:BoundField Width="350px" ColumnID="Name" ExpandUnusedSpace="true" DataField="Name" HeaderTextAlign="Center"
|
||||
HeaderText="施工工作包" />
|
||||
HeaderText="" />
|
||||
<f:BoundField Width="100px" DataField="Unit" HeaderText="单位" TextAlign="Center" />
|
||||
<f:RenderField Width="100px" ColumnID="TotalNum" DataField="TotalNum" FieldType="Double"
|
||||
HeaderText="合同工作量" HeaderTextAlign="Center" TextAlign="Center">
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
|||
DateTime months = Convert.ToDateTime(this.txtMonths.Text.Trim());
|
||||
//if (this.rblStatisticsType.SelectedValue == "1")
|
||||
//{
|
||||
DataTable table = BLL.WorkloadStatisticsService.GetTreeDataTable(this.CurrUser.LoginProjectId, months, BLL.Const._Null, this.drpCnProfession.SelectedValue, this.drpUnitProject.SelectedValue, this.drpWbsSet.SelectedValue);
|
||||
DataTable table = BLL.WorkloadStatisticsService.GetTreeDataTable(this.CurrUser.LoginProjectId, months, BLL.Const._Null, this.drpCnProfession.SelectedValue, this.drpUnitProject.SelectedValue, this.drpWbsSet.SelectedValue, this.txtEquipmentMaterialType.Text.Trim());
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
//}
|
||||
|
@ -142,7 +142,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
|||
ppsId = 3,
|
||||
ppsName = "施工",
|
||||
performanceDate = this.txtMonths.Text.Trim() + "-25",
|
||||
pv = Math.Round((thisDetail.ThisPlanValue??0) / baseMoney,4),
|
||||
pv = Math.Round((thisDetail.ThisPlanValue ?? 0) / baseMoney, 4),
|
||||
ev = Math.Round((thisDetail.ThisPlanCost ?? 0) / baseMoney, 4),
|
||||
ac = Math.Round((thisDetail.ThisRealCost ?? 0) / baseMoney, 4),
|
||||
totalPv = Math.Round((thisDetail.TotalPlanValue ?? 0) / baseMoney, 4),
|
||||
|
@ -298,7 +298,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
|||
Response.Write(GetGridTableHtml2(Grid1));
|
||||
Response.End();
|
||||
DateTime months = Convert.ToDateTime(this.txtMonths.Text.Trim());
|
||||
DataTable table = BLL.WorkloadStatisticsService.GetTreeDataTable(this.CurrUser.LoginProjectId, months, BLL.Const._Null, this.drpCnProfession.SelectedValue, this.drpUnitProject.SelectedValue, this.drpWbsSet.SelectedValue);
|
||||
DataTable table = BLL.WorkloadStatisticsService.GetTreeDataTable(this.CurrUser.LoginProjectId, months, BLL.Const._Null, this.drpCnProfession.SelectedValue, this.drpUnitProject.SelectedValue, this.drpWbsSet.SelectedValue, this.txtEquipmentMaterialType.Text.Trim());
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
|
|
@ -75,24 +75,6 @@ namespace FineUIPro.Web.JDGL.WBS {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpUnitProject;
|
||||
|
||||
/// <summary>
|
||||
/// drpWbsSet 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpWbsSet;
|
||||
|
||||
/// <summary>
|
||||
/// btnSearch 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSearch;
|
||||
|
||||
/// <summary>
|
||||
/// btnSend 控件。
|
||||
/// </summary>
|
||||
|
@ -120,6 +102,42 @@ namespace FineUIPro.Web.JDGL.WBS {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnCheck;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// drpWbsSet 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpWbsSet;
|
||||
|
||||
/// <summary>
|
||||
/// txtEquipmentMaterialType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtEquipmentMaterialType;
|
||||
|
||||
/// <summary>
|
||||
/// btnSearch 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSearch;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue