充电时长精度更改

zw
xjl 4 months ago
parent 455ef305a2
commit 9e11c8f58f

@ -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);

Loading…
Cancel
Save