diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java index c605360f5..8827198d4 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java @@ -2030,25 +2030,30 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService { BigDecimal totalSettleAmount = BigDecimal.ZERO; List orderCodeList = Lists.newArrayList(); for (OrderListVO vo : orderListVOS) { - // 统计orderAmount大于0的 - String orderAmount = vo.getOrderAmount(); - if (StringUtils.isBlank(orderAmount)) { - // 没有订单消费金额,不统计 + // 统计结算金额大于0的 + BigDecimal settleAmount = StringUtils.isBlank(vo.getSettleAmount()) + ? BigDecimal.ZERO + : new BigDecimal(vo.getChargingDegree()); + if (settleAmount.compareTo(BigDecimal.ZERO) <= 0) { + // 只统计用电量大于0的 continue; } + + // 订单消费金额 + String orderAmount = vo.getOrderAmount(); + // 用电度数 BigDecimal chargingDegree = StringUtils.isBlank(vo.getChargingDegree()) ? BigDecimal.ZERO : new BigDecimal(vo.getChargingDegree()); - if (chargingDegree.compareTo(BigDecimal.ZERO) <= 0) { - // 只统计用电量大于0的 - continue; - } + // 充电度数累计 useElectricity = useElectricity.add(chargingDegree); + // 充电次数 chargeNum += 1; orderCodeList.add(vo.getOrderCode()); + // 充电时间累计 if (StringUtils.isNotBlank(vo.getChargeStartTime()) && StringUtils.isNotBlank(vo.getChargeEndTime())) { long l = DateUtils.intervalTime(vo.getChargeStartTime(), vo.getChargeEndTime()); @@ -2071,8 +2076,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService { totalVirtualAmount = totalVirtualAmount.add(new BigDecimal(virtualAmount)); // 结算金额 - String settleAmount = StringUtils.isNotBlank(vo.getSettleAmount()) ? vo.getSettleAmount() : Constants.ZERO; - totalSettleAmount = totalSettleAmount.add(new BigDecimal(settleAmount)); + totalSettleAmount = totalSettleAmount.add(settleAmount); } // 计算报表