lixiaojun
2024-12-10 c27c9487c3fe3e682fcfcdf71c23147dffc3fa84
Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0
已修改3个文件
408 ■■■■■ 文件已修改
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/ReportViewModel.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/SimulationWordReport.cs 366 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/test.cs 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/ReportViewModel.cs
@@ -86,6 +86,11 @@
        public string EquipmentMainName { get; set; }
        /// <summary>
        /// 台数
        /// </summary>
        public string Count { get; set; }
        /// <summary>
        /// 额定流量
        /// </summary>
        public string RatedFlow { get; set; }
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/SimulationWordReport.cs
@@ -10,12 +10,6 @@
        {
        }
        //报告标题项目名称
        private string _title = "*********";
        //项目情况介绍    一)系统概括中
        private string _Instructions = "*******************************************************************";
        //文字描述运行模式介绍    二)运行情况与能耗分析中 "全年:"后
        private string _run_mode = "*******************************************************************";
@@ -93,25 +87,25 @@
            return strem;
        }
        protected void SetWordHander(Aspose.Words.Document doc)
        protected void SetWordHander(Aspose.Words.Document doc, string title)
        {
            DocumentBuilder builder = new Aspose.Words.DocumentBuilder(doc);
            builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
            SimulationWordReportHelper Text_center_10_Gray = new SimulationWordReportHelper(builder) { fontalignment = ParagraphAlignment.Right, fontsize = 10, fontcolor = Color.Gray };
            Text_center_10_Gray.structureText(string.Format("{0}{1}", _title, "项目节能方案报告"));
            Text_center_10_Gray.structureText(string.Format("{0}{1}", title, "项目节能方案报告"));
            builder.InsertHorizontalRule();
            // 移动到下一行,以便继续添加其他内容
            builder.MoveToDocumentStart();
        }
        protected void SetWordFooter(Aspose.Words.Document doc)
        protected void SetWordFooter(Aspose.Words.Document doc, string title)
        {
            DocumentBuilder builder = new Aspose.Words.DocumentBuilder(doc);
            builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);
            SimulationWordReportHelper Text_center_10_Gray = new SimulationWordReportHelper(builder) { fontalignment = ParagraphAlignment.Left, fontsize = 10, fontcolor = Color.Gray };
            builder.InsertHorizontalRule();
            Text_center_10_Gray.structureText(string.Format("{0}{1}", _title, "项目节能方案报告"));
            Text_center_10_Gray.structureText(string.Format("{0}{1}", title, "项目节能方案报告"));
            // 移动到下一行,以便继续添加其他内容
            builder.MoveToDocumentStart();
        }
@@ -126,8 +120,8 @@
            SimulationWordReportHelper Text_left_15_black = new SimulationWordReportHelper(builder) { fontsize = 15, isblod = true };//一级标题
            SimulationWordReportHelper Text_left_12_black = new SimulationWordReportHelper(builder) { fontsize = 12 };
            SimulationWordReportHelper Text_reight_10_black = new SimulationWordReportHelper(builder) { fontalignment = ParagraphAlignment.Right, fontsize = 12 };
            SetWordHander(src);
            SetWordFooter(src);
            SetWordHander(src, reportViewModel.ProjectName);
            SetWordFooter(src, reportViewModel.ProjectName);
            builder.ParagraphFormat.LineSpacingRule = LineSpacingRule.Multiple;
            builder.ParagraphFormat.LineSpacing = 18; // 设置行距为1.5倍默认行距
@@ -139,11 +133,11 @@
            SimulationWordReportHelper Cell_h_merging_start = new SimulationWordReportHelper(builder) { horizontalMerge = Aspose.Words.Tables.CellMerge.First };
            SimulationWordReportHelper Cell_h_merging_end = new SimulationWordReportHelper(builder) { horizontalMerge = Aspose.Words.Tables.CellMerge.Previous };
            Text_center_25_black.structureText(string.Format("{0}{1}", _title, "项目节能方案报告"));
            Text_center_25_black.structureText(string.Format("{0}{1}", reportViewModel.ProjectName, "项目节能方案报告"));
            Text_left_15_black.structureText("一、系统概述");
            Text_left_15_black.AddBlankLine();
            Text_left_15_black.AddBlankLine();
            Text_left_12_black.structureText(string.Format("{0}", _Instructions));
            Text_left_12_black.structureText(string.Format("{0}", reportViewModel.Description));
            Text_left_12_black.structureText("1.1、设备基本配置");
            #region 设别基本配置表
@@ -192,6 +186,47 @@
                    Cell.structureCell(item.Speed);
                    builder.EndRow();
                }
            }
            else
            {
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                builder.EndRow();
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                builder.EndRow();
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                builder.EndRow();
            }
            builder.EndTable();
            basic_config_table.AllowAutoFit = false;
@@ -253,6 +288,40 @@
                    Cell.structureCell(item.ReturnPressure);
                    builder.EndRow();
                }
            }
            else
            {
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                builder.EndRow();
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                builder.EndRow();
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
            }
            builder.EndTable();
@@ -456,23 +525,58 @@
            Cell.structureCell("年运行时间(h)");
            Cell.structureCell("年耗电量(万kW.h)");
            builder.EndRow();
            double totalPower = 0;
            int totalHour = 0;
            double AnnualPower = 0;
            if (reportViewModel.PowerConsumptionInfos != null)
            {
                foreach (var item in reportViewModel.PowerConsumptionInfos)
                {
                    Cell.structureCell(item.RunMode);
                    Cell.structureCell(item.PreTechPowerConsumption);
                    if (double.TryParse(item.PreTechPowerConsumption, out double power))
                    {
                        totalPower += power;
                    }
                    Cell.structureCell(item.AnnualRunningHours);
                    if (int.TryParse(item.AnnualRunningHours, out int hour))
                    {
                        totalHour += hour;
                    }
                    Cell.structureCell(item.AnnualPowerConsumption);
                    if (double.TryParse(item.AnnualPowerConsumption, out double annualPower))
                    {
                        AnnualPower += annualPower;
                    }
                    builder.EndRow();
                }
            }
            Cell.structureCell("合计");
            Cell.structureCell("");
            Cell.structureCell("");
            Cell.structureCell("");
            if (totalPower != 0)
            {
                Cell.structureCell(totalPower.ToString());
            }
            else
            {
                Cell.structureCell("");
            }
            if (totalHour != 0)
            {
                Cell.structureCell(totalHour.ToString());
            }
            else
            {
                Cell.structureCell("");
            }
            if (AnnualPower != 0)
            {
                Cell.structureCell(AnnualPower.ToString());
            }
            else
            {
                Cell.structureCell("");
            }
            builder.EndTable();
            actual_energy_consumption_table.AllowAutoFit = false;
            Processing_pagination(src, builder, actual_energy_consumption_table);
@@ -615,6 +719,7 @@
                    Cell.structureCell(item.EquipmentName);
                    Cell.structureCell(item.EquipmentNumber);
                    Cell.structureCell(item.EquipmentMainName);
                    Cell.structureCell(item.Count);
                    Cell.structureCell(item.RatedFlow);
                    Cell.structureCell(item.RatedHead);
                    Cell.structureCell(item.TypeOfDrive);
@@ -625,6 +730,47 @@
                    Cell.structureCell(item.Speed);
                    builder.EndRow();
                }
            }
            else
            {
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                builder.EndRow();
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                builder.EndRow();
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                builder.EndRow();
            }
            builder.EndTable();
            Device_configuration_table.AllowAutoFit = false;
@@ -685,6 +831,40 @@
                    Cell.structureCell(item.ReturnPressure);
                    builder.EndRow();
                }
            }
            else
            {
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                builder.EndRow();
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                builder.EndRow();
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
            }
            builder.EndTable();
            //estimated_running_table.AllowAutoFit = false;
@@ -818,23 +998,58 @@
            Cell.structureCell("年运行时间(h)");
            Cell.structureCell("改后年耗电量(万kW.h)");
            builder.EndRow();
            totalPower = 0;
            totalHour = 0;
            AnnualPower = 0;
            if (reportViewModel.AfterPowerConsumptionInfos != null)
            {
                foreach (var item in reportViewModel.AfterPowerConsumptionInfos)
                {
                    Cell.structureCell(item.RunMode);
                    Cell.structureCell(item.PreTechPowerConsumption);
                    if (double.TryParse(item.PreTechPowerConsumption, out double power))
                    {
                        totalPower += power;
                    }
                    Cell.structureCell(item.AnnualRunningHours);
                    if (int.TryParse(item.AnnualRunningHours, out int hour))
                    {
                        totalHour += hour;
                    }
                    Cell.structureCell(item.AnnualPowerConsumption);
                    if (double.TryParse(item.AnnualPowerConsumption, out double annualPower))
                    {
                        AnnualPower += annualPower;
                    }
                    builder.EndRow();
                }
            }
            Cell.structureCell("合计");
            Cell.structureCell("");
            Cell.structureCell("");
            Cell.structureCell("");
            if (totalPower != 0)
            {
                Cell.structureCell(totalPower.ToString());
            }
            else
            {
                Cell.structureCell("");
            }
            if (totalHour != 0)
            {
                Cell.structureCell(totalHour.ToString());
            }
            else
            {
                Cell.structureCell("");
            }
            if (AnnualPower != 0)
            {
                Cell.structureCell(AnnualPower.ToString());
            }
            else
            {
                Cell.structureCell("");
            }
            builder.EndTable();
            expected_power_savings.AllowAutoFit = false;
            Processing_pagination(src, builder, expected_power_savings);
@@ -873,7 +1088,8 @@
            Cell.structureCell("(%)");
            Cell.structureCell("(h)");
            builder.EndRow();
            double savingRate = 0;
            double runningTime = 0;
            if (reportViewModel.PowerRelatedInfos != null)
            {
                foreach (var item in reportViewModel.PowerRelatedInfos)
@@ -883,17 +1099,48 @@
                    Cell.structureCell(item.PostTechDesignedPower);
                    Cell.structureCell(item.HourlyPowerSaving);
                    Cell.structureCell(item.PowerSavingRate);
                    if (double.TryParse(item.PowerSavingRate, out double power))
                    {
                        savingRate += power;
                    }
                    Cell.structureCell(item.RunningTime);
                    if (double.TryParse(item.RunningTime, out double time))
                    {
                        runningTime += time;
                    }
                    builder.EndRow();
                }
            }
            else
            {
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                builder.EndRow();
            }
            Cell_h_merging_start.structureCell("合计年节电量(万度)");
            Cell_h_merging_end.structureCell("");
            Cell_h_merging_end.structureCell("");
            Cell_h_merging_end.structureCell("");
            Cell_h_merging_start.structureCell("");
            Cell_h_merging_start.structureCell("");
            if (savingRate != 0)
            {
                Cell_h_merging_start.structureCell(savingRate.ToString());
            }
            else
            {
                Cell_h_merging_start.structureCell("");
            }
            if (runningTime != 0)
            {
                Cell_h_merging_start.structureCell(runningTime.ToString());
            }
            else
            {
                Cell_h_merging_start.structureCell("");
            }
            builder.EndTable();
            summary_table.AllowAutoFit = false;
            Processing_pagination(src, builder, summary_table);
@@ -915,25 +1162,84 @@
            Cell.structureCell("改后年节电量\r\n(万度/年)");
            builder.EndRow();
            double totalBeforePower = 0;
            double totalSavingRate = 0;
            double totalAfterAnnualPower = 0;
            if (reportViewModel.AfterEquipmentPowers != null)
            {
                int i = 0;
                foreach (var item in reportViewModel.AfterEquipmentPowers)
                {
                    Cell.structureCell((i++).ToString());
                    Cell.structureCell((++i).ToString());
                    Cell.structureCell(item.EquipmentName);
                    Cell.structureCell(item.PowerConsumptionBeforeTech);
                    if (double.TryParse(item.PowerConsumptionBeforeTech, out double BeforePower))
                    {
                        totalBeforePower += BeforePower;
                    }
                    Cell.structureCell(item.PowerSavingRate);
                    if (double.TryParse(item.PowerSavingRate, out double SavingRate))
                    {
                        totalSavingRate += SavingRate;
                    }
                    Cell.structureCell(item.AnnualPowerSavingAfterTech);
                    if (double.TryParse(item.AnnualPowerSavingAfterTech, out double AfterAnnualPower))
                    {
                        totalAfterAnnualPower += AfterAnnualPower;
                    }
                    builder.EndRow();
                }
            }
            else
            {
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                builder.EndRow();
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                builder.EndRow();
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                Cell.structureCell("");
                builder.EndRow();
            }
            Cell.structureCell("");
            Cell.structureCell("合计");
            Cell.structureCell("");
            Cell.structureCell("");
            Cell.structureCell("");
            if (totalBeforePower != 0)
            {
                Cell.structureCell(totalBeforePower.ToString());
            }
            else
            {
                Cell.structureCell("");
            }
            if (totalSavingRate != 0)
            {
                Cell.structureCell(totalSavingRate.ToString());
            }
            else
            {
                Cell.structureCell("");
            }
            if (totalAfterAnnualPower != 0)
            {
                Cell.structureCell(totalAfterAnnualPower.ToString());
            }
            else
            {
                Cell.structureCell("");
            }
            builder.EndRow();
            builder.EndTable();
            power_saving_effect_table.AllowAutoFit = false;
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/12-report/test.cs
@@ -16,6 +16,43 @@
            test1.ValveOpens.Add(new ValveOpen { Name = "测试2", MinorLoss = "20" });
            test1.ValveOpens.Add(new ValveOpen { Name = "测试3", MinorLoss = "20" });
            test1.ValveOpens.Add(new ValveOpen { Name = "测试4", MinorLoss = "20" });
            test1.PumpStations = new List<ReportPumpStationViewModel>();
            test1.PumpStations.Add(new ReportPumpStationViewModel { EquipmentName = "测试1", OutletPressure = "23" });
            test1.PumpStations.Add(new ReportPumpStationViewModel { EquipmentName = "测试2", OutletPressure = "23" });
            test1.PumpStations.Add(new ReportPumpStationViewModel { EquipmentName = "测试3", OutletPressure = "23" });
            test1.ProjectName = "项目1";
            test1.Equipments = new List<ReportEquipmentViewModel>();
            test1.Equipments.Add(new ReportEquipmentViewModel { Speed = "2", RatedCurrent = "3" });
            test1.Equipments.Add(new ReportEquipmentViewModel { Speed = "2", RatedCurrent = "3" });
            test1.Equipments.Add(new ReportEquipmentViewModel { Speed = "2", RatedCurrent = "3" });
            test1.Equipments.Add(new ReportEquipmentViewModel { Speed = "2", RatedCurrent = "3" });
            test1.AfterEquipmentPowers = new List<EquipmentPowerInfo>();
            test1.AfterEquipmentPowers.Add(new EquipmentPowerInfo { AnnualPowerSavingAfterTech = "2", PowerSavingRate = "323" });
            test1.AfterEquipmentPowers.Add(new EquipmentPowerInfo { AnnualPowerSavingAfterTech = "2", PowerSavingRate = "323" });
            test1.AfterEquipmentPowers.Add(new EquipmentPowerInfo { AnnualPowerSavingAfterTech = "2", PowerSavingRate = "323" });
            test1.AfterPumpStations = new List<ReportPumpStationViewModel>();
            test1.AfterPumpStations.Add(new ReportPumpStationViewModel { EquipmentName = "1", SuppyPressure = "2" });
            test1.AfterPumpStations.Add(new ReportPumpStationViewModel { EquipmentName = "1", SuppyPressure = "2" });
            test1.AfterPumpStations.Add(new ReportPumpStationViewModel { EquipmentName = "1", SuppyPressure = "2" });
            test1.AfterPumpStations.Add(new ReportPumpStationViewModel { EquipmentName = "1", SuppyPressure = "2" });
            test1.AfterEquipments = new List<ReportEquipmentViewModel>();
            test1.AfterEquipments.Add(new ReportEquipmentViewModel { EquipmentName = "2", Speed = "2" });
            test1.AfterEquipments.Add(new ReportEquipmentViewModel { EquipmentName = "2", Speed = "2" });
            test1.AfterEquipments.Add(new ReportEquipmentViewModel { EquipmentName = "2", Speed = "2" });
            test1.PowerConsumptionInfos = new List<PowerConsumptionInfo>();
            test1.PowerConsumptionInfos.Add(new PowerConsumptionInfo { AnnualPowerConsumption = "2", PreTechPowerConsumption = "2" });
            test1.PowerConsumptionInfos.Add(new PowerConsumptionInfo { AnnualPowerConsumption = "2", PreTechPowerConsumption = "2" });
            test1.PowerConsumptionInfos.Add(new PowerConsumptionInfo { AnnualPowerConsumption = "2", PreTechPowerConsumption = "2", AnnualRunningHours = "333" });
            test1.AfterPowerConsumptionInfos = new List<PowerConsumptionInfo>();
            test1.AfterPowerConsumptionInfos.Add(new PowerConsumptionInfo { AnnualPowerConsumption = "3", PreTechPowerConsumption = "323" });
            test1.AfterPowerConsumptionInfos.Add(new PowerConsumptionInfo { AnnualPowerConsumption = "3", PreTechPowerConsumption = "323" });
            test1.AfterPowerConsumptionInfos.Add(new PowerConsumptionInfo { AnnualPowerConsumption = "3", PreTechPowerConsumption = "323" });
            word.Create("word.doc", test1);
        }