| | |
| | | if (data5.getTime_remaining()!=null){ |
| | | chargingSecond+=data5.getTime_remaining()*60; |
| | | } |
| | | Integer cumulativeChargingTime = data5.getCumulative_charging_time(); |
| | | // 将其转化为xx小时xx分钟xx秒显示 如果是0小时则不展示小时 如果是0分钟则不展示分钟 |
| | | if (cumulativeChargingTime!=null){ |
| | | // 计算小时、分钟和秒 |
| | | int hours = cumulativeChargingTime / 60; |
| | | int minutes = cumulativeChargingTime % 60; |
| | | int seconds = 0; // 如果没有秒数,则默认是0 |
| | | StringBuilder result = new StringBuilder(); |
| | | if (hours > 0) { |
| | | result.append(hours).append("小时"); |
| | | } |
| | | if (minutes > 0) { |
| | | result.append(minutes).append("分钟"); |
| | | } |
| | | if (seconds > 0 || result.length() == 0) { // 如果秒数大于0,或者小时和分钟都为0,则显示秒数 |
| | | result.append(seconds).append("秒"); |
| | | } |
| | | tChargingOrder.setChargingTime(result.toString()); |
| | | } |
| | | tChargingOrder.setEndSoc(data5.getSoc().toString()); |
| | | } |
| | | Integer cumulativeChargingTime = data5.getCumulative_charging_time(); |
| | | // 将其转化为xx小时xx分钟xx秒显示 如果是0小时则不展示小时 如果是0分钟则不展示分钟 |
| | | if (cumulativeChargingTime!=null){ |
| | | // 计算小时、分钟和秒 |
| | | int hours = cumulativeChargingTime / 60; |
| | | int minutes = cumulativeChargingTime % 60; |
| | | int seconds = 0; // 如果没有秒数,则默认是0 |
| | | StringBuilder result = new StringBuilder(); |
| | | if (hours > 0) { |
| | | result.append(hours).append("小时"); |
| | | } |
| | | if (minutes > 0) { |
| | | result.append(minutes).append("分钟"); |
| | | } |
| | | if (seconds > 0 || result.length() == 0) { // 如果秒数大于0,或者小时和分钟都为0,则显示秒数 |
| | | result.append(seconds).append("秒"); |
| | | } |
| | | tChargingOrder.setChargingTime(result.toString()); |
| | | } |
| | | tChargingOrder.setEndSoc(data5.getSoc().toString()); |
| | | |
| | | TAppUser data3 = appUserClient.getUserById(tChargingOrder.getAppUserId()).getData(); |
| | | if (tChargingOrder.getAppUserCarId()!=null){ |
| | | List<TAppUserCar> data4 = appUserCarClient.getCarByIds(Arrays.asList(tChargingOrder.getAppUserCarId())).getData(); |
| | |
| | | } |
| | | } |
| | | if (data3!=null)tChargingOrder.setUserName(data3.getName()); |
| | | // 累加实收金额 |
| | | // 累加实收金额 支付结算金额 |
| | | if (tChargingOrder.getOrderAmount()!=null){ |
| | | paymentAmount = paymentAmount.add(tChargingOrder.getOrderAmount()); |
| | | } |
| | | // 累加订单金额 |
| | | // 入账金额 |
| | | if (tChargingOrder.getOrderAmount()!=null){ |
| | | orderAmount = orderAmount.add(tChargingOrder.getOrderAmount()); |
| | | } |
| | |
| | | List<TChargingOrderRefund> list2 = chargingOrderRefundService.lambdaQuery().eq(TChargingOrderRefund::getRefundStatus, 2) |
| | | .eq(TChargingOrderRefund::getChargingOrderId, tChargingOrder.getId()).list(); |
| | | for (TChargingOrderRefund tChargingOrderRefund : list2) { |
| | | refundAmount = refundAmount.add(tChargingOrderRefund.getRefundAmount()); |
| | | refundAmount = refundAmount.add(tChargingOrderRefund.getRefundTotalAmount()); |
| | | } |
| | | // 累加累计服务费 |
| | | if (tChargingOrder.getServiceCharge()!=null){ |
| | |
| | | .subtract(chargingBillVO.getCommissionAmount()==null?BigDecimal.ZERO:chargingBillVO.getCommissionAmount()) |
| | | .subtract(chargingBillVO.getSharingAmount()==null?BigDecimal.ZERO:chargingBillVO.getSharingAmount())); |
| | | chargingBillListVO.setPaymentAmount(paymentAmount == null?BigDecimal.ZERO:paymentAmount); |
| | | chargingBillListVO.setOrderAmount(orderAmount == null?BigDecimal.ZERO:orderAmount); |
| | | chargingBillListVO.setRefundAmount(refundAmount == null?BigDecimal.ZERO:orderAmount); |
| | | chargingBillListVO.setOrderAmount(orderAmount == null?BigDecimal.ZERO:orderAmount.subtract(refundAmount).subtract(commissionAmount).subtract(sharingAmount)); |
| | | chargingBillListVO.setRefundAmount(refundAmount == null?BigDecimal.ZERO:refundAmount); |
| | | chargingBillListVO.setElectrovalence(electrovalence == null?BigDecimal.ZERO:electrovalence); |
| | | chargingBillListVO.setServiceCharge(serviceCharge == null?BigDecimal.ZERO:serviceCharge); |
| | | chargingBillListVO.setCommissionAmount(commissionAmount == null?BigDecimal.ZERO:commissionAmount.setScale(2, RoundingMode.HALF_DOWN)); |