Pu Zhibing
2025-12-09 a545d3839077fd509a0fe479c6326045e8dc3fb1
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
@@ -1,5 +1,6 @@
package com.ruoyi.order.service.impl;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -1283,7 +1284,10 @@
         if (null != one.getAppUserCarId()) {
            TAppUserCar appUserCar = appUserCarClient.getCarById(one.getAppUserCarId().toString()).getData();
            //   续航 = 续航里程 * soc
            BigDecimal multiply = new BigDecimal(data.getSoc()).divide(new BigDecimal(100)).multiply(new BigDecimal(appUserCar.getEndurance()));
            BigDecimal multiply = BigDecimal.ZERO;
            if(NumberUtil.isNumber(appUserCar.getEndurance())){
               new BigDecimal(data.getSoc()).divide(new BigDecimal(100)).multiply(new BigDecimal(appUserCar.getEndurance()));
            }
            chargingDetails.setEndurance(multiply.setScale(2, RoundingMode.HALF_EVEN));
         }
      }
@@ -2556,7 +2560,10 @@
            }
         }
         chargingOrder.setResidualAmount(rechargeAmount.subtract(total).setScale(2, RoundingMode.HALF_EVEN));
         chargingOrder.setStartTime(LocalDateTime.parse(vo.getStart_time(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SS")));
         List<UploadRealTimeMonitoringData> dataList = uploadRealTimeMonitoringDataService.getDataByOrderCode(chargingOrder.getCode());
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         chargingOrder.setStartTime(LocalDateTime.parse(sdf.format(dataList.get(dataList.size() - 1).getCreate_time()), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
         chargingOrder.setEndTime(LocalDateTime.parse(vo.getEnd_time(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SS")));
         chargingOrder.setStatus(5);
         chargingOrder.setOrderAmount(orderAmount.setScale(2, RoundingMode.HALF_EVEN));
@@ -2731,8 +2738,8 @@
               //构建退款明细
               TChargingOrderRefund chargingOrderRefund = new TChargingOrderRefund();
               chargingOrderRefund.setChargingOrderId(chargingOrder.getId());
               SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
               chargingOrderRefund.setRefundCode("CDF" + sdf.format(new Date()) + (Double.valueOf(Math.random() * 1000).intValue()));
               SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMddHHmmssSSS");
               chargingOrderRefund.setRefundCode("CDF" + sdf1.format(new Date()) + (Double.valueOf(Math.random() * 1000).intValue()));
               chargingOrderRefund.setRefundAmount(refundAmount);
               chargingOrderRefund.setPayType(rechargePaymentType);
               chargingOrderRefund.setRefundStatus(1);
@@ -2793,8 +2800,8 @@
               //构建退款明细
               TChargingOrderRefund chargingOrderRefund = new TChargingOrderRefund();
               chargingOrderRefund.setChargingOrderId(chargingOrder.getId());
               SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
               chargingOrderRefund.setRefundCode("CDF" + sdf.format(new Date()) + (Double.valueOf(Math.random() * 1000).intValue()));
               SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMddHHmmssSSS");
               chargingOrderRefund.setRefundCode("CDF" + sdf1.format(new Date()) + (Double.valueOf(Math.random() * 1000).intValue()));
               chargingOrderRefund.setRefundAmount(refundAmount);
               chargingOrderRefund.setRefundStatus(2);
               chargingOrderRefund.setPayType(rechargePaymentType);