diff --git a/langguanApi/Model/CleanTransportation.cs b/langguanApi/Model/CleanTransportation.cs index 59bca40..742d266 100644 --- a/langguanApi/Model/CleanTransportation.cs +++ b/langguanApi/Model/CleanTransportation.cs @@ -39,7 +39,7 @@ /// /// 国五百分比 /// - public string V5Percent { get; set; } + public string V5Percent { get; set; } = "0"; /// /// 国五比例数量 /// @@ -47,7 +47,7 @@ /// /// 国五运输量百分比 /// - public string V5WeightPercent { get; set; } + public string V5WeightPercent { get; set; } = "0"; /// /// 国五运输量比例 /// @@ -55,7 +55,7 @@ /// /// 国六百分比 /// - public string V6Percent { get; set; } + public string V6Percent { get; set; } = "0"; /// /// 国六运输量 /// @@ -63,7 +63,7 @@ /// /// 国六运输量百分比 /// - public string V6WeightPercent { get; set; } + public string V6WeightPercent { get; set; } = "0"; /// /// 国六运输量 /// @@ -71,7 +71,7 @@ /// /// 电动百分比 /// - public string ElectricPrecent { get; set; } + public string ElectricPrecent { get; set; } = "0"; /// /// 电动运输量 /// @@ -79,7 +79,7 @@ /// /// 电动运输量百分比 /// - public string ElectricWeightPrecent { get; set; } + public string ElectricWeightPrecent { get; set; } = "0"; /// /// 电动运输量 /// @@ -87,7 +87,7 @@ /// /// 其他百分比 /// - public string OtherPrecent { get; set; } + public string OtherPrecent { get; set; } = "0"; /// /// 其他运输量 /// @@ -95,7 +95,7 @@ /// /// 其他运输量百分比 /// - public string OtherWeightPrecent { get; set; } + public string OtherWeightPrecent { get; set; } = "0"; /// /// 其他运输量 /// diff --git a/langguanApi/Service/TransportService.cs b/langguanApi/Service/TransportService.cs index a881e89..14922b4 100644 --- a/langguanApi/Service/TransportService.cs +++ b/langguanApi/Service/TransportService.cs @@ -119,11 +119,13 @@ namespace langguanApi.Service { if (!string.IsNullOrWhiteSpace(input.startTime)) { - result.cleans.Where(p => Convert.ToDateTime(p.Time) >= Convert.ToDateTime(input.startTime)).ToList(); + //c#集合筛选大于开始时间的数据 + result.cleans = result.cleans.Where(p => DateTime.Parse(p.Time) >= DateTime.Parse(input.startTime)).ToList(); + } if (!string.IsNullOrWhiteSpace(input.endTime)) { - result.cleans.Where(p => Convert.ToDateTime(p.Time) <= Convert.ToDateTime(input.endTime)).ToList(); + result.cleans = result.cleans.Where(p => DateTime.Parse(p.Time) <= DateTime.Parse(input.endTime)).ToList(); } result.cleans = result.cleans.Skip(input.current - 1).Take(input.pageSize).ToList(); }