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 e07278c27..46a59beb7 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 @@ -2086,24 +2086,37 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService { BigDecimal totalVirtualAmount = BigDecimal.ZERO; BigDecimal totalSettleAmount = BigDecimal.ZERO; for (OrderListVO vo : orderListVOS) { - BigDecimal chargingDegree = new BigDecimal(vo.getChargingDegree()); + // 统计orderAmount大于0的 + String orderAmount = vo.getOrderAmount(); + if (StringUtils.isBlank(orderAmount)) { + // 没有订单消费金额,不统计 + continue; + } + // 用电度数 + 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; - // 充电时间 - long l = DateUtils.intervalTime(vo.getChargeStartTime(), vo.getChargeEndTime()); - chargeTime += l; + + // 充电时间累计 + if (StringUtils.isNotBlank(vo.getChargeStartTime()) && StringUtils.isNotBlank(vo.getChargeEndTime())) { + long l = DateUtils.intervalTime(vo.getChargeStartTime(), vo.getChargeEndTime()); + chargeTime += l; + } + // 电费金额 totalElectricityAmount = totalElectricityAmount.add(vo.getTotalElectricityAmount()); // 服务费金额 totalServiceAmount = totalServiceAmount.add(vo.getTotalServiceAmount()); // 订单金额 - totalOrderAmount = totalOrderAmount.add(new BigDecimal(vo.getOrderAmount())); + totalOrderAmount = totalOrderAmount.add(new BigDecimal(orderAmount)); // 虚拟金额 totalVirtualAmount = totalVirtualAmount.add(new BigDecimal(vo.getVirtualAmount())); // 结算金额 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/OrderListVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/OrderListVO.java index b065491c0..9dc40b133 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/OrderListVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/OrderListVO.java @@ -123,6 +123,11 @@ public class OrderListVO { @Excel(name = "支付状态", dictType = "pay_status") private String payStatus; + /** + * 支付时间 + */ + private String payTime; + /** * 起始soc */ diff --git a/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml index 583a04c82..d5fca6327 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml @@ -175,6 +175,7 @@ t1.pay_mode as payMode, t1.pay_status as payStatus, t1.pay_amount as payAmount, + t1.pay_time as payTime, t1.order_amount as orderAmount, t1.virtual_amount as virtualAmount, t1.settle_amount as settleAmount,