From 0a6ffb2d7ac5135f543bc00f2cadd2704885cac5 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期五, 01 十一月 2024 09:59:02 +0800 Subject: [PATCH] bug修改 --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java | 21 +++++++++------------ 1 files changed, 9 insertions(+), 12 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 494f449..767007b 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 @@ -1203,8 +1203,8 @@ BigDecimal electronicMoney = new BigDecimal("0"); BigDecimal serviceMoney = new BigDecimal("0"); for (ChargingOrderVO chargingOrderVO : list) { - chargingOrderVO.setCommissionAmount(chargingOrderVO.getServiceCharge().multiply(new BigDecimal("0.006"))); - chargingOrderVO.setPlatFormMoney(chargingOrderVO.getServiceCharge().multiply(new BigDecimal("0.006"))); + chargingOrderVO.setCommissionAmount(chargingOrderVO.getOrderAmount().multiply(new BigDecimal("0.006"))); + chargingOrderVO.setPlatFormMoney(chargingOrderVO.getOrderAmount().multiply(new BigDecimal("0.006"))); chargingOrderVO.setUid(chargingOrderVO.getId()+""); TChargingGun data3 = chargingGunClient.getChargingGunById(chargingOrderVO.getChargingGunId()).getData(); TChargingPile data2 = chargingPileClient.getChargingPileById(chargingOrderVO.getChargingPileId()).getData(); @@ -1610,9 +1610,7 @@ @Override public ChargingOrderListInfoVO chargingInfo(String uid) { TChargingOrder chargingOrder= this.getById(uid); - ChargingOrderListInfoVO chargingOrderListInfoVO = new ChargingOrderListInfoVO(); - chargingOrderListInfoVO.setStatus(chargingOrder.getStatus()); BigDecimal bigDecimal = new BigDecimal("0.006"); if (chargingOrder.getOrderAmount()!=null){ @@ -1661,7 +1659,7 @@ if (uploadRealTimeMonitoringData.getOutput_current()!=null&& uploadRealTimeMonitoringData.getOutput_voltage()!=null){ uploadRealTimeMonitoringData.setPower(uploadRealTimeMonitoringData.getOutput_voltage() - .multiply(uploadRealTimeMonitoringData.getOutput_current())); + .multiply(uploadRealTimeMonitoringData.getOutput_current()).divide(new BigDecimal(1000),2, BigDecimal.ROUND_HALF_UP)); } } if (!data6.isEmpty()){ @@ -1691,7 +1689,6 @@ chargingOrderListInfoVO.setCouponDiscountAmount(chargingOrder.getCouponDiscountAmount()); chargingOrderListInfoVO.setVipDiscountAmount(chargingOrder.getVipDiscountAmount()); chargingOrderListInfoVO.setSharingAmount(chargingOrder.getSharingAmount()); - chargingOrderListInfoVO.setCommissionAmount(chargingOrder.getCommissionAmount()); // 查询费用明细列表 List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.lambdaQuery() .eq(TChargingOrderAccountingStrategy::getChargingOrderId, chargingOrder.getId()) @@ -1821,7 +1818,7 @@ BeanUtils.copyProperties(strategyDetail, vo1); vo1.setStart(sdfs.parse(vo.getStart_time().split(" ")[0] + " " + strategyDetail.getStartTime() + ":00").getTime()); vo1.setEnd(sdfs.parse(vo.getStart_time().split(" ")[0] + " " + strategyDetail.getEndTime() + ":00").getTime()); - vo1.setServiceCharge(sharp_peak_charge); + vo1.setChargingCapacity(sharp_peak_charge); lists.add(vo1); } catch (IllegalAccessException e) { throw new RuntimeException(e); @@ -1864,10 +1861,10 @@ } catch (ParseException e) { throw new RuntimeException(e); } + System.err.println(start.getTime() + "\n" + end.getTime() + "\n" + lists.get(0).getStart() + "\n" + lists.get(0).getEnd()); + + for (AccountingStrategyDetailOrderVo strategyDetail : lists) { - if(strategyDetail.getStart() < start.getTime() || strategyDetail.getEnd() > end.getTime()){ - continue; - } BigDecimal sharp_peak_charge = strategyDetail.getChargingCapacity(); TChargingOrderAccountingStrategy chargingOrderAccountingStrategy = new TChargingOrderAccountingStrategy(); chargingOrderAccountingStrategy.setChargingOrderId(chargingOrder.getId()); @@ -1883,9 +1880,9 @@ chargingOrderAccountingStrategy.setStartTime(strategyDetail.getStartTime()); } if(end.getTime() >= strategyDetail.getEnd()){ - chargingOrderAccountingStrategy.setStartTime(strategyDetail.getEndTime()); + chargingOrderAccountingStrategy.setEndTime(strategyDetail.getEndTime()); }else{ - chargingOrderAccountingStrategy.setStartTime(sdf2.format(end)); + chargingOrderAccountingStrategy.setEndTime(sdf2.format(end)); } //已充电总度数 -- Gitblit v1.7.1