From 679775d2cdfab3fd34c31e640a5199726de821e5 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期五, 17 一月 2025 20:33:20 +0800 Subject: [PATCH] bug修改 --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java | 50 +++++++++++++++++++++++++++++--------------------- 1 files changed, 29 insertions(+), 21 deletions(-) diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java index 1511b7c..1b60d48 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java @@ -1261,16 +1261,6 @@ BigDecimal refundMoney = new BigDecimal("0"); BigDecimal paymentMoney = new BigDecimal("0"); List<String> collect2 = list.stream().map(TChargingOrder::getCode).collect(Collectors.toList()); - StringBuilder stringBuilder2 = new StringBuilder(); - List<UploadRealTimeMonitoringData> uploadRealTimeMonitoringData2 = new ArrayList<>(); - for (String s : collect2) { - stringBuilder2.append(s).append(","); - } - if (stringBuilder2.length()>0){ - StringBuilder ids = stringBuilder2.deleteCharAt(stringBuilder2.length() - 1); - uploadRealTimeMonitoringData2 = uploadRealTimeMonitoringDataClient.getOrderInfoByCodes(ids.toString()).getData(); - - } for (ChargingOrderVO chargingOrderVO : list) { if (roleType == 2){ for (Integer siteId : siteIds) { @@ -1297,11 +1287,13 @@ // 充电订单 明细记录 List<TChargingOrderAccountingStrategy> chargingOrderId = chargingOrderAccountingStrategyService.list(new QueryWrapper<TChargingOrderAccountingStrategy>() .eq("charging_order_id", chargingOrderVO.getId())); - UploadRealTimeMonitoringData data5 = uploadRealTimeMonitoringData2.stream().filter(e -> e.getTransaction_serial_number().equals(chargingOrderVO.getCode())) - .findFirst().orElse(null); - if (data5!=null && data5.getCumulative_charging_time()!=null){ - long l = data5.getCumulative_charging_time() * 60L; - chargingOrderVO.setChargingSecond(l); + if (chargingOrderVO.getStartTime()!=null && chargingOrderVO.getEndTime()!=null){ + LocalDateTime startTime = chargingOrderVO.getStartTime(); + LocalDateTime endTime = chargingOrderVO.getEndTime(); + // 计算时间差 单位秒 + long between = ChronoUnit.SECONDS.between(startTime, endTime); + chargingOrderVO.setChargingSecond(between); + } // 充电时段数 int size = chargingOrderId.size(); @@ -1336,12 +1328,13 @@ if (chargingOrderVO.getChargingCapacity()!=null){ total = total.add(chargingOrderVO.getElectricity()!=null?chargingOrderVO.getElectricity():new BigDecimal("0")); } - LocalDateTime startTime = chargingOrderVO.getStartTime(); - LocalDateTime endTime = chargingOrderVO.getStartTime(); - // 计算时间差 单位秒 - long between = ChronoUnit.SECONDS.between(startTime, endTime); - time+=between; - + if (chargingOrderVO.getStartTime()!=null && chargingOrderVO.getEndTime()!=null){ + LocalDateTime startTime = chargingOrderVO.getStartTime(); + LocalDateTime endTime = chargingOrderVO.getEndTime(); + // 计算时间差 单位秒 + long between = ChronoUnit.SECONDS.between(startTime, endTime); + time+=between; + } List<TChargingOrderRefund> list2 = chargingOrderRefunds.stream().filter(e -> e.getChargingOrderId() != null && e.getChargingOrderId().equals(chargingOrderVO.getId())) .collect(Collectors.toList()); for (TChargingOrderRefund tChargingOrderRefund : list2) { @@ -1634,6 +1627,21 @@ // 不分页 PageInfo<ChargingOrderListVO> pageInfo1 = new PageInfo<>(1,999999999); List<ChargingOrderListVO> list1 = this.baseMapper.chargingList(pageInfo1,dto,startTime1,startTime2,endTime1,endTime2); + for (ChargingOrderListVO chargingOrderListVO : list1) { + List<Integer> integers = new ArrayList<>(); + integers.add(chargingOrderListVO.getSiteId()); + Site site = sites.stream().filter(e -> e.getId().equals(chargingOrderListVO.getSiteId())).findFirst().orElse(null); + if (site!=null){ + chargingOrderListVO.setSiteName(site.getName()); + } + if (chargingOrderListVO.getChargingGunId()!=null && chargingOrderListVO.getChargingPileId()!=null){ + TChargingGun data1 = chargingGunClient.getChargingGunById(chargingOrderListVO.getChargingGunId()).getData(); + TChargingPile data2 = chargingPileClient.getChargingPileById(chargingOrderListVO.getChargingPileId()).getData(); + if (data2 != null && data1 != null) { + chargingOrderListVO.setTerminalName(data2.getName() + "-" + data1.getName()); + } + } + } chargingOrderTimeVO.setExportList(list1); chargingOrderTimeVO.setOrderCount(list1.size()); // 计算充电总度数 -- Gitblit v1.7.1