diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java index 84da0e23..9ac56cd0 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java @@ -449,12 +449,13 @@ public class XhpcHistoryOrderController extends BaseController { continue; } int endHour = DateUtil.hour(endTime, true); - //没有跨时段 XhpcStatisticsTimeInterval xhpcSt = new XhpcStatisticsTimeInterval(); xhpcSt.setStatus(endHour+1); xhpcSt.setChargingDegree(xhpc.getChargingDegree()); - xhpcSt.setChargingTime(new BigDecimal(xhpc.getChargingTimeNumber()).divide(new BigDecimal(3600),2, BigDecimal.ROUND_DOWN)); + if(xhpc.getChargingTimeNumber() !=null){ + xhpcSt.setChargingTime(new BigDecimal(xhpc.getChargingTimeNumber()).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_DOWN)); + } xhpcSt.setChargingNumber(1); xhpcSt.setPowerPrice(xhpc.getPowerPriceTotal()); xhpcSt.setServicePrice(xhpc.getServicePriceTotal()); @@ -894,7 +895,9 @@ public class XhpcHistoryOrderController extends BaseController { for (XhpcChargeHistoryOrder xhpc:list) { XhpcStatisticsStation xhpcSt =new XhpcStatisticsStation(); xhpcSt.setChargingDegree(xhpc.getChargingDegree()); - xhpcSt.setChargingTime(new BigDecimal(xhpc.getChargingTimeNumber()).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_DOWN)); + if(xhpc.getChargingTimeNumber() !=null){ + xhpcSt.setChargingTime(new BigDecimal(xhpc.getChargingTimeNumber()).divide(new BigDecimal(3600), 2, BigDecimal.ROUND_DOWN)); + } xhpcSt.setChargingNumber(1); xhpcSt.setPowerPrice(xhpc.getPowerPriceTotal()); xhpcSt.setServicePrice(xhpc.getServicePriceTotal()); 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 32100728..eb52985a 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 @@ -551,6 +551,18 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService { private Map getBigDecimal(String actPrice, BigDecimal powerPriceTotal, BigDecimal servicePriceTotal, XhpcChargeOrder chargeOrder, Long rateModelId, Date startTime2, Date updateTime2, BigDecimal chargingDegree, List> list) { Map map = new HashMap<>(); + if(chargingDegree.compareTo(new BigDecimal(0))==0){ + Map map1 = new HashMap<>(); + map1.put("time", 0); + map1.put("powerPrice", 0); + map1.put("servicePrice", 0); + map1.put("chargingDegree", chargeOrder.getChargingDegree()); + map1.put("actPrice", actPrice); + list.add(map1); + map.put("list", list);//数据列表 + return map; + } + //算出相差时间,分 BigDecimal decimal = new BigDecimal((updateTime2.getTime() - startTime2.getTime()) / 60000).setScale(2); //每分钟多少度 diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml index 15cd2ce5..9a56dece 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcChargeOrderMapper.xml @@ -612,6 +612,6 @@