From d49f661eab8caa93e943a10ba2afe6569d101867 Mon Sep 17 00:00:00 2001 From: Lemon Date: Fri, 27 Oct 2023 16:50:23 +0800 Subject: [PATCH] update --- .../impl/OrderBasicInfoServiceImpl.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 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 dd5caa539..ec92ce8f6 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 @@ -1954,17 +1954,19 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService { orderCodeList.addAll(Lists.newArrayList(StringUtils.split(indexOrderInfoVO.getOrderCodes(), ","))); } - // 查询对应数据 - IndexOrderInfoVO detailInfo = orderBasicInfoMapper.getIndexOrderDetail(orderCodeList); - - vo.setTotalOrderAmount(totalOrderAmount.toString()); - vo.setTotalElectricity(totalElectricity.toString()); - vo.setTotalPeakUsedElectricity(detailInfo.getTotalPeakUsedElectricity()); - vo.setTotalFlatUsedElectricity(detailInfo.getTotalFlatUsedElectricity()); - vo.setTotalSharpUsedElectricity(detailInfo.getTotalSharpUsedElectricity()); - vo.setTotalValleyUsedElectricity(detailInfo.getTotalValleyUsedElectricity()); - - resultList.add(vo); + if (CollectionUtils.isNotEmpty(orderCodeList)) { + // 查询对应数据 + IndexOrderInfoVO detailInfo = orderBasicInfoMapper.getIndexOrderDetail(orderCodeList); + vo.setTotalOrderAmount(totalOrderAmount.toString()); + vo.setTotalElectricity(totalElectricity.toString()); + if (detailInfo != null) { + vo.setTotalPeakUsedElectricity(detailInfo.getTotalPeakUsedElectricity()); + vo.setTotalFlatUsedElectricity(detailInfo.getTotalFlatUsedElectricity()); + vo.setTotalSharpUsedElectricity(detailInfo.getTotalSharpUsedElectricity()); + vo.setTotalValleyUsedElectricity(detailInfo.getTotalValleyUsedElectricity()); + } + resultList.add(vo); + } } resultList = resultList.stream().sorted(Comparator.comparing(IndexOrderInfoVO::getDate)).collect(Collectors.toList()); return resultList;