From 337993c24322c142b365298d2b2782c8f5d91013 Mon Sep 17 00:00:00 2001 From: pangwenpeng <17302161021@163.com> Date: Wed, 28 Aug 2024 16:15:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E6=B4=81=E8=BF=90=E8=BE=93=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- langguanApi/Model/CleanTransportation.cs | 16 ++++++++-------- langguanApi/Service/TransportService.cs | 6 ++++-- 2 files changed, 12 insertions(+), 10 deletions(-) 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(); }