| | |
| | | import com.ruoyi.integration.api.feignClient.*; |
| | | import com.ruoyi.integration.api.model.*; |
| | | import com.ruoyi.integration.api.vo.GetPlatformStopChargingReply; |
| | | import com.ruoyi.integration.api.vo.StartChargeResult; |
| | | import com.ruoyi.order.api.dto.SettlementConfirmAdd; |
| | | import com.ruoyi.order.api.feignClient.AccountingStrategyDetailOrderClient; |
| | | import com.ruoyi.order.api.feignClient.AccountingStrategyOrderClient; |
| | |
| | | private UploadRealTimeMonitoringDataClient uploadRealTimeMonitoringDataClient; |
| | | |
| | | @Resource |
| | | private ChargingHandshakeClient chargingHandshakeClient; |
| | | private TCECClient tcecClient; |
| | | |
| | | @Resource |
| | | private SendMessageClient sendMessageClient; |
| | |
| | | } |
| | | this.updateById(order); |
| | | redisService.setCacheObject(key, preChargeCheck1, 24L, TimeUnit.HOURS); |
| | | //推送三方平台订单状态 |
| | | if(2 == chargingOrder.getOrderSource()){ |
| | | tcecClient.notificationEquipChargeStatus(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | } |
| | | return true; |
| | | }else{ |
| | | Integer counter = boot_failed_map.get(code); |
| | |
| | | order.setEndMode(0); |
| | | this.updateById(order); |
| | | redisService.setCacheObject(key, preChargeCheck1, 24L, TimeUnit.HOURS); |
| | | //推送三方平台订单状态 |
| | | if(2 == chargingOrder.getOrderSource()){ |
| | | tcecClient.notificationEquipChargeStatus(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | |
| | | TChargingGun chargingGun = chargingGunClient.getChargingGunById(order.getChargingGunId()).getData(); |
| | | chargingGun.setStatus(4); |
| | | chargingGunClient.updateChargingGunById(chargingGun); |
| | | //推送状态给三方平台 |
| | | tcecClient.pushChargingGunStatus(chargingGun.getId(), chargingGun.getStatus()); |
| | | } |
| | | redisService.setCacheObject("AQJC_" + order.getChargingGunId(), preChargeCheck1, 24L, TimeUnit.HOURS); |
| | | this.updateById(order); |
| | | //推送三方平台启动充电结果 |
| | | if(2 == order.getOrderSource()){ |
| | | StartChargeResult result = new StartChargeResult(); |
| | | result.setStartChargeSeq(order.getStartChargeSeq()); |
| | | result.setStartChargeSeqStat(3 == order.getStatus() ? 2 : 4); |
| | | result.setConnectorID(order.getChargingGunId().toString()); |
| | | result.setStartTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | Operator operator = operatorClient.getOperatorById(order.getOperatorId()).getData(); |
| | | result.setOperatorID(operator.getOperatorId()); |
| | | tcecClient.notificationStartChargeResult(result); |
| | | |
| | | tcecClient.notificationEquipChargeStatus(order.getStartChargeSeq(), order.getOperatorId()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | chargingOrder.setStatus(4); |
| | | chargingOrder.setEndMode(1); |
| | | this.updateById(chargingOrder); |
| | | |
| | | String code1 = order.getCode(); |
| | | TChargingGun chargingGun = chargingGunClient.getChargingGunById(order.getChargingGunId()).getData(); |
| | | //异步线程处理停机 |
| | |
| | | log.info(code1 + ":-------------------远程停止充电请求-------------------"); |
| | | log.info(platformStopCharging.toString()); |
| | | }); |
| | | //推送三方平台 |
| | | if(2 == order.getOrderSource()){ |
| | | tcecClient.notificationEquipChargeStatus(order.getStartChargeSeq(), order.getOperatorId()); |
| | | } |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | this.updateById(order); |
| | | chargingOrder = this.getById(order.getId()); |
| | | |
| | | //推送三方平台 |
| | | if(2 == chargingOrder.getOrderSource()){ |
| | | tcecClient.notificationEquipChargeStatus(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | tcecClient.notificationStopChargeResult(chargingOrder.getStartChargeSeq(), chargingOrder.getChargingGunId().toString(), |
| | | chargingOrder.getOperatorId()); |
| | | tcecClient.notificationChargeOrderInfo(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | } |
| | | |
| | | //开始将优惠券优惠的金额添加到明细中 |
| | | BigDecimal couponDiscountAmount = order.getCouponDiscountAmount(); |
| | | if(null != couponDiscountAmount && couponDiscountAmount.compareTo(BigDecimal.ZERO) > 0){ |
| | |
| | | chargingGun.setStatus(2); |
| | | chargingGun.setChargingPower(BigDecimal.ZERO); |
| | | chargingGunClient.updateChargingGunById(chargingGun); |
| | | //推送状态给三方平台 |
| | | tcecClient.pushChargingGunStatus(chargingGun.getId(), chargingGun.getStatus()); |
| | | |
| | | //添加积分 |
| | | TIntegralRule integralRule = integralRuleClient.getSet().getData(); |
| | |
| | | |
| | | /** |
| | | * 添加三方平台充电订单数据 |
| | | * @param chargingGunId |
| | | * @param query |
| | | */ |
| | | @Override |
| | | public R addTripartitePlatformOrder(Integer chargingGunId, String operatorId, Integer rechargePaymentType, BigDecimal paymentAmount, String startChargeSeq) { |
| | | public R addTripartitePlatformOrder(AddTripartitePlatformOrder query) { |
| | | //检查当前枪是否是正在使用中 |
| | | TChargingOrder one = this.getOne(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getChargingGunId, chargingGunId) |
| | | TChargingOrder one = this.getOne(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getChargingGunId, query.getChargingGunId()) |
| | | .in(TChargingOrder::getStatus, Arrays.asList(1, 2, 3)).eq(TChargingOrder::getDelFlag, 0)); |
| | | if(null != one){ |
| | | return R.fail("充电枪正在充电中,启动失败"); |
| | |
| | | chargingOrder.setCode(code); |
| | | chargingOrder.setOrderType(1); |
| | | chargingOrder.setOrderClassification(1); |
| | | TChargingGun tChargingGun = chargingGunClient.getChargingGunById(chargingGunId).getData(); |
| | | TChargingGun tChargingGun = chargingGunClient.getChargingGunById(query.getChargingGunId()).getData(); |
| | | TChargingPile chargingPile = chargingPileClient.getChargingPileById(tChargingGun.getChargingPileId()).getData(); |
| | | chargingOrder.setSiteId(tChargingGun.getSiteId()); |
| | | chargingOrder.setChargingPileId(tChargingGun.getChargingPileId()); |
| | | chargingOrder.setChargingGunId(chargingGunId); |
| | | chargingOrder.setRechargePaymentType(rechargePaymentType); |
| | | chargingOrder.setChargingGunId(query.getChargingGunId()); |
| | | chargingOrder.setRechargePaymentType(query.getRechargePaymentType()); |
| | | chargingOrder.setRechargePaymentStatus(2); |
| | | chargingOrder.setRechargeAmount(paymentAmount); |
| | | chargingOrder.setRechargeAmount(query.getPaymentAmount()); |
| | | chargingOrder.setVipDiscountAmount(BigDecimal.ZERO); |
| | | chargingOrder.setOrderSource(2); |
| | | Operator operator = operatorClient.getOperator(operatorId).getData(); |
| | | Operator operator = operatorClient.getOperator(query.getOperatorId()).getData(); |
| | | chargingOrder.setOperatorId(operator.getId()); |
| | | chargingOrder.setAppUserId(operator.getId().longValue()); |
| | | chargingOrder.setTripartitePlatformName(operator.getName()); |
| | | chargingOrder.setStartChargeSeq(startChargeSeq); |
| | | chargingOrder.setStartChargeSeq(query.getStartChargeSeq()); |
| | | //车辆信息 |
| | | if(StringUtils.hasLength(query.getPlateNum())){ |
| | | TAppUserCar appUserCar = appUserCarClient.getAppUserCarByLicensePlate(query.getPlateNum()).getData(); |
| | | if(null != appUserCar){ |
| | | chargingOrder.setAppUserCarId(appUserCar.getId()); |
| | | } |
| | | } |
| | | |
| | | |
| | | chargingOrder.setTitle("【充电桩充电】" + chargingPile.getNumber() + "号桩/" + tChargingGun.getCode() + "号枪"); |
| | | chargingOrder.setStatus(2); |
| | | chargingOrder.setPayTime(LocalDateTime.now()); |
| | |
| | | scheduler.shutdown(); |
| | | } |
| | | }, 5, 1, TimeUnit.SECONDS); |
| | | |
| | | //推送三方平台订单状态 |
| | | tcecClient.notificationEquipChargeStatus(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | chargingOrder.setEndMode(1); |
| | | this.updateById(chargingOrder); |
| | | |
| | | tcecClient.notificationEquipChargeStatus(order.getStartChargeSeq(), order.getOperatorId()); |
| | | |
| | | String code1 = order.getCode(); |
| | | TChargingGun chargingGun = chargingGunClient.getChargingGunById(order.getChargingGunId()).getData(); |
| | | //异步线程处理停机 |