duheng
2024-12-11 17a0baa0ef883689c73e3141d148a28a48d62cd6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
using Aspose.Words;
using Aspose.Words.Layout;
using Aspose.Words.Tables;
 
namespace HStation.WinFrmUI
{
    public class SimulationWordReport
    {
        public SimulationWordReport() : base()
        {
        }
 
        //文字描述运行模式介绍    二)运行情况与能耗分析中 "全年:"后
        private string _run_mode = "*******************************************************************";
 
        //运行时间计算方式  二)运行情况与能耗分析中  “年平均运行时间按:”后
        private string _avg_runtime_mode = "**************************";
 
        //按_Company_1公司循环水系统平均运行***小时    四)项目节电效益分析中
        private string _Company_1 = "****************";
 
        //按****公司循环水系统平均运行_Avg_Hour小时    四)项目节电效益分析中
        private string _Avg_Hour = "*******";
 
        //系统年节电量=_Electricity=******(万度)    四)项目节电效益分析中
        private string _Electricity = "*******";
 
        //系统年节电量=******=_Electricity_kWh(万度)    四)项目节电效益分析中
 
        private string _Electricity_kWh = "*******";
 
        //本案是在科维公司技术人员于_Time对***水系统进行详细调查     五)综述中
        private DateTime _Time = DateTime.Today;
 
        //本案是在科维公司技术人员于******对_System水系统进行详细调查     五)综述中
        private string _System = "***********";
 
        //通过技改节电效果如下(按年运行_Hour小时计):     五)综述中
        private string _Hour = "*******";
 
        //  非常感谢_Company_2公司各部门领导对节能工作的重视和支持 五)综述中 最后表感谢的部分
        private string _Company_2 = "****************";
 
        //非常感谢_Company_3公司技术人员对检测工作的大力配合,并提供宝贵资料及系统情况     五)综述中 最后表感谢的部分
        private string _Company_3 = "****************";
 
        //报告结尾 时间年
        private int _Year = DateTime.Today.Year;
 
        //报告结尾 时间月
        private int _month = DateTime.Today.Month;
 
        /// <summary>
        /// 创建word
        /// </summary>
        /// <param name="strFilePath"></param> 文件路径
        /// <returns></returns>
        public bool Create(string strFilePath, ReportViewModel reportViewModel)
        {
            MemoryStream stream = Create4Stream(reportViewModel);
            if (stream != null)
            {
                var data_bytes = stream.ToArray();
 
                using (var fileStream = new System.IO.FileStream(strFilePath, FileMode.OpenOrCreate))
                {
                    fileStream.Write(data_bytes, 0, data_bytes.Length);
                    fileStream.Close();
                }
                stream.Dispose();
            }
 
            return true;
        }
 
        protected MemoryStream Create4Stream(ReportViewModel reportViewModel)
        {
            Document doc = new Document();
            CreatePage(doc, reportViewModel);
 
            doc.RemoveChild(doc.FirstSection);//删除第一页空白
 
            MemoryStream strem = new MemoryStream();
 
            doc.Save(strem, Aspose.Words.SaveFormat.Doc);
 
            return strem;
        }
 
        protected void SetWordHander(Aspose.Words.Document doc, string title,string reportType)
        {
            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, reportType));
            builder.InsertHorizontalRule();
            // 移动到下一行,以便继续添加其他内容
            builder.MoveToDocumentStart();
        }
 
        protected void SetWordFooter(Aspose.Words.Document doc, string title,string reportType)
        {
            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, reportType));
            // 移动到下一行,以便继续添加其他内容
            builder.MoveToDocumentStart();
        }
 
        //正文
        private void CreatePage(Document doc, ReportViewModel reportViewModel)
        {
            Aspose.Words.Document src = new Aspose.Words.Document();
            Aspose.Words.DocumentBuilder builder = new Aspose.Words.DocumentBuilder(src);
            builder.SetSheet(Aspose.Words.Orientation.Portrait);
            SimulationWordReportHelper Text_center_25_black = new SimulationWordReportHelper(builder) { fontalignment = ParagraphAlignment.Center, fontsize = 25, isblod = true };//主标题
            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, reportViewModel.ProjectName,reportViewModel.ReportType);
            SetWordFooter(src, reportViewModel.ProjectName, reportViewModel.ReportType);
 
            builder.ParagraphFormat.LineSpacingRule = LineSpacingRule.Multiple;
            builder.ParagraphFormat.LineSpacing = 18; // 设置行距为1.5倍默认行距
 
            SimulationWordReportHelper Cell = new SimulationWordReportHelper(builder) { };
            //合并
            SimulationWordReportHelper Cell_v_merging_start = new SimulationWordReportHelper(builder) { verticalMerge = Aspose.Words.Tables.CellMerge.First };
            SimulationWordReportHelper Cell_v_merging_end = new SimulationWordReportHelper(builder) { verticalMerge = Aspose.Words.Tables.CellMerge.Previous };
            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}", 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}", reportViewModel.Description));
            Text_left_12_black.structureText("1.1、设备基本配置");
 
            #region 设别基本配置表
 
            var basic_config_table = builder.StartTable();
            Cell.SetFont(9);
            Cell_v_merging_start.structureCell("设备名称");
            Cell_v_merging_start.structureCell("设备位号");
            Cell_v_merging_start.structureCell("设备型号");
            Cell.structureCell("额定流量");
            Cell.structureCell("额定扬程");
            Cell_v_merging_start.structureCell("驱动方式");
            Cell.structureCell("额定电压");
            Cell.structureCell("额定电流");
            Cell.structureCell("额定功率");
            Cell.structureCell("额定因数");
            Cell.structureCell("转速  ");
            builder.EndRow();
 
            Cell_v_merging_end.structureCell("");
            Cell_v_merging_end.structureCell("");
            Cell_v_merging_end.structureCell("");
            Cell.structureCell("Q(m³/ h)");
            Cell.structureCell("H(m)");
            Cell_v_merging_end.structureCell("");
            Cell.structureCell("U(kV)");
            Cell.structureCell("I(A)");
            Cell.structureCell("P(kW)");
            Cell.structureCell("cosφ");
            Cell.structureCell("r/m  ");
            builder.EndRow();
            if (reportViewModel.Equipments != null)
            {
                foreach (var item in reportViewModel.Equipments)
                {
                    Cell.structureCell(item.EquipmentName);
                    Cell.structureCell(item.EquipmentNumber);
                    Cell.structureCell(item.EquipmentMainName);
                    Cell.structureCell(item.RatedFlow);
                    Cell.structureCell(item.RatedHead);
                    Cell.structureCell(item.TypeOfDrive);
                    Cell.structureCell("电机驱动");
                    Cell.structureCell(item.RatedCurrent);
                    Cell.structureCell(item.RatedPower);
                    Cell.structureCell(item.RatedFactor);
                    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;
            Processing_pagination(src, builder, basic_config_table);
 
            #endregion 设别基本配置表
 
            Text_left_12_black.structureLeft20Text("1.2、运行实际情况");
            Text_left_12_black.structureLeft20Text("1.2.1 循环水泵站运行状况");
 
            #region 循环水泵站运行状况表
 
            var pumpingStation_run_table = builder.StartTable();
            Cell.SetFont(9);
            Cell_v_merging_start.structureCell("设备名称");
            Cell_v_merging_start.structureCell("设备位号");
            Cell_h_merging_start.structureCell("泵");
            Cell_h_merging_end.structureCell("");
            Cell_h_merging_start.structureCell("电机");
            Cell_h_merging_end.structureCell("");
            Cell_h_merging_start.structureCell("母管");
            Cell_h_merging_end.structureCell("");
            Cell_h_merging_end.structureCell("");
            builder.EndRow();
 
            Cell_v_merging_end.structureCell("");
            Cell_v_merging_end.structureCell("");
            Cell.structureCell("出口压力标高");
            Cell.structureCell("出口阀开度");
            Cell.structureCell("运行电流");
            Cell.structureCell("功率");
            Cell.structureCell("总管流量");
            Cell.structureCell("供水压力/标高");
            Cell.structureCell("回水压力/标高");
            builder.EndRow();
 
            Cell_v_merging_end.structureCell("");
            Cell_v_merging_end.structureCell("");
            Cell.structureCell("MPa/m");
            Cell.structureCell("100%");
            Cell.structureCell("A");
            Cell.structureCell("kW");
            Cell.structureCell("m3/h");
            Cell.structureCell("MPa/m");
            Cell.structureCell("MPa/m");
            builder.EndRow();
            if (reportViewModel.PumpStations != null)
            {
                foreach (var item in reportViewModel.PumpStations)
                {
                    Cell.structureCell(item.EquipmentName);
                    Cell.structureCell(item.EquipmentNumber);
                    Cell.structureCell(item.OutletPressure);
                    Cell.structureCell(item.OutletValveOpening);
                    Cell.structureCell(item.RunningCurrent);
                    Cell.structureCell(item.Power);
                    Cell.structureCell(item.TotalFlow);
                    Cell.structureCell(item.SuppyPressure);
                    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();
            pumpingStation_run_table.AllowAutoFit = false;
            Processing_pagination(src, builder, pumpingStation_run_table);
 
            #endregion 循环水泵站运行状况表
 
            Text_left_12_black.structureLeft20Text("1.2.2 冷却塔运行状况");
 
            #region 冷却塔运行状况表
 
            var coolingtower_run_table = builder.StartTable();
            Cell.SetFont(9);
            Cell_v_merging_start.structureCell("设备名称");
            Cell_v_merging_start.structureCell("设备位号");
            Cell.structureCell("上塔管径");
            Cell.structureCell("上塔阀开度");
            Cell.structureCell("喷头高度");
            Cell.structureCell("风机电流");
            Cell.structureCell("上塔温度");
            Cell.structureCell("出水温度");
            Cell.structureCell("温差");
            builder.EndRow();
 
            Cell_v_merging_end.structureCell("");
            Cell_v_merging_end.structureCell("");
            Cell.structureCell("mm");
            Cell.structureCell("%");
            Cell.structureCell("m");
            Cell.structureCell("A");
            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.EndRow();
 
            Cell.structureCell("");
            Cell.structureCell("");
            Cell.structureCell("");
            Cell.structureCell("");
            Cell.structureCell("");
            Cell.structureCell("");
            Cell.structureCell("");
            Cell.structureCell("");
            Cell.structureCell("");
            builder.EndTable();
            coolingtower_run_table.AllowAutoFit = false;
            Processing_pagination(src, builder, coolingtower_run_table);
 
            #endregion 冷却塔运行状况表
 
            Text_left_12_black.structureLeft20Text("1.2.3 末端换热器运行状况");
 
            #region 末端换热器运行状况表
 
            var end_heatExchanger_run_table = builder.StartTable();
            Cell.SetFont(9);
            Cell_v_merging_start.structureCell("设备名称");
            Cell_v_merging_start.structureCell("设备位号");
            Cell.structureCell("供回水管径");
            Cell.structureCell("供水闸开度");
            Cell.structureCell("供水压力");
            Cell.structureCell("供水温度");
            Cell.structureCell("回水阀开度");
            Cell.structureCell("回水压力");
            Cell.structureCell("回水温度");
            Cell.structureCell("流量");
            Cell.structureCell("压差");
            Cell.structureCell("温差");
            builder.EndRow();
 
            Cell_v_merging_end.structureCell("");
            Cell_v_merging_end.structureCell("");
            Cell.structureCell("mm");
            Cell.structureCell("%");
            Cell.structureCell("MPa");
            Cell.structureCell("℃");
            Cell.structureCell("%");
            Cell.structureCell("MPa");
            Cell.structureCell("℃");
            Cell.structureCell("m3/h");
            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("");
            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("");
            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("");
            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("");
            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("");
            Cell.structureCell("");
            builder.EndTable();
            end_heatExchanger_run_table.AllowAutoFit = false;
            Processing_pagination(src, builder, end_heatExchanger_run_table);
 
            #endregion 末端换热器运行状况表
 
            Text_left_15_black.structureText("二)\t运行情况与能耗分析");
            Text_left_12_black.structureLeft20Text("2.1、运行模式及运行时间");
            Text_left_12_black.structureLeft20Text(string.Format("全年:{0}", _run_mode));
            Text_left_12_black.structureLeft20Text(string.Format("年平均运行时间:按{0}", _avg_runtime_mode));
            Text_left_12_black.structureLeft20Text("2.2、运行情况及能耗统计");
            Text_left_12_black.structureLeft20Text("根据实测参数、流体输送工程学复核,本循环水系统目前各种运行方式的实际能耗情况如下表:");
 
            #region 实际能耗情况表
 
            var actual_energy_consumption_table = builder.StartTable();
            Cell.SetFont(9);
            Cell.structureCell("项    目");
            Cell_h_merging_start.structureCell("水  泵  工  况");
            Cell_h_merging_end.structureCell("");
            Cell_h_merging_end.structureCell("");
            builder.EndRow();
 
            Cell.structureCell("运行模式");
            Cell.structureCell("技改前实耗功率 (kW)");
            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("合计");
            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);
 
            #endregion 实际能耗情况表
 
            Text_left_12_black.structureLeft20Text("2.3、高能耗分析");
            Text_left_12_black.structureLeft20Text("通过对系统运行工况进行检测分析,认为该系统存在 “低效率、高能耗”现象。主要表现在以下方面:");
            Text_left_12_black.structureLeft20Text("1)水泵特性与管网特性不相匹配,造成水泵偏离设计工况运行,其实际运行效率下降,造成较多的无效能耗,处于不经济运行状态;而当前循环水工况又并非是系统的最佳状态,优化管网阻抗整合运行参数,将使本系统具有较大的节能空间。");
            Text_left_12_black.structureLeft20Text("2)水泵性能曲线和管网特性曲线不相匹配,在水系统在输送过程中存在闭阀调节阻力,增加了输送过程中的无效能耗,降低水系统的输送效率;需要重新对系统进行建模分析,降低系统阻力,优化水泵扬程。");
            Text_left_12_black.structureLeft20Text("3)缺乏技术手段对换热设备进行量化调节,流量过大存在浪费。通过调试并配置优化,对换热器定量分析,制定换热器运行合理方案,改换热器为定量控制,最终消除无效流量,使系统处在优良状态下运行。");
 
            Text_left_15_black.structureText("三)\t节能技改方案与设计指标");
            Text_left_12_black.structureLeft20Text("3.1、设计依据");
            Text_left_12_black.structureLeft20Text("3.1.1 循环水泵运行功率:根据三相异步电动机运行功率计算公式P=√3×U×I×cosφ,也可以按照运行一段时间内电度表有功功率统计得出;");
            Text_left_12_black.structureLeft20Text("3.1.2 水泵总压力(扬程)计算公式:");
            Text_left_12_black.structureLeft20Text("H=(p出-p进)×102+(出口表高-进口液位高),再考虑进出口流速变化的动能损耗。");
            Text_left_12_black.structureLeft20Text("3.1.3 通过水泵性能曲线模拟,水泵运行在一定的工况下,其流量Q、扬程H、功率P、效率η相对应;实际性能与标准性能一般差异(主要为效率η指标)");
            Text_left_12_black.structureLeft20Text("3.1.4 管路系统压力降换算基本公式(i代表单位米长度管道上沿程阻力系数)");
 
            // 插入图片
            //  builder.Write("      ");
 
            Text_left_12_black.structureTextAndImage("00-core\\Pressure_conversion_formula_big1.2.png", 30, 150);
            //  builder.Write("      ");
            Text_left_12_black.structureTextAndImage("00-core\\Pressure_conversion_formula_small1.2.png", 35, 220);
            Text_left_12_black.structureLeft20Text("3.1.5 局部阻力计算公式");
            //      builder.Write("      ");
            Text_left_12_black.structureTextAndImage("00-core\\Local_resistance.png", 35, 60);
            Text_left_12_black.structureLeft20Text("3.1.6 阀门开度与局部阻力系数关系(参考)");
 
            #region 阀门开度与局部阻力系数关系表
 
            var Opening_resistance_table = builder.StartTable();
            Cell.SetFont(9);
            Cell.structureCell("开度α");
 
            if (reportViewModel.ValveOpens != null)
            {
                foreach (var item in reportViewModel.ValveOpens)
                {
                    Cell.structureCell(item.Name);
                }
                builder.EndRow();
                Cell.structureCell("ξ");
                foreach (var item in reportViewModel.ValveOpens)
                {
                    Cell.structureCell(item.MinorLoss);
                }
                builder.EndRow();
            }
            else
            {
                Cell.structureCell("开度α");
                Cell.structureCell("90");
                Cell.structureCell("80");
                Cell.structureCell("70");
                Cell.structureCell("60");
                Cell.structureCell("55");
                Cell.structureCell("50");
                Cell.structureCell("45");
                Cell.structureCell("40");
                Cell.structureCell("35");
                Cell.structureCell("30");
                Cell.structureCell("25");
                Cell.structureCell("20");
                Cell.structureCell("15");
                Cell.structureCell("10");
                builder.EndRow();
 
                Cell.structureCell("ξ");
                Cell.structureCell("0.22");
                Cell.structureCell("0.45");
                Cell.structureCell("1.18");
                Cell.structureCell("3.25");
                Cell.structureCell("5.50");
                Cell.structureCell("9.27");
                Cell.structureCell("15.0");
                Cell.structureCell("26.8");
                Cell.structureCell("45.0");
                Cell.structureCell("79.2");
                Cell.structureCell("152");
                Cell.structureCell("332");
                Cell.structureCell("945");
                Cell.structureCell("3620");
            }
            builder.EndTable();
            Opening_resistance_table.AllowAutoFit = false;
            Processing_pagination(src, builder, Opening_resistance_table);
 
            #endregion 阀门开度与局部阻力系数关系表
 
            Text_left_12_black.structureLeft20Text("3.2、设计过程");
            Text_left_12_black.structureLeft20Text("科维公司采用流体输送Go.Well技术对检测数据进行系统分析、研究,结合生产工艺特征,设计本循环水系统过程能量优化解决方案。");
            Text_left_12_black.structureLeft20Text("1)通过分析系统装置热负荷以及工艺特点,按经济供回水温差原则及供水压力与设计压力比较,判断流量的合理性,并确定合理流量,做到“装置侧合理用水、泵站侧高效供水,降低水送能耗指标;");
            Text_left_12_black.structureLeft20Text("2)对换热器及冷却塔的热工性能进行评估,针对性选择提高冷却效果的改造方案,以确保经济供回水温差实现的可行性;");
            Text_left_12_black.structureLeft20Text("3)运用计算机模拟技术分析管网水力节点平衡,得到可实现的最优管网性能曲线,即相应流量下所对应实际需要的最小阻力,降低系统管网阻抗,提高管网运行效率;");
            Text_left_12_black.structureLeft20Text("4)通过对泵站原有各种运行模式的工况分析,判断电机及水泵的实际运行效率是否高效,并结合装置侧所需的技术参数要求,提出最优的泵组搭配运行模式及运行参数,确定高效节能泵参数设计值,做好泵站优化设计;");
            Text_left_12_black.structureLeft20Text("5)借助三元流理论,采用国外最先进的“CFD”仿真模拟技术,通过精确模拟,设计出最优化的水力模型,确保ECOWELL高效泵性能可靠、运行稳定,并确保在各种运行模式下均处于高效运行。");
 
            Text_left_12_black.structureLeft20Text("3.3、泵站部分节能设计指标与技改方案");
            Text_left_12_black.structureLeft20Text("3.3.1 技改后设备配置情况");
            Text_left_12_black.AddBlankLine();
 
            #region 设备配置情况表
 
            var Device_configuration_table = builder.StartTable();
            Cell.SetFont(9);
            Cell_v_merging_start.structureCell("设备名称");
            Cell_v_merging_start.structureCell("设备位号");
            Cell_v_merging_start.structureCell("设备型号");
            Cell_v_merging_start.structureCell("台数");
            Cell.structureCell("额定扬程");
            Cell.structureCell("额定流量");
            Cell_v_merging_start.structureCell("驱动方式");
            Cell.structureCell("额定电压");
            Cell.structureCell("额定电流");
            Cell.structureCell("额定功率");
            Cell.structureCell("功率因数");
            Cell.structureCell("转速");
            builder.EndRow();
 
            Cell_v_merging_end.structureCell("");
            Cell_v_merging_end.structureCell("");
            Cell_v_merging_end.structureCell("");
            Cell_v_merging_end.structureCell("");
            Cell.structureCell("H(m)");
            Cell.structureCell("Q(m³/h)");
            Cell_v_merging_end.structureCell("");
            Cell.structureCell("U(kV)");
            Cell.structureCell("I(A)");
            Cell.structureCell("P(kW)");
            Cell.structureCell("cosφ");
            Cell.structureCell("r/m");
            builder.EndRow();
            if (reportViewModel.AfterEquipments != null)
            {
                foreach (var item in reportViewModel.AfterEquipments)
                {
                    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);
                    Cell.structureCell("电机驱动");
                    Cell.structureCell(item.RatedCurrent);
                    Cell.structureCell(item.RatedPower);
                    Cell.structureCell(item.RatedFactor);
                    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;
            Processing_pagination(src, builder, Device_configuration_table);
 
            #endregion 设备配置情况表
 
            Text_left_12_black.structureLeft20Text("3.3.2 技改后设备预计运行状况");
 
            #region 预计运行状况表
 
            var estimated_running_table = builder.StartTable();
            Cell.SetFont(9);
            Cell_v_merging_start.structureCell("设备名称");
            Cell_v_merging_start.structureCell("设备位号");
            Cell_h_merging_start.structureCell("泵");
            Cell_h_merging_end.structureCell("");
            Cell_h_merging_start.structureCell("电机");
            Cell_h_merging_end.structureCell("");
            Cell_h_merging_start.structureCell("母管");
            Cell_h_merging_end.structureCell("");
            Cell_h_merging_end.structureCell("");
            builder.EndRow();
 
            Cell_v_merging_end.structureCell("");
            Cell_v_merging_end.structureCell("");
            Cell.structureCell("出口压力标高");
            Cell.structureCell("出口阀开度");
            Cell.structureCell("运行电流");
            Cell.structureCell("功率");
            Cell.structureCell("总管流量");
            Cell.structureCell("供水压力标高");
            Cell.structureCell("回水压力标高");
            builder.EndRow();
 
            Cell_v_merging_end.structureCell("");
            Cell_v_merging_end.structureCell("");
            Cell.structureCell("MPa/m");
            Cell.structureCell("100%");
            Cell.structureCell("A");
            Cell.structureCell("kW");
            Cell.structureCell("m3/h");
            Cell.structureCell("MPa/m");
            Cell.structureCell("MPa/m");
            builder.EndRow();
            if (reportViewModel.AfterPumpStations != null)
            {
                foreach (var item in reportViewModel.AfterPumpStations)
                {
                    Cell.structureCell(item.EquipmentName);
                    Cell.structureCell(item.EquipmentNumber);
                    Cell.structureCell(item.OutletPressure);
                    Cell.structureCell(item.OutletValveOpening);
                    Cell.structureCell(item.RunningCurrent);
                    Cell.structureCell(item.Power);
                    Cell.structureCell(item.TotalFlow);
                    Cell.structureCell(item.SuppyPressure);
                    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;
            //builder.ParagraphFormat.KeepWithNext = true;
            //Processing_pagination(src, builder, estimated_running_table);
 
            #endregion 预计运行状况表
 
            Text_left_12_black.structureLeft20Text("3.3.3 末端换热器预计运行状况");
 
            #region 末端换热器预计运行状况表
 
            var estimatedendRun_table = builder.StartTable();
            Cell.SetFont(9);
            Cell_v_merging_start.structureCell("设备名称");
            Cell_v_merging_start.structureCell("设备位号");
            Cell.structureCell("供回水管径");
            Cell.structureCell("供水闸开度");
            Cell.structureCell("供水压力");
            Cell.structureCell("供水温度");
            Cell.structureCell("回水阀开度");
            Cell.structureCell("回水压力");
            Cell.structureCell("回水温度");
            Cell.structureCell("流量");
            Cell.structureCell("压差");
            Cell.structureCell("温差");
            builder.EndRow();
 
            Cell_v_merging_end.structureCell("");
            Cell_v_merging_end.structureCell("");
            Cell.structureCell("mm");
            Cell.structureCell("%");
            Cell.structureCell("MPa");
            Cell.structureCell("℃");
            Cell.structureCell("%");
            Cell.structureCell("MPa");
            Cell.structureCell("℃");
            Cell.structureCell("m3/h");
            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("");
            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("");
            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("");
            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("");
            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("");
            Cell.structureCell("");
            builder.EndTable();
            estimatedendRun_table.AllowAutoFit = false;
            Processing_pagination(src, builder, estimatedendRun_table);
 
            #endregion 末端换热器预计运行状况表
 
            Text_left_12_black.structureLeft20Text("3.3.2 技改后各运行模式下设备预计节电情况");
 
            #region 设备预计节电情况表
 
            var expected_power_savings = builder.StartTable();
            Cell.SetFont(9);
            Cell.structureCell("项    目");
            Cell_h_merging_start.structureCell("设  备  工  况");
            Cell_h_merging_end.structureCell("");
            Cell_h_merging_end.structureCell("");
            builder.EndRow();
 
            Cell.structureCell("运行模式");
            Cell.structureCell("技改后设计功率 (kW)");
            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("合计");
            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);
 
            #endregion 设备预计节电情况表
 
            Text_left_12_black.structureLeft20Text("3.4、技改说明");
            Text_left_12_black.structureLeft20Text("针对前述的系统存在的问题分析,目前系统在优化运行方面还有较大的提升空间,存在较大的节能潜力,从整体上提出以下解决方案:");
            Text_left_12_black.structureLeft20Text("a、优化水泵匹配实现节能;");
            Text_left_12_black.structureLeft20Text("b、改善水泵气蚀实现节能;");
            Text_left_12_black.structureLeft20Text("c、提高水泵运行效率节能;");
            Text_left_12_black.structureLeft20Text("d、实现合理供水,调整水力平衡,优化母管供、回水压力,降低阻力实现节能;");
 
            Text_left_15_black.structureText("四)\t项目节电效益分析");
            Text_left_12_black.structureLeft20Text("4.1、每年节电量");
            Text_left_12_black.structureLeft20Text(string.Format("按{0}公司循环水系统年平均运行{1}小时计,则系统年节电量:", _Company_1, _Avg_Hour));
            Text_left_12_black.structureLeft20Text(string.Format("系统年节电量={0}={1}(万度)", _Electricity, _Electricity_kWh));
            Text_left_12_black.structureLeft20Text("4.2、节电计算汇总如下表");
 
            #region 节电计算汇总表
 
            var summary_table = builder.StartTable();
            Cell.SetFont(9);
            Cell.structureCell("运行模式");
            Cell.structureCell("技改前实耗功率");
            Cell.structureCell("技改后设计功率");
            Cell.structureCell("小时节电量");
            Cell.structureCell("节电率");
            Cell.structureCell("运行时间");
            builder.EndRow();
 
            Cell.structureCell("单位");
            Cell.structureCell("(kW)");
            Cell.structureCell("(kW)");
            Cell.structureCell("(kW)");
            Cell.structureCell("(%)");
            Cell.structureCell("(h)");
            builder.EndRow();
            double savingRate = 0;
            double runningTime = 0;
            if (reportViewModel.PowerRelatedInfos != null)
            {
                foreach (var item in reportViewModel.PowerRelatedInfos)
                {
                    Cell.structureCell(item.RunMode);
                    Cell.structureCell(item.PreTechPowerConsumption);
                    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("");
            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);
 
            #endregion 节电计算汇总表
 
            Text_left_15_black.structureLeft20Text("五)\t综述");
            Text_left_12_black.structureLeft20Text(string.Format("本案是在科维公司技术人员于{0}对{1}水系统进行详细调查、检测基础上,采用流体输送Go·well技术对检测资料进行系统分析、研究,并结合该系统运行的负荷情况,精心设计的节能技改方案。", _Time, _System));
            Text_left_12_black.structureLeft20Text(string.Format("通过技改节电效果如下(按年运行(0)小时计):", _Hour));
 
            #region 设备预计节电情况表
 
            var power_saving_effect_table = builder.StartTable();
            Cell.SetFont(9);
            Cell.structureCell("序号");
            Cell.structureCell("设备名称");
            Cell.structureCell("技改前年耗电量(万度/年)");
            Cell.structureCell("节电率\r\n(%)");
            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(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("合计");
            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;
            Processing_pagination(src, builder, power_saving_effect_table);
 
            #endregion 设备预计节电情况表
 
            Text_left_12_black.structureLeft20Text("必须郑重指出,本案属流体输送Go·well技术设计成果,仅作为本系统节能技改投资决策和实施的依据。");
            Text_left_12_black.structureLeft20Text(string.Format("在此,非常感谢{0}公司各部门领导对节能工作的重视和支持,非常感谢{1}公司技术人员对检测工作的大力配合,并提供宝贵资料及系统情况。", _Company_2, _Company_3));
 
            Text_reight_10_black.structureText("浙江科维节能技术股份有限公司");
            Text_reight_10_black.structureLeft20Text(string.Format("{0}年{1}月", _Year, _month));
 
            doc.AppendDocument(src, Aspose.Words.ImportFormatMode.KeepSourceFormatting);
        }
 
        private void Processing_pagination(Document doc, DocumentBuilder builder, Table table)
        {
            // 创建LayoutCollector对象
            LayoutCollector collector = new LayoutCollector(doc);
 
            // 更新页面布局
            doc.UpdatePageLayout();
 
            // 获取表格的开始和结束页面索引
            int startPageIndex = collector.GetStartPageIndex(table);
            int endPageIndex = collector.GetEndPageIndex(table);
 
            // 判断表格是否适合放在当前页面上
            if (endPageIndex > startPageIndex)
            {
                // 表格不适合放在当前页面上,需要换页
                // 在表格前插入分页符
                builder.MoveTo(table.PreviousSibling);
                builder.InsertBreak(BreakType.PageBreak);
                builder.MoveToDocumentEnd();
            }
        }
    }
}