From 278f61f89b8282784c6f3572605ef5e62dc74f59 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期二, 29 十月 2024 15:24:15 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java | 44 ++++++++++++++++++++++++++++++++++++-------- 1 files changed, 36 insertions(+), 8 deletions(-) diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java index e4839d9..cccca0d 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java @@ -447,6 +447,7 @@ chargingOrder.setVipDiscountAmount(BigDecimal.ZERO); chargingOrder.setOrderSource(0); chargingOrder.setTitle("【充电桩充电】" + chargingPile.getNumber() + "号桩/" + tChargingGun.getCode() + "号枪"); + chargingOrder.setStatus(1); Site site = siteClient.getSiteByIds(Arrays.asList(tChargingGun.getSiteId())).getData().get(0); Integer accountingStrategyId = tChargingGun.getAccountingStrategyId(); @@ -981,16 +982,17 @@ chargingOrder.setId(Long.valueOf(id)); chargingOrder.setAppUserId(order.getAppUserId()); chargingOrder.setEndTime(LocalDateTime.now()); + chargingOrder.setStatus(4); chargingOrder.setEndMode(1); this.updateById(chargingOrder); - String code1 = chargingOrder.getCode(); - TChargingGun chargingGun = chargingGunClient.getChargingGunById(chargingOrder.getChargingGunId()).getData(); + String code1 = order.getCode(); + TChargingGun chargingGun = chargingGunClient.getChargingGunById(order.getChargingGunId()).getData(); //异步线程处理停机 ExecutorService cachedThreadPool = Executors.newFixedThreadPool(1); cachedThreadPool.execute(()->{ //调用硬件停止充电,停止成功后开始计算费用退款 - TChargingPile chargingPile = chargingPileClient.getChargingPileById(chargingOrder.getChargingPileId()).getData(); + TChargingPile chargingPile = chargingPileClient.getChargingPileById(order.getChargingPileId()).getData(); PlatformStopCharging platformStopCharging = new PlatformStopCharging(); platformStopCharging.setCharging_pile_code(chargingPile.getCode()); platformStopCharging.setCharging_gun_code(chargingGun.getCode()); @@ -1865,9 +1867,7 @@ } catch (ParseException e) { throw new RuntimeException(e); } - System.err.println(start.getTime() + "\n" + end.getTime() + "\n" + lists.get(0).getStart() + "\n" + lists.get(0).getEnd()); - - + for (AccountingStrategyDetailOrderVo strategyDetail : lists) { BigDecimal sharp_peak_charge = strategyDetail.getChargingCapacity(); TChargingOrderAccountingStrategy chargingOrderAccountingStrategy = new TChargingOrderAccountingStrategy(); @@ -2110,7 +2110,7 @@ chargingOrderRefund.setRefundTitle("充电完成退款"); chargingOrderRefund.setRefundContent("充电完成退款"); chargingOrderRefund.setRefundReason("充电完成退款"); - chargingOrderRefund.setRefundRemark("实际充电消费金额:" + refundAmount); + chargingOrderRefund.setRefundRemark("实际充电消费金额:" + chargingOrder.getPaymentAmount()); chargingOrderRefund.setRefundTotalAmount(refundAmount); chargingOrderRefund.setPayAmount(rechargeAmount); if(1 == rechargePaymentType){ @@ -2455,7 +2455,7 @@ } TChargingOrder one = this.getOne(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getAppUserCarId, appUserCar.getId()) .eq(TChargingOrder::getDelFlag, 0).gt(TChargingOrder::getStartTime, query.getStartTime()) - .eq(TChargingOrder::getRechargePaymentStatus, 2).ne(TChargingOrder::getStatus, -1)); + .eq(TChargingOrder::getRechargePaymentStatus, 2).ne(TChargingOrder::getStatus, 5)); return one; } @@ -2971,4 +2971,32 @@ public Long countNoTag() { return this.baseMapper.countNoTag(); } + + + @Override + public List<TChargingOrder> getChargingOrder(TChargingOrderVo order) { + LambdaQueryWrapper<TChargingOrder> queryWrapper = new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getDelFlag, 0); + if(null != order.getChargingPileId()){ + queryWrapper.eq(TChargingOrder::getChargingPileId, order.getChargingPileId()); + } + if(null != order.getChargingGunId()){ + queryWrapper.eq(TChargingOrder::getChargingGunId, order.getChargingGunId()); + } + if(null != order.getStatus()){ + queryWrapper.eq(TChargingOrder::getStatus, order.getStatus()); + } + if(null != order.getAppUserId()){ + queryWrapper.eq(TChargingOrder::getAppUserId, order.getAppUserId()); + } + if(null != order.getAppUserId()){ + queryWrapper.eq(TChargingOrder::getAppUserId, order.getAppUserId()); + } + if(null != order.getStatusList()){ + queryWrapper.in(TChargingOrder::getAppUserId, order.getStatusList()); + } + if(null != order.getEndMode()){ + queryWrapper.eq(TChargingOrder::getEndMode, order.getEndMode()); + } + return this.list(queryWrapper.orderByDesc(TChargingOrder::getCreateTime)); + } } -- Gitblit v1.7.1