| | |
| | | TChargingOrder one = this.getOne(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getChargingGunId, addChargingOrder.getId()) |
| | | .in(TChargingOrder::getStatus, Arrays.asList(1, 2, 3)).eq(TChargingOrder::getDelFlag, 0)); |
| | | if(null != one){ |
| | | return AjaxResult.error("充电枪正在充电桩中,启动失败"); |
| | | return AjaxResult.error("充电枪正在充电中,启动失败"); |
| | | } |
| | | //查询当前充电枪是否有正在支付的订单 |
| | | one = this.getOne(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getChargingGunId, addChargingOrder.getId()) |
| | |
| | | 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(); |
| | |
| | | String code = chargingOrder.getCode(); |
| | | String key = "AQJC_" + chargingOrder.getChargingGunId(); |
| | | List<PlatformStartChargingReply> data = platformStartChargingReplyClient.getPlatformStartChargingReply(code).getData(); |
| | | log.error(code + ":-------------------开始检查调起充电结果-------------------" + data.toString()); |
| | | if(null == data || data.size() == 0){ |
| | | return false; |
| | | } |
| | | log.error(code + ":-------------------开始检查调起充电结果-------------------" + data.toString()); |
| | | if(data.size() != 0){ |
| | | PlatformStartChargingReply platformStartChargingReply = data.get(1); |
| | | Integer startup_result = platformStartChargingReply.getStartup_result(); |
| | |
| | | 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()); |
| | |
| | | } 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(); |
| | |
| | | chargingOrderRefund.setRefundTitle("充电完成退款"); |
| | | chargingOrderRefund.setRefundContent("充电完成退款"); |
| | | chargingOrderRefund.setRefundReason("充电完成退款"); |
| | | chargingOrderRefund.setRefundRemark("实际充电消费金额:" + refundAmount); |
| | | chargingOrderRefund.setRefundRemark("实际充电消费金额:" + chargingOrder.getPaymentAmount()); |
| | | chargingOrderRefund.setRefundTotalAmount(refundAmount); |
| | | chargingOrderRefund.setPayAmount(rechargeAmount); |
| | | if(1 == rechargePaymentType){ |
| | |
| | | } |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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)); |
| | | } |
| | | } |