From 7c186e99839aad688388402511514c7392813b97 Mon Sep 17 00:00:00 2001 From: "autumn.g@foxmail.com" Date: Tue, 25 Jul 2023 15:57:36 +0800 Subject: [PATCH 1/3] =?UTF-8?q?update=20=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/OrderBasicInfoServiceImpl.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) 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); } // 计算报表 From 4249d04c615cbc6028100c1b0b67a949b9935939 Mon Sep 17 00:00:00 2001 From: "autumn.g@foxmail.com" Date: Tue, 25 Jul 2023 15:58:20 +0800 Subject: [PATCH 2/3] =?UTF-8?q?update=20=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 8827198d4..f0e7b1aa0 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 @@ -2134,9 +2134,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService { checkPileInfo(dto); // 保存订单到数据库 saveOrder2Database - OrderBasicInfo basicInfo = saveOrder2Database(dto); - - return basicInfo; + return saveOrder2Database(dto); } /** From 2e4a353c5dddc55410ad0a66eeb73e4f6010227c Mon Sep 17 00:00:00 2001 From: "autumn.g@foxmail.com" Date: Tue, 25 Jul 2023 16:01:41 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f0e7b1aa0..13af914e6 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 @@ -2175,7 +2175,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService { if (orderInfo == null) { throw new BusinessException(ReturnCodeEnum.CODE_QUERY_ORDER_NULL_ERROR); } - if (!StringUtils.equals(orderInfo.getPayStatus(), "0")) { + if (!StringUtils.equals(orderInfo.getPayStatus(), OrderPayStatusEnum.unpaid.getValue())) { // 订单已支付 throw new BusinessException(ReturnCodeEnum.CODE_ORDER_IS_NOT_TO_BE_PAID_ERROR); }