From 9e11c8f58f0597f47c4b7729e32e23300cdb0d59 Mon Sep 17 00:00:00 2001 From: xjl <2595686544@qq.com> Date: Fri, 5 Jul 2024 11:03:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=85=E7=94=B5=E6=97=B6=E9=95=BF=E7=B2=BE?= =?UTF-8?q?=E5=BA=A6=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Charger/Handler/RecordChargeHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Service/Charger/Handler/RecordChargeHandler.cs b/Service/Charger/Handler/RecordChargeHandler.cs index 01f01e5..8252886 100644 --- a/Service/Charger/Handler/RecordChargeHandler.cs +++ b/Service/Charger/Handler/RecordChargeHandler.cs @@ -82,7 +82,7 @@ namespace Service.Charger.Handler StartSoc = msg.SocBefore, StopSoc = msg.SocAfter, - ChargeTimeCount = (int)timeSpan.TotalMinutes, + ChargeTimeCount = (int)Math.Round(timeSpan.TotalMinutes), ElecCount = Convert.ToDecimal(msg.ChargingPower), AcElecCount = Convert.ToDecimal(msg.AcMeterElecCount), StartAcElec = Convert.ToDecimal(msg.AcMeterDataBefore), @@ -111,7 +111,7 @@ namespace Service.Charger.Handler db.StartSoc = msg.SocBefore; db.StopSoc = msg.SocAfter; TimeSpan? timeSpan = (db.EndTime - db.StartTime); - db.ChargeTimeCount= (int)timeSpan?.TotalMinutes; + db.ChargeTimeCount= (int)Math.Round(Convert.ToDecimal(timeSpan?.TotalMinutes)); db.ElecCount = Convert.ToDecimal(msg.ChargingPower); db.AcElecCount = Convert.ToDecimal(msg.AcMeterElecCount); db.StartAcElec = Convert.ToDecimal(msg.AcMeterDataBefore);