| | |
| | | dto.setRefundReason("充电失败,取消充电订单"); |
| | | RefundResp resp = aliPaymentClient.refund(dto).getData(); |
| | | if(null != resp){ |
| | | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-DDTHH:mm:ss+TIMEZONE"); |
| | | AjaxResult success = chargingOrderStartupFailureWxRefund(resp.getOutTradeNo(), resp.getTradeNo(), "SUCCESS", sdf1.format(new Date())); |
| | | AjaxResult success = chargingOrderStartupFailureWxRefund(resp.getOutTradeNo(), resp.getTradeNo(), "SUCCESS", null); |
| | | if(success.isSuccess()){ |
| | | chargingOrderRefundService.save(chargingOrderRefund); |
| | | } |
| | |
| | | Integer h = Integer.valueOf(data.getCumulative_charging_time() / 60); |
| | | Integer m = Integer.valueOf(data.getCumulative_charging_time() % 60); |
| | | chargingDetails.setChargedTime(String.format("%02d", h) + ":" + String.format("%02d", m)); |
| | | } |
| | | if(null != data && null != one.getAppUserCarId()){ |
| | | TAppUserCar appUserCar = appUserCarClient.getCarByIds(Arrays.asList(one.getAppUserCarId())).getData().get(0); |
| | | // 续航 = 续航里程 * soc |
| | | BigDecimal multiply = new BigDecimal(data.getSoc() / 100).multiply(new BigDecimal(appUserCar.getEndurance())); |
| | | chargingDetails.setEndurance(multiply); |
| | | 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())); |
| | | chargingDetails.setEndurance(multiply.setScale(2, RoundingMode.HALF_EVEN)); |
| | | } |
| | | } |
| | | return chargingDetails; |
| | | } |
| | |
| | | if(1 == doubleIntegration){ |
| | | num1 *= 2; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | GetInviteUser query = new GetInviteUser(); |
| | |
| | | discountAmount = discountAmount.setScale(4, RoundingMode.HALF_EVEN); |
| | | payAmount = payAmount.subtract(discountAmount); |
| | | periodServicePrice_total = periodServicePrice_total.subtract(discountAmount); |
| | | |
| | | |
| | | TChargingOrder order = new TChargingOrder(); |
| | | order.setId(chargingOrder.getId()); |
| | | order.setAppUserId(chargingOrder.getAppUserId()); |
| | |
| | | dto.setRefundReason("充电完成退款"); |
| | | RefundResp resp = aliPaymentClient.refund(dto).getData(); |
| | | if(null != resp){ |
| | | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-DDTHH:mm:ss+TIMEZONE"); |
| | | AjaxResult success = chargingOrderStartupFailureWxRefund(resp.getOutTradeNo(), resp.getTradeNo(), "SUCCESS", sdf1.format(new Date())); |
| | | AjaxResult success = chargingOrderStartupFailureWxRefund(resp.getOutTradeNo(), resp.getTradeNo(), "SUCCESS", null); |
| | | if(success.isSuccess()){ |
| | | chargingOrderRefundService.save(chargingOrderRefund); |
| | | } |