| | |
| | | * @param chargingOrder |
| | | * @return |
| | | */ |
| | | @PostMapping("/chargingMessage/pushOrderInfo") |
| | | @PostMapping("/chargingMessage/pushOrderStatus") |
| | | R pushOrderStatus(@RequestBody ChargingOrderVo chargingOrder); |
| | | } |
| | |
| | | } |
| | | Site site = siteService.getById(chargingPile.getSiteId()); |
| | | TAccountingStrategy accountingStrategy = accountingStrategyService.getById(site.getAccountingStrategyId()); |
| | | if(null == accountingStrategy){ |
| | | List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getChargingPileId, chargingPile.getId())); |
| | | accountingStrategy = accountingStrategyService.getById(list.get(0).getAccountingStrategyId()); |
| | | } |
| | | |
| | | TAccountingStrategyDetail one = accountingStrategyDetailService.getOne(Wrappers.<TAccountingStrategyDetail>lambdaQuery() |
| | | .eq(TAccountingStrategyDetail::getAccountingStrategyId, accountingStrategy.getId()) |
| | | .last(" and DATE_FORMAT(now(), '%H:%i') between start_time and (if(end_time = '00:00', '23:59', end_time))")); |
| | |
| | | */ |
| | | @Scheduled(fixedRate = 60000) |
| | | public void taskPushOrderStatus(){ |
| | | // pushOrderStatus(); |
| | | pushOrderStatus(); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | //获取订单的计费策略 |
| | | List<AccountingStrategyDetailOrder> accountingStrategyDetailOrderList = accountingStrategyDetailOrderClient.getAllAccountingStrategyDetailOrder(chargingOrder.getId()).getData(); |
| | | if(accountingStrategyDetailOrderList.isEmpty()){ |
| | | return R.fail("计费策略为空,无法计算费用"); |
| | | } |
| | | accountingStrategyDetailOrderList.get(accountingStrategyDetailOrderList.size() - 1).setEndTime("23:59"); |
| | | //开始处理计费明细数据和优惠数据 |
| | | chargingOrderAccountingStrategyService.remove(new LambdaQueryWrapper<TChargingOrderAccountingStrategy>().eq(TChargingOrderAccountingStrategy::getChargingOrderId, chargingOrder.getId())); |
| | |
| | | BeanUtils.copyProperties(one, vo); |
| | | R r = chargingOrderService.endChargeBillingCharge(vo); |
| | | log.info("定时任务执行,充电中的订单处理结果:{}", JSON.toJSONString(r)); |
| | | } |
| | | |
| | | if(200 == r.getCode()){ |
| | | order = chargingOrderService.getById(order.getId()); |
| | | //推送监管平台订单状态和订单详情 |
| | | ChargingOrderVo chargingOrderVo = new ChargingOrderVo(); |
| | | BeanUtils.copyProperties(order, chargingOrderVo); |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @Scheduled(cron = "0 0 0 2 * ?") |