From 318ebf37b0542588a518d7639f37fac4b51fdbdb Mon Sep 17 00:00:00 2001 From: panshulin Date: Thu, 2 Dec 2021 10:05:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8E=B7=E5=8F=96=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E6=8A=9B=E5=87=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E9=9C=80=E8=A6=81=E8=BF=94=E5=9B=9E=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/XhpcHistoryOrderServiceImpl.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java index 5096af81..cce8aa18 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java @@ -182,9 +182,8 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService { } return AjaxResult.success(byId); } catch (Exception e) { - + return AjaxResult.error(e.getMessage()); } - return AjaxResult.success(); } @Override @@ -239,13 +238,13 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService { } xhpcChargeOrder.setEndSoc(cacheRealtimeData.getSoc() + ""); //充电时长 - Long tiem = Long.valueOf(cacheRealtimeData.getChargingTime() / 1000); - if (tiem > 3600) { - long hours = tiem / 3600; - double mins = (double) ((tiem - (hours * 3600)) / 60); + long time = (long) (cacheRealtimeData.getChargingTime() / 1000); + if (time > 3600) { + long hours = time / 3600; + double mins = (double) ((time - (hours * 3600)) / 60); xhpcChargeOrder.setChargingTime(hours + "时" + new BigDecimal(mins).setScale(0) + "分"); } else { - double mins = (double) (tiem / 60); + double mins = (double) (time / 60); xhpcChargeOrder.setChargingTime(new BigDecimal(mins).setScale(0) + "分"); } BigDecimal decimal = new BigDecimal(10000);