统计优化

zw
tq 5 months ago
parent 7319365131
commit 389f4b1339

@ -146,15 +146,16 @@ public class CountDayOrderTask : ITask
.Sum(order => (order.SwapEndTime.Value - order.SwapBeginTime.Value).TotalMinutes); .Sum(order => (order.SwapEndTime.Value - order.SwapBeginTime.Value).TotalMinutes);
// 赋值 // 赋值
dayCount.AvgChgTime = avgMinutes.ToString(); dayCount.AvgChgTime = avgMinutes.ToString("F2");
dayCount.AvgRepTime = avgRepTime.ToString(); dayCount.AvgRepTime = avgRepTime.ToString("F2");
dayCount.SwapDate = DateTime.Now.ToString(); dayCount.SwapDate = DateTime.Now.AddDays(-1).ToString();
dayCount.FristSwapTime = firstSwapOrder?.SwapBeginTime?.ToString() ?? null; dayCount.FristSwapTime = firstSwapOrder?.SwapBeginTime?.ToString() ?? null;
dayCount.StopTime = lastSwapOrder?.SwapEndTime?.ToString() ?? null; dayCount.StopTime = lastSwapOrder?.SwapEndTime?.ToString() ?? null;
dayCount.ChgCount = chgCount; dayCount.ChgCount = chgCount;
dayCount.ToltalSwapCount = totalSwapCount; dayCount.ToltalSwapCount = totalSwapCount;
dayCount.ToltalSwapAllTime = totalMinutes; dayCount.ToltalSwapAllTime = Math.Round(totalMinutes, 2);
dayCount.State = StaticStationInfo.StationStatus; dayCount.State = StaticStationInfo.StationStatus;
_ExStationDayRunResultService.Insert(dayCount); _ExStationDayRunResultService.Insert(dayCount);

@ -195,7 +195,7 @@ public class ChargeOrderService : BaseServices<ChargeOrder>
// 昨天 23:59:59 // 昨天 23:59:59
DateTime endOfYesterday = startOfYesterday.AddDays(1).AddTicks(-1); DateTime endOfYesterday = startOfYesterday.AddDays(1).AddTicks(-1);
Expression<Func<ChargeOrder, bool>> predicate = x => x.CreatedTime >= startOfYesterday && x.CreatedTime <= endOfYesterday; Expression<Func<ChargeOrder, bool>> predicate = x => x.StartTime >= startOfYesterday && x.StartTime <= endOfYesterday;
return QueryListByClause(predicate); return QueryListByClause(predicate);
} }

@ -187,7 +187,7 @@ public class SwapOrderService : BaseServices<SwapOrder>
// 昨天 23:59:59 // 昨天 23:59:59
DateTime endOfYesterday = startOfYesterday.AddDays(1).AddTicks(-1); DateTime endOfYesterday = startOfYesterday.AddDays(1).AddTicks(-1);
Expression<Func<SwapOrder, bool>> predicate = x => x.CreatedTime >= startOfYesterday && x.CreatedTime <= endOfYesterday; Expression<Func<SwapOrder, bool>> predicate = x => x.SwapBeginTime >= startOfYesterday && x.SwapBeginTime <= endOfYesterday;
return QueryListByClause(predicate); return QueryListByClause(predicate);
} }

Loading…
Cancel
Save