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