From 389f4b1339184c0d9732748716062621e9b7abed Mon Sep 17 00:00:00 2001 From: tq <1916474859@qq,com> Date: Tue, 25 Jun 2024 13:40:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/MyTask/CountDayOrderTask.cs | 9 +++++---- Service/Station/ChargeOrderService.cs | 2 +- Service/Station/SwapOrderService.cs | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Service/MyTask/CountDayOrderTask.cs b/Service/MyTask/CountDayOrderTask.cs index c29d736..9172aaf 100644 --- a/Service/MyTask/CountDayOrderTask.cs +++ b/Service/MyTask/CountDayOrderTask.cs @@ -146,15 +146,16 @@ public class CountDayOrderTask : ITask .Sum(order => (order.SwapEndTime.Value - order.SwapBeginTime.Value).TotalMinutes); // 赋值 - dayCount.AvgChgTime = avgMinutes.ToString(); - dayCount.AvgRepTime = avgRepTime.ToString(); - dayCount.SwapDate = DateTime.Now.ToString(); + dayCount.AvgChgTime = avgMinutes.ToString("F2"); + dayCount.AvgRepTime = avgRepTime.ToString("F2"); + dayCount.SwapDate = DateTime.Now.AddDays(-1).ToString(); + dayCount.FristSwapTime = firstSwapOrder?.SwapBeginTime?.ToString() ?? null; dayCount.StopTime = lastSwapOrder?.SwapEndTime?.ToString() ?? null; dayCount.ChgCount = chgCount; dayCount.ToltalSwapCount = totalSwapCount; - dayCount.ToltalSwapAllTime = totalMinutes; + dayCount.ToltalSwapAllTime = Math.Round(totalMinutes, 2); dayCount.State = StaticStationInfo.StationStatus; _ExStationDayRunResultService.Insert(dayCount); diff --git a/Service/Station/ChargeOrderService.cs b/Service/Station/ChargeOrderService.cs index 61c04a8..b350526 100644 --- a/Service/Station/ChargeOrderService.cs +++ b/Service/Station/ChargeOrderService.cs @@ -195,7 +195,7 @@ public class ChargeOrderService : BaseServices // 昨天 23:59:59 DateTime endOfYesterday = startOfYesterday.AddDays(1).AddTicks(-1); - Expression> predicate = x => x.CreatedTime >= startOfYesterday && x.CreatedTime <= endOfYesterday; + Expression> predicate = x => x.StartTime >= startOfYesterday && x.StartTime <= endOfYesterday; return QueryListByClause(predicate); } diff --git a/Service/Station/SwapOrderService.cs b/Service/Station/SwapOrderService.cs index 319927b..a264f59 100644 --- a/Service/Station/SwapOrderService.cs +++ b/Service/Station/SwapOrderService.cs @@ -187,7 +187,7 @@ public class SwapOrderService : BaseServices // 昨天 23:59:59 DateTime endOfYesterday = startOfYesterday.AddDays(1).AddTicks(-1); - Expression> predicate = x => x.CreatedTime >= startOfYesterday && x.CreatedTime <= endOfYesterday; + Expression> predicate = x => x.SwapBeginTime >= startOfYesterday && x.SwapBeginTime <= endOfYesterday; return QueryListByClause(predicate); }