From 74b11ca61a5e31fa06415a5b56fe6099384ed002 Mon Sep 17 00:00:00 2001 From: gaofei <181547018@qq.com> Date: Fri, 30 Jun 2023 09:01:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9B=E5=BA=A6=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/BLL/Common/Const.cs | 4 + .../BLL/JDGL/WBS/WorkloadStatisticsService.cs | 380 +++- .../File/Excel/DataIn/施工进度报表.xlsx | Bin 0 -> 14253 bytes .../JDGL/CostAnalysis/JDReport.aspx | 2 +- .../JDGL/CostAnalysis/JDReport.aspx.cs | 1668 ++++++++++++++++- .../JDGL/WBS/WorkloadStatistics.aspx | 19 +- .../JDGL/WBS/WorkloadStatistics.aspx.cs | 6 +- .../WBS/WorkloadStatistics.aspx.designer.cs | 54 +- 8 files changed, 2044 insertions(+), 89 deletions(-) create mode 100644 SGGL/FineUIPro.Web/File/Excel/DataIn/施工进度报表.xlsx diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index e3a2ef11..ad16f081 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -3141,6 +3141,10 @@ namespace BLL /// 分支机构人员模版文件原始的虚拟路径 /// public const string BranchPersonTemplateUrl = "File\\Excel\\DataIn\\分支机构人员信息模版.xls"; + /// + /// 施工进度报表模板文件原始虚拟路径 + /// + public const string JDreportReportTemplateUrl = "File\\Excel\\DataIn\\施工进度报表.xlsx"; #endregion #region 绩效考核模板文件路径 diff --git a/SGGL/BLL/JDGL/WBS/WorkloadStatisticsService.cs b/SGGL/BLL/JDGL/WBS/WorkloadStatisticsService.cs index 1c46c45c..640adfea 100644 --- a/SGGL/BLL/JDGL/WBS/WorkloadStatisticsService.cs +++ b/SGGL/BLL/JDGL/WBS/WorkloadStatisticsService.cs @@ -13,7 +13,7 @@ namespace BLL /// 获取模拟树表格 /// /// - 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 CostControlDetailStatisticsList = new List(); 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 newList = new List(); 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 ids = new List(); + 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 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 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 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 newList, List 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 newList = new List(); 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);//本月完成预算 diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/施工进度报表.xlsx b/SGGL/FineUIPro.Web/File/Excel/DataIn/施工进度报表.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..7f6b26be0268aaf6b38582192df31c8618403b87 GIT binary patch literal 14253 zcmeIZWmH|+5-p6oyL)hVcL?t8?ry=|gIj>$t|7rCxCi&(?jGD9Bz-&G+`c`&@ArFa zjKewOP_t_7x$CT|y{eX+BrpgRz{?1cS>u0s|IdJY{$ONlDCb~n=SU~_EQa#@1;kIW z8)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J493 zevKETAJyNH|IFR%?BfOhYwlnE5&vJg$gc^#1e#yJ%hw%}zZL4dx|F}FdadR4^U`lE zNzb1DOvrydJ-ycOx_{*BYWyW!mPk%d3&>8~xmF1-J?2#EF<*zYp@ zYXz?#cz!GRM*dU5Up@HWCjHW*_-nj4g3@#OFm literal 0 HcmV?d00001 diff --git a/SGGL/FineUIPro.Web/JDGL/CostAnalysis/JDReport.aspx b/SGGL/FineUIPro.Web/JDGL/CostAnalysis/JDReport.aspx index 852ef3b9..d61b4784 100644 --- a/SGGL/FineUIPro.Web/JDGL/CostAnalysis/JDReport.aspx +++ b/SGGL/FineUIPro.Web/JDGL/CostAnalysis/JDReport.aspx @@ -28,7 +28,7 @@ - diff --git a/SGGL/FineUIPro.Web/JDGL/CostAnalysis/JDReport.aspx.cs b/SGGL/FineUIPro.Web/JDGL/CostAnalysis/JDReport.aspx.cs index ec6db98e..1bc3a02f 100644 --- a/SGGL/FineUIPro.Web/JDGL/CostAnalysis/JDReport.aspx.cs +++ b/SGGL/FineUIPro.Web/JDGL/CostAnalysis/JDReport.aspx.cs @@ -10,6 +10,10 @@ using Aspose.Words.Drawing; using Aspose.Words.Drawing.Charts; using Aspose.Words.Tables; using BLL; +using NPOI.HSSF.UserModel; +using NPOI.SS.UserModel; +using NPOI.SS.Util; +using NPOI.XSSF.UserModel; using AspNet = System.Web.UI.WebControls; namespace FineUIPro.Web.JDGL.CostAnalysis @@ -792,7 +796,7 @@ namespace FineUIPro.Web.JDGL.CostAnalysis //项目总体施工进度情况 builder.MoveToBookmark("Form2"); builder.StartTable(); - builder.CellFormat.Borders.LineStyle = LineStyle.Single; + builder.CellFormat.Borders.LineStyle = Aspose.Words.LineStyle.Single; builder.CellFormat.Borders.Color = System.Drawing.Color.Black; builder.Bold = false; builder.RowFormat.Height = 20; @@ -951,7 +955,7 @@ namespace FineUIPro.Web.JDGL.CostAnalysis //本月施工进度情况 builder.MoveToBookmark("Form3"); builder.StartTable(); - builder.CellFormat.Borders.LineStyle = LineStyle.Single; + builder.CellFormat.Borders.LineStyle = Aspose.Words.LineStyle.Single; builder.CellFormat.Borders.Color = System.Drawing.Color.Black; builder.Bold = false; builder.RowFormat.Height = 20; @@ -1102,7 +1106,7 @@ namespace FineUIPro.Web.JDGL.CostAnalysis //专业和分部工程工程施工进度情况 builder.MoveToBookmark("Form4"); builder.StartTable(); - builder.CellFormat.Borders.LineStyle = LineStyle.Single; + builder.CellFormat.Borders.LineStyle = Aspose.Words.LineStyle.Single; builder.CellFormat.Borders.Color = System.Drawing.Color.Black; builder.Bold = false; builder.RowFormat.Height = 20; @@ -1466,7 +1470,7 @@ namespace FineUIPro.Web.JDGL.CostAnalysis builder.MoveToBookmark("Form42"); builder.StartTable(); - builder.CellFormat.Borders.LineStyle = LineStyle.Single; + builder.CellFormat.Borders.LineStyle = Aspose.Words.LineStyle.Single; builder.CellFormat.Borders.Color = System.Drawing.Color.Black; builder.Bold = false; builder.RowFormat.Height = 20; @@ -1857,5 +1861,1661 @@ namespace FineUIPro.Web.JDGL.CostAnalysis } } #endregion + + #region 导出(excel按钮) + protected void btnOutExcel_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.txtMonths.Text.Trim())) + { + Model.Project_Installation installation = BLL.Project_InstallationService.GetProjectInstallationByProjectId(this.CurrUser.LoginProjectId); + if (installation != null && !string.IsNullOrEmpty(this.txtMonths.Text.Trim())) + { + string id = installation.InstallationId; + string date = this.txtMonths.Text.Trim() + "-01"; + string strSql = "select distinct (cast(YEAR(Months) as varchar(4))+'.'+cast(MONTH(Months) as varchar(2))) as 月份,t.Months," + + "ThisRealCost as '本月已完工作实际费用-ACWP',ThisPlanCost as '本月已完工作预算费用-BCWP',ThisPlanValue as '本月计划工作预算费用-BCWS',TotalPlanValue as '累计计划工作预算费用-BCWS',TotalRealCost as '累计已完工作实际费用-ACWP',TotalPlanCost as '累计已完工作预算费用-BCWP' " + + "from dbo.View_WBS_CostControlParentDetail as t where ParentId=@Id and t.Months<=@Months order by t.Months"; + //string date = DateTime.Now.Year + "-" + DateTime.Now.Month + "-01"; + SqlParameter[] parameter = new SqlParameter[] + { + new SqlParameter("@Id",id), + new SqlParameter("@Months",date), + }; + DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter); + if (dt.Rows.Count > 0) + { + try + { + decimal BCWP = Funs.GetNewDecimalOrZero(dt.Rows[dt.Rows.Count - 1]["累计已完工作预算费用-BCWP"].ToString()); + decimal BCWS = Funs.GetNewDecimalOrZero(dt.Rows[dt.Rows.Count - 1]["累计计划工作预算费用-BCWS"].ToString()); + decimal ACWP = Funs.GetNewDecimalOrZero(dt.Rows[dt.Rows.Count - 1]["累计已完工作实际费用-ACWP"].ToString()); + decimal mBCWP = Funs.GetNewDecimalOrZero(dt.Rows[dt.Rows.Count - 1]["本月已完工作预算费用-BCWP"].ToString()); + decimal mBCWS = Funs.GetNewDecimalOrZero(dt.Rows[dt.Rows.Count - 1]["本月计划工作预算费用-BCWS"].ToString()); + decimal mACWP = Funs.GetNewDecimalOrZero(dt.Rows[dt.Rows.Count - 1]["本月已完工作实际费用-ACWP"].ToString()); + decimal CV = BCWP / 10000 - ACWP / 10000; + decimal SV = BCWP / 10000 - BCWS / 10000; + decimal CPI = 0; + if (ACWP > 0) + { + CPI = BCWP / ACWP; + } + decimal SPI = 0; + if (BCWS > 0) + { + SPI = BCWP / BCWS; + } + decimal mCV = mBCWP / 10000 - mACWP / 10000; + decimal mSV = mBCWP / 10000 - mBCWS / 10000; + decimal mCPI = 0; + if (mACWP > 0) + { + mCPI = mBCWP / mACWP; + } + decimal mSPI = 0; + if (mBCWS > 0) + { + mSPI = mBCWP / mBCWS; + } + string rootPath = Server.MapPath("~/"); + string initTemplatePath = string.Empty; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + string filePath = string.Empty; + initTemplatePath = Const.JDreportReportTemplateUrl; + uploadfilepath = rootPath + initTemplatePath; + + newUrl = uploadfilepath.Replace(".xlsx", "(" + this.txtMonths.Text.Trim() + ")" + ".xlsx"); + File.Copy(uploadfilepath, newUrl); + // 第一步:读取文件流 + NPOI.SS.UserModel.IWorkbook workbook; + using (FileStream stream = new FileStream(newUrl, FileMode.Open, FileAccess.Read)) + { + workbook = new NPOI.XSSF.UserModel.XSSFWorkbook(stream); + } + + // 创建单元格样式 + NPOI.SS.UserModel.ICellStyle cellStyle0 = workbook.CreateCellStyle(); + cellStyle0.BorderTop = NPOI.SS.UserModel.BorderStyle.None; + cellStyle0.BorderRight = NPOI.SS.UserModel.BorderStyle.None; + cellStyle0.BorderBottom = NPOI.SS.UserModel.BorderStyle.None; + cellStyle0.BorderLeft = NPOI.SS.UserModel.BorderStyle.None; + cellStyle0.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; + cellStyle0.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; + var font = workbook.CreateFont(); + font.FontHeightInPoints = 12; + font.IsBold = true; + //font.FontHeightInPoints = (short)8.5;字号为小数时要转为short + cellStyle0.SetFont(font); + + // 第二步:创建新数据行 + NPOI.SS.UserModel.ISheet sheet = workbook.GetSheet("Sheet1"); + NPOI.SS.UserModel.IRow row1 = sheet.CreateRow(1); + NPOI.SS.UserModel.ICell cell2; + // 添加测试数据 + cell2 = row1.CreateCell(14); + cell2.CellStyle = cellStyle0; + cell2.SetCellValue("123"); + var font2 = workbook.CreateFont(); + font2.FontHeightInPoints = 10; + + + + // 创建单元格样式 + NPOI.SS.UserModel.ICellStyle cellStyle1 = workbook.CreateCellStyle(); + cellStyle1.BorderTop = NPOI.SS.UserModel.BorderStyle.None; + cellStyle1.BorderRight = NPOI.SS.UserModel.BorderStyle.None; + cellStyle1.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle1.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle1.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; + cellStyle1.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; + var font3 = workbook.CreateFont(); + font3.FontHeightInPoints = 14; + cellStyle1.SetFont(font3); + + NPOI.SS.UserModel.ICellStyle cellStyle2 = workbook.CreateCellStyle(); + cellStyle2.BorderTop = NPOI.SS.UserModel.BorderStyle.None; + cellStyle2.BorderRight = NPOI.SS.UserModel.BorderStyle.None; + cellStyle2.BorderBottom = NPOI.SS.UserModel.BorderStyle.None; + cellStyle2.BorderLeft = NPOI.SS.UserModel.BorderStyle.None; + cellStyle2.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; + cellStyle2.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; + cellStyle2.SetFont(font3); + + int rowCount = 1; + + #region 一、项目赢得值曲线 + NPOI.SS.UserModel.IRow row = sheet.CreateRow(rowCount); + NPOI.SS.UserModel.ICell cell; + cell = row.CreateCell(0); + cell.CellStyle = cellStyle2; + cell.SetCellValue("一、项目赢得值曲线"); + CellRangeAddress region = new CellRangeAddress(rowCount, rowCount, 0, 16); + sheet.AddMergedRegion(region); + cell = row.CreateCell(38); + cell.CellStyle = cellStyle1; + cell.SetCellValue("月份"); + cell = row.CreateCell(39); + cell.CellStyle = cellStyle1; + cell.SetCellValue("累计已完工作实际费用-ACWP"); + cell = row.CreateCell(40); + cell.CellStyle = cellStyle1; + cell.SetCellValue("累计已完工作预算费用-BCWP"); + cell = row.CreateCell(41); + cell.CellStyle = cellStyle1; + cell.SetCellValue("累计计划工作预算费用-BCWS"); + + rowCount += 1; + for (int i = 0; i < dt.Rows.Count; i++) + { + //获取当前行row = sheet.Row(nowRowNum); + row = sheet.CreateRow(rowCount); + //给行的单元格填充数据 + row.CreateCell(38).SetCellValue(dt.Rows[i]["月份"].ToString()); + row.CreateCell(39).SetCellValue(Convert.ToDouble(dt.Rows[i]["累计已完工作实际费用-ACWP"].ToString()) / 10000); + row.CreateCell(40).SetCellValue(Convert.ToDouble(dt.Rows[i]["累计已完工作预算费用-BCWP"].ToString()) / 10000); + row.CreateCell(41).SetCellValue(Convert.ToDouble(dt.Rows[i]["累计计划工作预算费用-BCWS"].ToString()) / 10000); + rowCount++; + } + + rowCount = 29; + + + #endregion + + #region 二、项目总体施工进度情况 + //项目总体施工进度情况 + row = sheet.CreateRow(rowCount); + + cell = row.CreateCell(0); + cell.CellStyle = cellStyle1; + cell.SetCellValue("二、项目总体施工进度情况"); + + region = new CellRangeAddress(rowCount, rowCount, 0, 6); + sheet.AddMergedRegion(region); + rowCount += 1; + + // 创建单元格样式 + NPOI.SS.UserModel.ICellStyle cellStyle = workbook.CreateCellStyle(); + cellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; + cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; + cellStyle.SetFont(font2); + //赢得值参数(单位:万元) + row = sheet.CreateRow(rowCount); + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue("赢得值参数(单位:万元)"); + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + region = new CellRangeAddress(rowCount, rowCount, 0, 2); + sheet.AddMergedRegion(region); + + + //赢得值评价指标 + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue("赢得值评价指标"); + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + region = new CellRangeAddress(rowCount, rowCount, 3, 6); + sheet.AddMergedRegion(region); + rowCount += 1; + + //BCWP + row = sheet.CreateRow(rowCount); + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue("BCWP"); + //BCWS + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue("BCWS"); + //ACWP + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue("ACWP"); + //CV + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue("CV"); + //SV + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue("SV"); + //CPI + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue("CPI"); + //SPI + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue("SPI"); + + //数值 + //BCWP + rowCount += 1; + row = sheet.CreateRow(rowCount); + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue((BCWP / 10000).ToString("0.####")); + //BCWS + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue((BCWS / 10000).ToString("0.####")); + //ACWP + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue((ACWP / 10000).ToString("0.####")); + //CV + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue(CV.ToString("0.####")); + //SV + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(SV.ToString("0.####")); + //CPI + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(CPI.ToString("0.####")); + //SPI + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(SPI.ToString("0.####")); + rowCount += 2; + #endregion + #region 三、本月施工进度情况 + row = sheet.CreateRow(rowCount); + cell = row.CreateCell(0); + cell.CellStyle = cellStyle1; + cell.SetCellValue("三、本月施工进度情况"); + cell = row.CreateCell(1); + cell.CellStyle = cellStyle1; + cell.SetCellValue(""); + cell = row.CreateCell(2); + cell.CellStyle = cellStyle1; + cell.SetCellValue(""); + cell = row.CreateCell(3); + cell.CellStyle = cellStyle1; + cell.SetCellValue(""); + cell = row.CreateCell(4); + cell.CellStyle = cellStyle1; + cell.SetCellValue(""); + cell = row.CreateCell(5); + cell.CellStyle = cellStyle1; + cell.SetCellValue(""); + cell = row.CreateCell(6); + cell.CellStyle = cellStyle1; + cell.SetCellValue(""); + region = new CellRangeAddress(rowCount, rowCount, 0, 6); + sheet.AddMergedRegion(region); + rowCount += 1; + + //赢得值参数(单位:万元) + row = sheet.CreateRow(rowCount); + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue("赢得值参数(单位:万元)"); + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + region = new CellRangeAddress(rowCount, rowCount, 0, 2); + sheet.AddMergedRegion(region); + + //赢得值评价指标 + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue("赢得值评价指标"); + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + region = new CellRangeAddress(rowCount, rowCount, 3, 6); + sheet.AddMergedRegion(region); + rowCount += 1; + + //BCWP + row = sheet.CreateRow(rowCount); + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue("BCWP"); + //BCWS + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue("BCWS"); + //ACWP + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue("ACWP"); + //CV + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue("CV"); + //SV + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue("SV"); + //CPI + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue("CPI"); + //SPI + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue("SPI"); + + //数值 + //BCWP + rowCount += 1; + row = sheet.CreateRow(rowCount); + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue((mBCWP / 10000).ToString("0.####")); + //BCWS + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue((mBCWS / 10000).ToString("0.####")); + //ACWP + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue((mACWP / 10000).ToString("0.####")); + //CV + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue(mCV.ToString("0.####")); + //SV + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(mSV.ToString("0.####")); + //CPI + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(mCPI.ToString("0.####")); + //SPI + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(mSPI.ToString("0.####")); + rowCount += 2; + + #endregion + #region 四、专业和分部工程工程施工进度情况 + row = sheet.CreateRow(rowCount); + cell = row.CreateCell(0); + cell.CellStyle = cellStyle1; + cell.SetCellValue("四、专业和分部工程工程施工进度情况"); + + region = new CellRangeAddress(rowCount, rowCount, 0, 17); + sheet.AddMergedRegion(region); + rowCount += 1; + + row = sheet.CreateRow(rowCount); + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue("序号"); + // 合并单元格,参数依次为起始行,结束行,起始列,结束列 (索引0开始) + sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount + 1, 0, 0)); + + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue("装置"); + // 合并单元格,参数依次为起始行,结束行,起始列,结束列 (索引0开始) + sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount + 1, 1, 1)); + + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue("专业"); + // 合并单元格,参数依次为起始行,结束行,起始列,结束列 (索引0开始) + sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount + 1, 2, 2)); + + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue("分部工程"); + // 合并单元格,参数依次为起始行,结束行,起始列,结束列 (索引0开始) + sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount + 1, 3, 3)); + + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue("本月赢得值参数(单位:万元)"); + // 合并单元格,参数依次为起始行,结束行,起始列,结束列 (索引0开始) + sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 4, 6)); + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue("本月赢得值评价指标"); + // 合并单元格,参数依次为起始行,结束行,起始列,结束列 (索引0开始) + sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 7, 10)); + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + + cell = row.CreateCell(11); + cell.CellStyle = cellStyle; + cell.SetCellValue("累计赢得值参数(单位:万元)"); + // 合并单元格,参数依次为起始行,结束行,起始列,结束列 (索引0开始) + sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 11, 13)); + cell = row.CreateCell(12); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(13); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + + cell = row.CreateCell(14); + cell.CellStyle = cellStyle; + cell.SetCellValue("累计赢得值评价指标"); + // 合并单元格,参数依次为起始行,结束行,起始列,结束列 (索引0开始) + sheet.AddMergedRegion(new CellRangeAddress(rowCount, rowCount, 14, 17)); + cell = row.CreateCell(15); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(16); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(17); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + + rowCount += 1; + row = sheet.CreateRow(rowCount); + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue("BCWP"); + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue("BCWS"); + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue("ACWP"); + + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue("CV"); + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue("SV"); + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + cell.SetCellValue("CPI"); + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue("SPI"); + + cell = row.CreateCell(11); + cell.CellStyle = cellStyle; + cell.SetCellValue("BCWP"); + cell = row.CreateCell(12); + cell.CellStyle = cellStyle; + cell.SetCellValue("BCWS"); + cell = row.CreateCell(13); + cell.CellStyle = cellStyle; + cell.SetCellValue("ACWP"); + + cell = row.CreateCell(14); + cell.CellStyle = cellStyle; + cell.SetCellValue("CV"); + cell = row.CreateCell(15); + cell.CellStyle = cellStyle; + cell.SetCellValue("SV"); + cell = row.CreateCell(16); + cell.CellStyle = cellStyle; + cell.SetCellValue("CPI"); + cell = row.CreateCell(17); + cell.CellStyle = cellStyle; + cell.SetCellValue("SPI"); + + //导出数据 + + Model.SGGLDB db = Funs.DB; + var cnProfessions = from x in db.WBS_CnProfession where x.ProjectId == this.CurrUser.LoginProjectId && x.IsApprove == true select x; + var installationIds = cnProfessions.Select(x => x.InstallationId).Distinct().ToList(); + var installations = from x in db.Project_Installation where x.ProjectId == this.CurrUser.LoginProjectId && installationIds.Contains(x.InstallationId) select x; + var unitProjects = from x in db.Wbs_UnitProject where x.ProjectId == this.CurrUser.LoginProjectId && x.IsApprove == true select x; + var details = from x in db.View_WBS_CostControlParentDetail + where x.Months == Funs.GetNewDateTime(date) + select x; + decimal cnACWP, cnBCWP, cnBCWS, cnmACWP, cnmBCWP, cnmBCWS, cnCV, cnSV, cnCPI, cnSPI, cnmCV, cnmSV, cnmCPI, cnmSPI, + unACWP, unBCWP, unBCWS, unmACWP, unmBCWP, unmBCWS, unCV, unSV, unCPI, unSPI, unmCV, unmSV, unmCPI, unmSPI, + inACWP, inBCWP, inBCWS, inmACWP, inmBCWP, inmBCWS, inCV, inSV, inCPI, inSPI, inmCV, inmSV, inmCPI, inmSPI; + int a = 1, b = 1, c = 1; + foreach (var item in installations) + { + rowCount += 1; + inACWP = 0; + inBCWP = 0; + inBCWS = 0; + inmACWP = 0; + inmBCWP = 0; + inmBCWS = 0; + inCV = 0; + inSV = 0; + inCPI = 0; + inSPI = 0; + inmCV = 0; + inmSV = 0; + inmCPI = 0; + inmSPI = 0; + + //序号 + row = sheet.CreateRow(rowCount); + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue(c.ToString()); + //装置 + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(item.InstallationName); + //专业 + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue(string.Empty); + //分部工程 + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue(string.Empty); + var inDetails = (from x in details + where x.ParentId == item.InstallationId + select x).ToList(); + inmACWP = Funs.GetNewDecimalOrZero(inDetails.Select(x => x.ThisRealCost).Sum().ToString()) / 10000; + inmBCWP = Funs.GetNewDecimalOrZero(inDetails.Select(x => x.ThisPlanCost).Sum().ToString()) / 10000; + inmBCWS = Funs.GetNewDecimalOrZero(inDetails.Select(x => x.ThisPlanValue).Sum().ToString()) / 10000; + inmCV = inmBCWP - inmACWP; + inmSV = inmBCWP - inmBCWS; + if (inmACWP > 0) + { + inmCPI = inmBCWP / inmACWP; + } + if (inmBCWS > 0) + { + inmSPI = inmBCWP / inmBCWS; + } + //BCWP + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(inmBCWP.ToString("0.####")); + //BCWS + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(inmBCWS.ToString("0.####")); + //ACWP + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(inmACWP.ToString("0.####")); + //CV + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(inmCV.ToString("0.####")); + //SV + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(inmSV.ToString("0.####")); + //CPI + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + cell.SetCellValue(inmCPI.ToString("0.####")); + //SPI + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(inmSPI.ToString("0.####")); + + + inACWP = Funs.GetNewDecimalOrZero(inDetails.Select(x => x.TotalRealCost).Sum().ToString()) / 10000; + inBCWP = Funs.GetNewDecimalOrZero(inDetails.Select(x => x.TotalPlanCost).Sum().ToString()) / 10000; + inBCWS = Funs.GetNewDecimalOrZero(inDetails.Select(x => x.TotalPlanValue).Sum().ToString()) / 10000; + inCV = inBCWP - inACWP; + inSV = inBCWP - inBCWS; + if (inACWP > 0) + { + inCPI = inBCWP / inACWP; + } + if (inBCWS > 0) + { + inSPI = inBCWP / inBCWS; + } + //BCWP + cell = row.CreateCell(11); + cell.CellStyle = cellStyle; + cell.SetCellValue(inBCWP.ToString("0.####")); + + //BCWS + cell = row.CreateCell(12); + cell.CellStyle = cellStyle; + cell.SetCellValue(inBCWS.ToString("0.####")); + + //ACWP + cell = row.CreateCell(13); + cell.CellStyle = cellStyle; + cell.SetCellValue(inACWP.ToString("0.####")); + + //CV + cell = row.CreateCell(14); + cell.CellStyle = cellStyle; + cell.SetCellValue(inCV.ToString("0.####")); + + //SV + cell = row.CreateCell(15); + cell.CellStyle = cellStyle; + cell.SetCellValue(inSV.ToString("0.####")); + + //CPI + cell = row.CreateCell(16); + cell.CellStyle = cellStyle; + cell.SetCellValue(inCPI.ToString("0.####")); + + //SPI + cell = row.CreateCell(17); + cell.CellStyle = cellStyle; + cell.SetCellValue(inSPI.ToString("0.####")); + + a = 1; + var icnProfessions = cnProfessions.Where(x => x.InstallationId == item.InstallationId); + foreach (var cn in icnProfessions) + { + rowCount += 1; + cnACWP = 0; + cnBCWP = 0; + cnBCWS = 0; + cnmACWP = 0; + cnmBCWP = 0; + cnmBCWS = 0; + cnCV = 0; + cnSV = 0; + cnCPI = 0; + cnSPI = 0; + cnmCV = 0; + cnmSV = 0; + cnmCPI = 0; + cnmSPI = 0; + //序号 + row = sheet.CreateRow(rowCount); + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue(c.ToString() + "." + a.ToString()); + //装置 + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(string.Empty); + //专业 + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue(cn.CnProfessionName); + //分部工程 + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue(string.Empty); + + var cnDetails = (from x in details + where x.ParentId == cn.CnProfessionId + select x).ToList(); + cnmACWP = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.ThisRealCost).Sum().ToString()) / 10000; + cnmBCWP = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.ThisPlanCost).Sum().ToString()) / 10000; + cnmBCWS = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.ThisPlanValue).Sum().ToString()) / 10000; + cnmCV = cnmBCWP - cnmACWP; + cnmSV = cnmBCWP - cnmBCWS; + if (cnmACWP > 0) + { + cnmCPI = cnmBCWP / cnmACWP; + } + if (cnmBCWS > 0) + { + cnmSPI = cnmBCWP / cnmBCWS; + } + //BCWP + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(cnmBCWP.ToString("0.####")); + //BCWS + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(cnmBCWS.ToString("0.####")); + //ACWP + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(cnmACWP.ToString("0.####")); + //CV + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(cnmCV.ToString("0.####")); + //SV + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(cnmSV.ToString("0.####")); + //CPI + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + cell.SetCellValue(cnmCPI.ToString("0.####")); + //SPI + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(cnmSPI.ToString("0.####")); + + cnACWP = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.TotalRealCost).Sum().ToString()) / 10000; + cnBCWP = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.TotalPlanCost).Sum().ToString()) / 10000; + cnBCWS = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.TotalPlanValue).Sum().ToString()) / 10000; + cnCV = cnBCWP - cnACWP; + cnSV = cnBCWP - cnBCWS; + if (cnACWP > 0) + { + cnCPI = cnBCWP / cnACWP; + } + if (cnBCWS > 0) + { + cnSPI = cnBCWP / cnBCWS; + } + //BCWP + cell = row.CreateCell(11); + cell.CellStyle = cellStyle; + cell.SetCellValue(cnBCWP.ToString("0.####")); + + //BCWS + cell = row.CreateCell(12); + cell.CellStyle = cellStyle; + cell.SetCellValue(cnBCWS.ToString("0.####")); + + //ACWP + cell = row.CreateCell(13); + cell.CellStyle = cellStyle; + cell.SetCellValue(cnACWP.ToString("0.####")); + + //CV + cell = row.CreateCell(14); + cell.CellStyle = cellStyle; + cell.SetCellValue(cnCV.ToString("0.####")); + + //SV + cell = row.CreateCell(15); + cell.CellStyle = cellStyle; + cell.SetCellValue(cnSV.ToString("0.####")); + + //CPI + cell = row.CreateCell(16); + cell.CellStyle = cellStyle; + cell.SetCellValue(cnCPI.ToString("0.####")); + + //SPI + cell = row.CreateCell(17); + cell.CellStyle = cellStyle; + cell.SetCellValue(cnSPI.ToString("0.####")); + b = 1; + var unLists = from x in unitProjects where x.CnProfessionId == cn.CnProfessionId orderby x.SortIndex select x; + foreach (var un in unLists) + { + rowCount += 1; + unACWP = 0; + unBCWP = 0; + unBCWS = 0; + unmACWP = 0; + unmBCWP = 0; + unmBCWS = 0; + unCV = 0; + unSV = 0; + unCPI = 0; + unSPI = 0; + unmCV = 0; + unmSV = 0; + unmCPI = 0; + unmSPI = 0; + //序号 + row = sheet.CreateRow(rowCount); + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue(c.ToString() + "." + a.ToString() + "." + b.ToString()); + //装置 + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(string.Empty); + //专业 + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue(string.Empty); + //分部工程 + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue(un.UnitProjectName); + var unDetails = from x in details + where x.ParentId == un.UnitProjectId + select x; + unmACWP = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.ThisRealCost).Sum().ToString()) / 10000; + unmBCWP = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.ThisPlanCost).Sum().ToString()) / 10000; + unmBCWS = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.ThisPlanValue).Sum().ToString()) / 10000; + unmCV = unmBCWP - unmACWP; + unmSV = unmBCWP - unmBCWS; + if (unmACWP > 0) + { + unmCPI = unmBCWP / unmACWP; + } + if (unmBCWS > 0) + { + unmSPI = unmBCWP / unmBCWS; + } + + //BCWP + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(unmBCWP.ToString("0.####")); + //BCWS + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(unmBCWS.ToString("0.####")); + //ACWP + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(unmACWP.ToString("0.####")); + //CV + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(unmCV.ToString("0.####")); + //SV + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(unmSV.ToString("0.####")); + //CPI + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + cell.SetCellValue(unmCPI.ToString("0.####")); + //SPI + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(unmSPI.ToString("0.####")); + unACWP = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.TotalRealCost).Sum().ToString()) / 10000; + unBCWP = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.TotalPlanCost).Sum().ToString()) / 10000; + unBCWS = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.TotalPlanValue).Sum().ToString()) / 10000; + unCV = unBCWP - unACWP; + unSV = unBCWP - unBCWS; + if (unACWP > 0) + { + unCPI = unBCWP / unACWP; + } + if (unBCWS > 0) + { + unSPI = unBCWP / unBCWS; + } + //BCWP + cell = row.CreateCell(11); + cell.CellStyle = cellStyle; + cell.SetCellValue(cnBCWP.ToString("0.####")); + + //BCWS + cell = row.CreateCell(12); + cell.CellStyle = cellStyle; + cell.SetCellValue(unBCWP.ToString("0.####")); + + //ACWP + cell = row.CreateCell(13); + cell.CellStyle = cellStyle; + cell.SetCellValue(unACWP.ToString("0.####")); + + //CV + cell = row.CreateCell(14); + cell.CellStyle = cellStyle; + cell.SetCellValue(unCV.ToString("0.####")); + + //SV + cell = row.CreateCell(15); + cell.CellStyle = cellStyle; + cell.SetCellValue(unSV.ToString("0.####")); + + //CPI + cell = row.CreateCell(16); + cell.CellStyle = cellStyle; + cell.SetCellValue(unCPI.ToString("0.####")); + + //SPI + cell = row.CreateCell(17); + cell.CellStyle = cellStyle; + cell.SetCellValue(unSPI.ToString("0.####")); + b++; + } + a++; + } + c++; + } + #endregion + rowCount += 2; + #region 五、设备/材料施工进度情况 + row = sheet.CreateRow(rowCount); + cell = row.CreateCell(0); + cell.CellStyle = cellStyle1; + cell.SetCellValue("五、设备/材料施工进度情况"); + + region = new CellRangeAddress(rowCount, rowCount, 0, 10); + sheet.AddMergedRegion(region); + rowCount += 1; + //表头 + row = sheet.CreateRow(rowCount); + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue("序号"); + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue("专业"); + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue("设备材料大类"); + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue("设备材料分类"); + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue("单位"); + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue("合同工作量"); + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue("本月完成量"); + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue("累计完成量"); + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + cell.SetCellValue("本月完成率"); + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue("累计完成率"); + + //数据 + #region 加载数据 + var cnProfessionInits = from x in db.WBS_CnProfessionInit orderby x.SortIndex select x; + var costControls = from x in db.WBS_CostControl + join z in db.WBS_EquipmentMaterialType on x.EquipmentMaterialTypeId equals z.EquipmentMaterialTypeId + join t in db.Wbs_WbsSet on x.WbsSetId equals t.WbsSetId + where x.ProjectId == this.CurrUser.LoginProjectId + select new + { + x.Unit, + x.TotalNum, + z.EquipmentMaterialBigTypeId, + z.EquipmentMaterialTypeId, + t.InstallationId, + }; + var costControlDetails = from x in db.WBS_CostControlDetail + join y in db.WBS_CostControl on x.CostControlId equals y.CostControlId + join z in db.WBS_EquipmentMaterialType on y.EquipmentMaterialTypeId equals z.EquipmentMaterialTypeId + join t in db.Wbs_WbsSet on y.WbsSetId equals t.WbsSetId + where x.Months <= Funs.GetNewDateTime(date) && y.ProjectId == this.CurrUser.LoginProjectId + orderby x.Months descending + select new + { + x.CostControlDetailId, + t.InstallationId, + y.EquipmentMaterialTypeId, + z.EquipmentMaterialBigTypeId, + z.EquipmentMaterialTypeName, + x.Months, + x.ThisNum, + }; + var equipmentMaterialBigTypes = from x in db.WBS_EquipmentMaterialBigType orderby x.EquipmentMaterialBigTypeCode select x; + var equipmentMaterialTypes = from x in db.WBS_EquipmentMaterialType orderby x.EquipmentMaterialTypeCode select x; + int v = 1, w = 2, d = 1, f = 1; + foreach (var cn in cnProfessionInits) + { + rowCount += 1; + row = sheet.CreateRow(rowCount); + #region 加载数据 + //序号 + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue(v.ToString()); + //专业 + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(cn.CnProfessionName); + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + #endregion + rowCount += 1; + row = sheet.CreateRow(rowCount); + #region 加载数据 + //序号 + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue(v.ToString() + ".1"); + //专业 + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue("本专业汇总统计"); + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + #endregion + d = 1; + var bigTypes = equipmentMaterialBigTypes.Where(x => x.CnProfessionId == cn.CnProfessionId).OrderBy(x => x.EquipmentMaterialBigTypeCode); + foreach (var bigType in bigTypes) + { + rowCount += 1; + row = sheet.CreateRow(rowCount); + #region 加载数据 + //序号 + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue(v.ToString() + ".1." + d.ToString()); + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //设备材料大类 + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue(bigType.EquipmentMaterialBigTypeName); + //设备材料分类 + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + + var list = costControls.Where(x => x.EquipmentMaterialBigTypeId == bigType.EquipmentMaterialBigTypeId); + if (list.Count() > 0) + { + //单位 + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(list.First().Unit); + //合同工作量row5[4] + var cellValue1 = list.ToList().Sum(x => x.TotalNum ?? 0).ToString(); + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue1); + //本月完成量row5[5] + var list2 = costControlDetails.Where(x => x.EquipmentMaterialBigTypeId == bigType.EquipmentMaterialBigTypeId && x.Months == Funs.GetNewDateTime(date)); + var cellValue2 = list2.ToList().Sum(x => x.ThisNum ?? 0).ToString(); + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue2); + //累计完成量row5[6] + var list3 = costControlDetails.Where(x => x.EquipmentMaterialBigTypeId == bigType.EquipmentMaterialBigTypeId); + var cellValue3 = list3.ToList().Sum(x => x.ThisNum ?? 0).ToString(); + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue3); + //本月完成率 + var cellValue4 = ""; + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + + if (cellValue1 != "0" && cellValue2 != "0") + { + cellValue4 = (Funs.GetNewDecimalOrZero(cellValue2) / Funs.GetNewDecimalOrZero(cellValue1) * 100).ToString("0.##") + "%"; + } + else + { + cellValue4 = "/"; + } + cell.SetCellValue(cellValue4); + //累计完成率 + var cellValue5 = ""; + if (cellValue1 != "0" && cellValue3 != "0") + { + cellValue5 = (Funs.GetNewDecimalOrZero(cellValue3) / Funs.GetNewDecimalOrZero(cellValue1) * 100).ToString("0.##") + "%"; + } + else + { + cellValue5 = "/"; + } + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue5); + } + else + { + //单位 + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //合同工作量row5[4] + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //本月完成量row5[5] + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //累计完成量row5[6] + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //本月完成率 + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //累计完成率 + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + } + f = 1; + var types = equipmentMaterialTypes.Where(x => x.EquipmentMaterialBigTypeId == bigType.EquipmentMaterialBigTypeId).OrderBy(x => x.EquipmentMaterialTypeCode); + foreach (var equipmentMaterialType in types) + { + rowCount += 1; + row = sheet.CreateRow(rowCount); + //序号 + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue(v.ToString() + ".1." + d.ToString() + "." + f.ToString()); + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //设备材料大类 + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //设备材料分类 + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(equipmentMaterialType.EquipmentMaterialTypeName); + var lists = costControls.Where(x => x.EquipmentMaterialTypeId == equipmentMaterialType.EquipmentMaterialTypeId); + if (lists.Count() > 0) + { + var cellValue1 = ""; + //单位 + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(lists.First().Unit); + //合同工作量row5[4] + cellValue1 = lists.ToList().Sum(x => x.TotalNum ?? 0).ToString(); + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue1); + //本月完成量row5[5] + var list2s = costControlDetails.Where(x => x.EquipmentMaterialTypeId == equipmentMaterialType.EquipmentMaterialTypeId && x.Months == Funs.GetNewDateTime(date)); + var cellValue2 = list2s.ToList().Sum(x => x.ThisNum ?? 0).ToString(); + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue2); + //累计完成量row5[6] + var list3s = costControlDetails.Where(x => x.EquipmentMaterialTypeId == equipmentMaterialType.EquipmentMaterialTypeId); + var cellValue3 = list3s.ToList().Sum(x => x.ThisNum ?? 0).ToString(); + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue3); + //本月完成率 + var cellValue4 = ""; + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + + if (cellValue1 != "0" && cellValue2 != "0") + { + cellValue4 = (Funs.GetNewDecimalOrZero(cellValue2) / Funs.GetNewDecimalOrZero(cellValue1) * 100).ToString("0.##") + "%"; + } + else + { + cellValue4 = "/"; + } + cell.SetCellValue(cellValue4); + //累计完成率 + var cellValue5 = ""; + if (cellValue1 != "0" && cellValue3 != "0") + { + cellValue5 = (Funs.GetNewDecimalOrZero(cellValue3) / Funs.GetNewDecimalOrZero(cellValue1) * 100).ToString("0.##") + "%"; + } + else + { + cellValue5 = "/"; + } + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue5); + } + else + { + //单位 + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //合同工作量row5[4] + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //本月完成量row5[5] + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //累计完成量row5[6] + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //本月完成率 + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //累计完成率 + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + } + f++; + } + d++; + #endregion + } + w = 2; + foreach (var ins in installations) + { + rowCount += 1; + row = sheet.CreateRow(rowCount); + //加载本专业汇总统计以下的 + #region 加载数据 + //序号 + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue(v.ToString() + "." + w.ToString()); + //专业 + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue(ins.InstallationName); + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + #endregion + d = 1; + var bigTypes2 = equipmentMaterialBigTypes.Where(x => x.CnProfessionId == cn.CnProfessionId).OrderBy(x => x.EquipmentMaterialBigTypeCode); + foreach (var bigType in bigTypes2) + { + rowCount += 1; + row = sheet.CreateRow(rowCount); + //设备材料大类 + #region 加载数据 + //序号 + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue(v.ToString() + "." + w.ToString() + d.ToString()); + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //设备材料大类 + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue(bigType.EquipmentMaterialBigTypeName); + //设备材料分类 + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + + var list = costControls.Where(x => x.EquipmentMaterialBigTypeId == bigType.EquipmentMaterialBigTypeId && x.InstallationId == ins.InstallationId); + if (list.Count() > 0) + { + //单位 + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(list.First().Unit); + //合同工作量row5[4] + var cellValue1 = list.ToList().Sum(x => x.TotalNum ?? 0).ToString(); + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue1); + //本月完成量row5[5] + var list2 = costControlDetails.Where(x => x.EquipmentMaterialBigTypeId == bigType.EquipmentMaterialBigTypeId && x.InstallationId == ins.InstallationId && x.Months == Funs.GetNewDateTime(date)); + var cellValue2 = list2.ToList().Sum(x => x.ThisNum ?? 0).ToString(); + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue2); + //累计完成量row5[6] + var list3 = costControlDetails.Where(x => x.EquipmentMaterialBigTypeId == bigType.EquipmentMaterialBigTypeId && x.InstallationId == ins.InstallationId); + var cellValue3 = list3.ToList().Sum(x => x.ThisNum ?? 0).ToString(); + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue3); + //本月完成率 + var cellValue4 = ""; + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + + if (cellValue1 != "0" && cellValue2 != "0") + { + cellValue4 = (Funs.GetNewDecimalOrZero(cellValue2) / Funs.GetNewDecimalOrZero(cellValue1) * 100).ToString("0.##") + "%"; + } + else + { + cellValue4 = "/"; + } + cell.SetCellValue(cellValue4); + //累计完成率 + var cellValue5 = ""; + if (cellValue1 != "0" && cellValue3 != "0") + { + cellValue5 = (Funs.GetNewDecimalOrZero(cellValue3) / Funs.GetNewDecimalOrZero(cellValue1) * 100).ToString("0.##") + "%"; + } + else + { + cellValue5 = "/"; + } + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue5); + } + else { + //单位 + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //合同工作量row5[4] + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //本月完成量row5[5] + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //累计完成量row5[6] + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //本月完成率 + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //累计完成率 + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + } + f = 1; + var types = equipmentMaterialTypes.Where(x => x.EquipmentMaterialBigTypeId == bigType.EquipmentMaterialBigTypeId).OrderBy(x => x.EquipmentMaterialTypeCode); + foreach (var equipmentMaterialType in types) + { + rowCount += 1; + row = sheet.CreateRow(rowCount); + //序号 + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue(v.ToString() + "." + w.ToString() + d.ToString() + "." + f.ToString()); + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //设备材料大类 + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //设备材料分类 + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(equipmentMaterialType.EquipmentMaterialTypeName); + var lists = costControls.Where(x => x.EquipmentMaterialTypeId == equipmentMaterialType.EquipmentMaterialTypeId && x.InstallationId == ins.InstallationId); + if (lists.Count() > 0) + { + var cellValue1 = ""; + //单位 + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(lists.First().Unit); + //合同工作量row5[4] + cellValue1 = lists.ToList().Sum(x => x.TotalNum ?? 0).ToString(); + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue1); + //本月完成量row5[5] + var list2s = costControlDetails.Where(x => x.EquipmentMaterialTypeId == equipmentMaterialType.EquipmentMaterialTypeId && x.InstallationId == ins.InstallationId && x.Months == Funs.GetNewDateTime(date)); + var cellValue2 = list2s.ToList().Sum(x => x.ThisNum ?? 0).ToString(); + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue2); + //累计完成量row5[6] + var list3s = costControlDetails.Where(x => x.EquipmentMaterialTypeId == equipmentMaterialType.EquipmentMaterialTypeId && x.InstallationId == ins.InstallationId); + var cellValue3 = list3s.ToList().Sum(x => x.ThisNum ?? 0).ToString(); + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue3); + //本月完成率 + var cellValue4 = ""; + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + + if (cellValue1 != "0" && cellValue2 != "0") + { + cellValue4 = (Funs.GetNewDecimalOrZero(cellValue2) / Funs.GetNewDecimalOrZero(cellValue1) * 100).ToString("0.##") + "%"; + } + else + { + cellValue4 = "/"; + } + cell.SetCellValue(cellValue4); + //累计完成率 + var cellValue5 = ""; + if (cellValue1 != "0" && cellValue3 != "0") + { + cellValue5 = (Funs.GetNewDecimalOrZero(cellValue3) / Funs.GetNewDecimalOrZero(cellValue1) * 100).ToString("0.##") + "%"; + } + else + { + cellValue5 = "/"; + } + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(cellValue5); + } + else + { + //单位 + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //合同工作量row5[4] + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //本月完成量row5[5] + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //累计完成量row5[6] + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //本月完成率 + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + //累计完成率 + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(""); + } + f++; + } + d++; + + } + w++; + #endregion + } + v++; + } + #endregion + #endregion + // 第三步:写入文件流 + using (FileStream stream = new FileStream(newUrl, FileMode.Create, FileAccess.Write)) + { + workbook.Write(stream); + workbook.Close(); + } + string fileName = Path.GetFileName(newUrl); + FileInfo info = new FileInfo(newUrl); + long fileSize = info.Length; + Response.Clear(); + Response.ContentType = "application/x-zip-compressed"; + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.AddHeader("Content-Length", fileSize.ToString()); + Response.TransmitFile(newUrl, 0, fileSize); + Response.Flush(); + Response.Close(); + File.Delete(newUrl); + } + catch (Exception ex) + { + + throw ex; + } + + } + else + { + ShowNotify("没有数据,无法导出!", MessageBoxIcon.Warning); + } + } + } + else + { + ShowNotify("请选择月份!", MessageBoxIcon.Warning); + } + } + #endregion + + //public void AutoColumnWidth(HSSFSheet sheet, int cols) + //{ + // for (int col = 0; col <= cols; col++) + // { + // sheet.AutoSizeColumn(col);//自适应宽度,但是其实还是比实际文本要宽 + // int columnWidth = sheet.GetColumnWidth(col) / 256;//获取当前列宽度 + // for (int rowIndex = 0; rowIndex <= sheet.LastRowNum; rowIndex++) + // { + // HSSFRow row = sheet.GetRow(rowIndex); + // if (row!=null) + // { + // HSSFCell cell = row.GetCell(col); + // if (cell!=null) + // { + // int contextLength = Encoding.UTF8.GetBytes(cell.ToString()).Length;//获取当前单元格的内容宽度 + // columnWidth = columnWidth < contextLength ? contextLength : columnWidth; + // sheet.SetColumnWidth(col, columnWidth * 200);// + // } + // } + + // } + // } + //} + } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx index db991219..6881e642 100644 --- a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx +++ b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx @@ -36,11 +36,7 @@ - - - - + @@ -50,6 +46,17 @@ + + + + + + + + + + @@ -59,7 +66,7 @@ + HeaderText="" /> diff --git a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.cs b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.cs index ddef2c40..5cad5094 100644 --- a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.cs +++ b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.cs @@ -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(); } diff --git a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.designer.cs b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.designer.cs index dbf63af5..35afea09 100644 --- a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.designer.cs @@ -75,24 +75,6 @@ namespace FineUIPro.Web.JDGL.WBS { /// protected global::FineUIPro.DropDownList drpUnitProject; - /// - /// drpWbsSet 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList drpWbsSet; - - /// - /// btnSearch 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnSearch; - /// /// btnSend 控件。 /// @@ -120,6 +102,42 @@ namespace FineUIPro.Web.JDGL.WBS { /// protected global::FineUIPro.Button btnCheck; + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpWbsSet 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWbsSet; + + /// + /// txtEquipmentMaterialType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtEquipmentMaterialType; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + /// /// btnOut 控件。 ///