| | |
| | | req.setSubject("充电充值"); |
| | | req.setBuyerOpenId(appUser.getAliOpenid()); |
| | | req.setBody("充电充值"); |
| | | req.setNotifyUrl("/payment/callBack/ali/all"); |
| | | req.setNotifyUrl("/payment/ali/callBack"); |
| | | AliPaymentResp data = aliPaymentClient.payment(req).getData(); |
| | | if(null != data){ |
| | | return AjaxResult.success(data); |
| | |
| | | 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)); |
| | | } |
| | | //转换成UTC时间 |
| | | ChargingHandshake chargingHandshake = chargingHandshakeClient.getDataByOrderCode(one.getCode()).getData(); |
| | | if(null != chargingHandshake && null != data && null != one.getAppUserCarId()){ |
| | | BigDecimal bms_battery_capacity = chargingHandshake.getBms_battery_capacity(); |
| | | 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(); |
| | |
| | | } |
| | | tCharingOrderVO.setTotal(total); |
| | | tCharingOrderVO.setTime(time); |
| | | tCharingOrderVO.setIncome(income.subtract(commissionMoney)); |
| | | tCharingOrderVO.setIncome(paymentMoney.subtract(commissionMoney)); |
| | | tCharingOrderVO.setElectronicMoney(electronicMoney); |
| | | tCharingOrderVO.setServiceMoney(serviceMoney); |
| | | pageInfo.setRecords(list); |
| | |
| | | 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); |
| | | } |
| | |
| | | BigDecimal subtract = new BigDecimal("1").subtract(dto.getProportionPartner()); |
| | | BigDecimal subtract9 = new BigDecimal("1").subtract(dto.getServicePartner()); |
| | | // 总电损费用 |
| | | BigDecimal divide = tSettlementConfirm.getProportionMoney().divide(subtract, 2, RoundingMode.HALF_DOWN); |
| | | BigDecimal divide = tSettlementConfirm.getProportionMoney().divide(subtract, 2, BigDecimal.ROUND_DOWN); |
| | | // 平台承担电损 |
| | | BigDecimal subtract1 = divide.subtract(tSettlementConfirm.getProportionMoney()); |
| | | BigDecimal multiply = dto.getServiceMoney().multiply(subtract); |