| | |
| | | @ResponseBody |
| | | @GetMapping(value = "/pay/order/charging") |
| | | @ApiOperation(value = "充电信息", tags = {"管理后台-支付订单-订单信息"}) |
| | | public R refundDetail(Long orderId) { |
| | | public R<PayOrderChargingInfo> refundDetail(Long orderId) { |
| | | PayOrderChargingInfo payOrderChargingInfo = new PayOrderChargingInfo(); |
| | | TChargingOrder byId = chargingOrderService.getById(orderId); |
| | | List<Site> data = siteClient.getSiteByIds(Collections.singletonList(byId.getSiteId())).getData(); |
| | |
| | | List<TAppUserCar> data3 = appUserCarClient.getCarByIds(Collections.singletonList(byId.getAppUserCarId())).getData(); |
| | | payOrderChargingInfo.setCarNum(data3.get(0).getLicensePlate()); |
| | | } |
| | | return R.ok(); |
| | | payOrderChargingInfo.setTChargingOrder(byId); |
| | | |
| | | Long count = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, orderId).count(); |
| | | payOrderChargingInfo.setPeriodCount(count); |
| | | if (byId.getAppUserCarId()!=null) { |
| | | List<Long> carid = new ArrayList<>(); |
| | | carid.add(byId.getAppUserCarId()); |
| | | R<List<TAppUserCar>> carByIds = appUserCarClient.getCarByIds(carid); |
| | | payOrderChargingInfo.setCarNum(carByIds.getData().get(0).getLicensePlate()); |
| | | } |
| | | payOrderChargingInfo.setStartTime(byId.getStartTime()); |
| | | payOrderChargingInfo.setEndTime(byId.getEndTime()); |
| | | payOrderChargingInfo.setTimeCount(payOrderChargingInfo.calculateDuration()); |
| | | return R.ok(payOrderChargingInfo); |
| | | } |
| | | |
| | | @ResponseBody |
| | |
| | | TChargingOrder byId = chargingOrderService.getById(strategyId); |
| | | ChargingOrderInfoVO chargingOrderInfoVO = new ChargingOrderInfoVO(); |
| | | |
| | | chargingOrderInfoVO.setCdElectronic(byId.getCurrent()!=null?byId.getCurrent()+"":""); |
| | | chargingOrderInfoVO.setCdVoltage(byId.getVoltage()!=null?byId.getVoltage()+"":""); |
| | | chargingOrderInfoVO.setSurplus(byId.getTotalElectricity()!=null?byId.getTotalElectricity()+"":""); |
| | | chargingOrderInfoVO.setTotalPower(byId.getPower()!=null?byId.getPower()+"":""); |
| | | chargingOrderInfoVO.setCdElectronic(byId.getCurrent()!=null?byId.getCurrent().setScale(2, BigDecimal.ROUND_HALF_DOWN)+"":""); |
| | | chargingOrderInfoVO.setCdVoltage(byId.getVoltage()!=null?byId.getVoltage().setScale(2, BigDecimal.ROUND_HALF_DOWN)+"":""); |
| | | chargingOrderInfoVO.setSurplus(byId.getTotalElectricity()!=null?byId.getTotalElectricity().setScale(2, BigDecimal.ROUND_HALF_DOWN)+"":""); |
| | | chargingOrderInfoVO.setTotalPower(byId.getPower()!=null?byId.getPower().setScale(2, BigDecimal.ROUND_HALF_DOWN)+"":""); |
| | | if (byId.getAppUserCarId()!=null){ |
| | | List<TAppUserCar> data = appUserCarClient.getCarByIds(Collections.singletonList(byId.getAppUserCarId())).getData(); |
| | | if (!data.isEmpty()){ |
| | |
| | | // 时段总服务费 |
| | | BigDecimal bigDecimal = new BigDecimal("0"); |
| | | List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, strategyId).orderByDesc(TChargingOrderAccountingStrategy::getStartTime).list(); |
| | | |
| | | for (TChargingOrderAccountingStrategy tChargingOrderAccountingStrategy : list) { |
| | | if (byId.getVipDiscountAmount()!=null){ |
| | | BigDecimal multiply = byId.getVipDiscountAmount().divide(byId.getServiceCharge(), 2) |
| | | .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); |
| | | tChargingOrderAccountingStrategy.setVipDiscount(multiply); |
| | | } |
| | | bigDecimal = bigDecimal.add(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); |
| | | tChargingOrderAccountingStrategy.setVipDiscount( |
| | | tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice() |
| | | .subtract(tChargingOrderAccountingStrategy.getPeriodServicePrice()) |
| | | ); |
| | | tChargingOrderAccountingStrategy.setCouponDiscount( |
| | | tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice() |
| | | .subtract(tChargingOrderAccountingStrategy.getPeriodServicePrice()) |
| | | ); |
| | | |
| | | if (byId.getCouponDiscountAmount()!=null){ |
| | | BigDecimal multiply = byId.getCouponDiscountAmount().divide(byId.getServiceCharge(), 2) |
| | | .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); |
| | | tChargingOrderAccountingStrategy.setCouponDiscount(multiply); |
| | | } |
| | | } |
| | | chargingOrderInfoVO.setList(list); |
| | | return AjaxResult.success(chargingOrderInfoVO); |
| | |
| | | LocalDate end = null; |
| | | if (statisticsQueryDto.getDayType()==1){ |
| | | start = LocalDate.now(); |
| | | end = LocalDate.now(); |
| | | end = LocalDate.now().plusDays(1); |
| | | |
| | | }else if (statisticsQueryDto.getDayType()==2){ |
| | | LocalDate today = LocalDate.now(); |