diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs index 96e0bd6..50339a3 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs @@ -196,20 +196,26 @@ public partial class MainViewModel : INotifyPropertyChanged var reportDatas = new ConcurrentBag(); //foreach (var entry in data) - data.Where(it => it.OrigOcc == "OccWire" && !(it?.Properties["WireName"]?.GetDisplayValue()?.StartsWith("导线") ?? false)).AsParallel().WithDegreeOfParallelism(1).ForAll(entry => - { - var obj = new ReportModel(); - foreach (var column in columns) + data.Where(it => + it.OrigOcc == "OccWire" + && !(it?.Properties["WireName"]?.GetDisplayValue()?.StartsWith("导线") ?? false) + ) + .AsParallel() + .WithDegreeOfParallelism(8) + .ForAll(entry => { - if (!entry.Properties.ContainsKey(column.ColumnID)) continue; - var value = entry.Properties[column.ColumnID].GetDisplayValue(); + var obj = new ReportModel(); + foreach (var column in columns) + { + if (!entry.Properties.ContainsKey(column.ColumnID)) continue; + var value = entry.Properties[column.ColumnID].GetDisplayValue(); - var property = typeof(ReportModel).GetProperty(column.ID); - property?.SetValue(obj, value ?? ""); + var property = typeof(ReportModel).GetProperty(column.ID); + property?.SetValue(obj, value ?? ""); + } + reportDatas.Add(obj); } - reportDatas.Add(obj); - } ); return Task.FromResult(reportDatas.ToList()); }