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 89d278788..4ffc449fb 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 @@ -192,27 +192,28 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService { dto.setStationDeptIds(authorizedMap.getStationDeptIds()); dto.setMerchantDeptIds(authorizedMap.getMerchantDeptIds()); List orderListVOS = orderBasicInfoMapper.selectOrderBasicInfoList(dto); - if (CollectionUtils.isNotEmpty(orderListVOS)) { - for (OrderListVO orderListVO : orderListVOS) { - // 如果是微信支付,通过订单号查询微信支付单号 - // logger.info("如果是微信支付,通过订单号查询微信支付单号 orderListVO:{}", JSON.toJSONString(orderListVO)); - if (StringUtils.equals(PaymentInstitutionsEnum.ADAPAY.getValue(), orderListVO.getPaymentInstitutions())) { - AdapayCallbackRecord adapayCallbackRecord = adapayCallbackRecordService.selectByOrderCode(orderListVO.getOrderCode()); - orderListVO.setOutTradeNo(adapayCallbackRecord.getPaymentId()); - } else if (StringUtils.equals(PaymentInstitutionsEnum.WECHAT_PAY.getValue(), orderListVO.getPaymentInstitutions())) { - WxpayCallbackRecord wxpayCallbackRecord = wxpayCallbackRecordService.selectByOrderCode(orderListVO.getOrderCode()); - orderListVO.setOutTradeNo(wxpayCallbackRecord.getOutTradeNo()); - } - orderListVO.setPileConnectorCode(orderListVO.getPileSn() + orderListVO.getConnectorCode()); - orderListVO.setOrderStatusDescribe(transformOrderStatusDescribe(orderListVO.getOrderStatus(), orderListVO.getPayStatus())); + if (CollectionUtils.isEmpty(orderListVOS)) { + return orderListVOS; + } + for (OrderListVO orderListVO : orderListVOS) { + // 如果是微信支付,通过订单号查询微信支付单号 + // logger.info("如果是微信支付,通过订单号查询微信支付单号 orderListVO:{}", JSON.toJSONString(orderListVO)); + if (StringUtils.equals(PaymentInstitutionsEnum.ADAPAY.getValue(), orderListVO.getPaymentInstitutions())) { + AdapayCallbackRecord adapayCallbackRecord = adapayCallbackRecordService.selectByOrderCode(orderListVO.getOrderCode()); + orderListVO.setOutTradeNo(adapayCallbackRecord.getPaymentId()); + } else if (StringUtils.equals(PaymentInstitutionsEnum.WECHAT_PAY.getValue(), orderListVO.getPaymentInstitutions())) { + WxpayCallbackRecord wxpayCallbackRecord = wxpayCallbackRecordService.selectByOrderCode(orderListVO.getOrderCode()); + orderListVO.setOutTradeNo(wxpayCallbackRecord.getOutTradeNo()); + } + orderListVO.setPileConnectorCode(orderListVO.getPileSn() + orderListVO.getConnectorCode()); + orderListVO.setOrderStatusDescribe(transformOrderStatusDescribe(orderListVO.getOrderStatus(), orderListVO.getPayStatus())); - // 获取实时消费金额 - List chargingRealTimeData = getChargingRealTimeData(orderListVO.getTransactionCode()); - if (CollectionUtils.isNotEmpty(chargingRealTimeData)) { - RealTimeMonitorData realTimeMonitorData = chargingRealTimeData.get(0); - orderListVO.setRealTimeAmount(new BigDecimal(realTimeMonitorData.getChargingAmount())); - orderListVO.setRealTimeChargingDegree(realTimeMonitorData.getChargingDegree()); - } + // 获取实时消费金额 + List chargingRealTimeData = getChargingRealTimeData(orderListVO.getTransactionCode()); + if (CollectionUtils.isNotEmpty(chargingRealTimeData)) { + RealTimeMonitorData realTimeMonitorData = chargingRealTimeData.get(0); + orderListVO.setRealTimeAmount(new BigDecimal(realTimeMonitorData.getChargingAmount())); + orderListVO.setRealTimeChargingDegree(realTimeMonitorData.getChargingDegree()); } } return orderListVOS;