| | |
| | | import com.ruoyi.order.service.TChargingOrderService; |
| | | import com.ruoyi.order.service.TOrderEvaluateService; |
| | | import com.ruoyi.order.service.*; |
| | | import com.ruoyi.order.util.RedisLock; |
| | | import com.ruoyi.order.util.mongodb.service.PlatformStartChargingReplyService; |
| | | import com.ruoyi.order.util.mongodb.service.TransactionRecordService; |
| | | import com.ruoyi.order.util.mongodb.service.UploadRealTimeMonitoringDataService; |
| | |
| | | AccountingStrategyDetailOrder accountingStrategyDetailOrder = new AccountingStrategyDetailOrder(); |
| | | BeanUtils.copyProperties(tAccountingStrategyDetail, accountingStrategyDetailOrder); |
| | | accountingStrategyDetailOrder.setChargingOrderId(chargingOrder.getId()); |
| | | accountingStrategyDetailOrder.setCreateTime(LocalDateTime.now()); |
| | | accountingStrategyDetailOrder.setDelFlag(false); |
| | | list1.add(accountingStrategyDetailOrder); |
| | | } |
| | | accountingStrategyDetailOrderService.saveBatch(list1); |
| | |
| | | chargingGun.setStatus(4); |
| | | chargingGunClient.updateChargingGunById(chargingGun); |
| | | //推送状态给三方平台 |
| | | tcecClient.pushChargingGunStatus(chargingGun.getFullNumber(), chargingGun.getStatus()); |
| | | tcecClient.pushChargingGunStatus(chargingGun.getFullNumber(), 4); |
| | | } |
| | | redisService.setCacheObject("AQJC_" + order.getChargingGunId(), preChargeCheck1, 24L, TimeUnit.HOURS); |
| | | this.updateById(order); |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | // List<TChargingOrderRefund> chargingOrderRefunds = chargingOrderRefundService.lambdaQuery() |
| | | // .eq(TChargingOrderRefund::getRefundStatus,2).list(); |
| | | |
| | | |
| | | Map<String, Object> map = this.baseMapper.chargingOrderNolimit(dto, startTime1, startTime2, endTime1, endTime2); |
| | | // for (ChargingOrderVO chargingOrderVO : list1) { |
| | | // if(null == chargingOrderVO.getStatus() || 5 != chargingOrderVO.getStatus()){ |
| | | // continue; |
| | | // } |
| | | // List<TChargingOrderAccountingStrategy> list4 = list3.stream().filter(e -> e.getChargingOrderId().equals(chargingOrderVO.getId())).collect(Collectors.toList()); |
| | | // BigDecimal electronic_reduce = list4.stream().map(TChargingOrderAccountingStrategy::getPeriodElectricPrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal service_reduce = list4.stream().map(TChargingOrderAccountingStrategy::getPeriodServicePrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // BigDecimal chargingCapacity = list4.stream().map(TChargingOrderAccountingStrategy::getChargingCapacity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // electronicMoney = electronicMoney.add(electronic_reduce); |
| | | // total = total.add(chargingCapacity); |
| | | // if (!chargingOrderVO.getOrderSource().equals(2)) { |
| | | // serviceMoney = serviceMoney.add(service_reduce); |
| | | // paymentMoney = paymentMoney.add(electronic_reduce).add(service_reduce); |
| | | // }else{ |
| | | // serviceMoney = serviceMoney.add(service_reduce.multiply(new BigDecimal("0.8"))); |
| | | // paymentMoney = paymentMoney.add(electronic_reduce).add(service_reduce.multiply(new BigDecimal("0.8"))); |
| | | // } |
| | | // if (chargingOrderVO.getStartTime()!=null && chargingOrderVO.getEndTime()!=null){ |
| | | // LocalDateTime startTime = chargingOrderVO.getStartTime(); |
| | | // LocalDateTime endTime = chargingOrderVO.getEndTime(); |
| | | // // 计算时间差 单位秒 |
| | | // long between = ChronoUnit.SECONDS.between(startTime, endTime); |
| | | // time+=between; |
| | | // } |
| | | //// List<TChargingOrderRefund> list2 = chargingOrderRefunds.stream().filter(e -> e.getChargingOrderId() != null && e.getChargingOrderId().equals(chargingOrderVO.getId())) |
| | | //// .collect(Collectors.toList()); |
| | | //// for (TChargingOrderRefund tChargingOrderRefund : list2) { |
| | | //// refundMoney = refundMoney.add(tChargingOrderRefund.getRefundTotalAmount()); |
| | | //// } |
| | | // } |
| | | if (null != map) { |
| | | tCharingOrderVO.setTotal(map.get("total") == null ? BigDecimal.ZERO : (BigDecimal) map.get("total")); |
| | | tCharingOrderVO.setTime(map.get("time") == null ? 0L : (Long) map.get("time")); |
| | |
| | | chargingGun.setStatus(2); |
| | | chargingGun.setChargingPower(BigDecimal.ZERO); |
| | | chargingGunClient.updateChargingGunById(chargingGun); |
| | | chargingGun = chargingGunClient.getChargingGunById(chargingOrder.getChargingGunId()).getData(); |
| | | //推送状态给三方平台 |
| | | if (2 == chargingOrder.getOrderSource()) { |
| | | tcecClient.pushChargingGunStatus(chargingGun.getFullNumber(), chargingGun.getStatus()); |
| | | tcecClient.pushChargingGunStatus(chargingGun.getFullNumber(), 2); |
| | | } |
| | | |
| | | //添加积分 |
| | |
| | | AccountingStrategyDetailOrder accountingStrategyDetailOrder = new AccountingStrategyDetailOrder(); |
| | | BeanUtils.copyProperties(tAccountingStrategyDetail, accountingStrategyDetailOrder); |
| | | accountingStrategyDetailOrder.setChargingOrderId(chargingOrder.getId()); |
| | | accountingStrategyDetailOrder.setCreateTime(LocalDateTime.now()); |
| | | accountingStrategyDetailOrder.setDelFlag(false); |
| | | list1.add(accountingStrategyDetailOrder); |
| | | } |
| | | accountingStrategyDetailOrderService.saveBatch(list1); |
| | |
| | | public List<TChargingOrder> findChargingOrder() { |
| | | return this.baseMapper.findChargingOrder(); |
| | | } |
| | | |
| | | /** |
| | | * 获取已结束的数据 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TChargingOrder> findEndChargingOrder() { |
| | | return this.baseMapper.findEndChargingOrder(); |
| | | } |
| | | } |