| | |
| | | String key = "AQJC_" + chargingOrder.getChargingGunId(); |
| | | List<PlatformStartChargingReply> data = platformStartChargingReplyService.getPlatformStartChargingReply(code); |
| | | log.info(code + ":-------------------开始检查调起充电结果-------------------" + data.toString()); |
| | | Site site = siteClient.getSiteByIds(Arrays.asList(chargingOrder.getSiteId())).getData().get(0); |
| | | if (data.size() != 0) { |
| | | PlatformStartChargingReply platformStartChargingReply = data.get(1); |
| | | Integer startup_result = platformStartChargingReply.getStartup_result(); |
| | |
| | | |
| | | redisService.setCacheObject(key, preChargeCheck1, 24L, TimeUnit.HOURS); |
| | | //推送三方平台订单状态 |
| | | if (2 == chargingOrder.getOrderSource()) { |
| | | if (2 == chargingOrder.getOrderSource() && 1 == site.getIsOpenSynchronization()) { |
| | | tcecClient.notificationEquipChargeStatus(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | } |
| | | return true; |
| | |
| | | this.updateById(order); |
| | | redisService.setCacheObject(key, preChargeCheck1, 24L, TimeUnit.HOURS); |
| | | //推送三方平台订单状态 |
| | | if (2 == chargingOrder.getOrderSource()) { |
| | | if (2 == chargingOrder.getOrderSource() && 1 == site.getIsOpenSynchronization()) { |
| | | tcecClient.notificationEquipChargeStatus(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | } |
| | | return true; |
| | |
| | | if (order.getStatus() != 2) { |
| | | return; |
| | | } |
| | | Site site = siteClient.getSiteByIds(Arrays.asList(order.getSiteId())).getData().get(0); |
| | | String code = order.getCode(); |
| | | PreChargeCheck preChargeCheck1 = redisService.getCacheObject("AQJC_" + order.getChargingGunId()); |
| | | if (null != preChargeCheck1) { |
| | |
| | | TChargingGun chargingGun = chargingGunClient.getChargingGunById(order.getChargingGunId()).getData(); |
| | | chargingGun.setStatus(4); |
| | | chargingGunClient.updateChargingGunById(chargingGun); |
| | | //推送状态给三方平台 |
| | | tcecClient.pushChargingGunStatus(chargingGun.getFullNumber(), 4); |
| | | if(1 == site.getIsOpenSynchronization()){ |
| | | //推送状态给三方平台 |
| | | tcecClient.pushChargingGunStatus(chargingGun.getFullNumber(), 4); |
| | | } |
| | | } |
| | | redisService.setCacheObject("AQJC_" + order.getChargingGunId(), preChargeCheck1, 24L, TimeUnit.HOURS); |
| | | this.updateById(order); |
| | |
| | | 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); |
| | | if(1 == site.getIsOpenSynchronization()){ |
| | | tcecClient.notificationStartChargeResult(result); |
| | | tcecClient.notificationEquipChargeStatus(order.getStartChargeSeq(), order.getOperatorId()); |
| | | } |
| | | |
| | | tcecClient.notificationEquipChargeStatus(order.getStartChargeSeq(), order.getOperatorId()); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if (!order.getAppUserId().equals(userId)) { |
| | | log.info("【" + order.getCode() + "】主动停止充电失败,用户权限不足。当前登录用户id:{},订单用户id:{}", userId, order.getAppUserId()); |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | order.setEndTime(LocalDateTime.now()); |
| | | order.setStatus(4); |
| | | order.setEndMode(1); |
| | | this.updateById(order); |
| | | log.info("【" + order.getCode() + "】主动停止充电成功,订单状态已被修改。"); |
| | | |
| | | String code1 = order.getCode(); |
| | | TChargingGun chargingGun = chargingGunClient.getChargingGunById(order.getChargingGunId()).getData(); |
| | |
| | | log.info(code1 + ":-------------------远程停止充电请求-------------------"); |
| | | log.info(platformStopCharging.toString()); |
| | | }); |
| | | Site site = siteClient.getSiteByIds(Arrays.asList(order.getSiteId())).getData().get(0); |
| | | //推送三方平台 |
| | | if (2 == order.getOrderSource()) { |
| | | if (2 == order.getOrderSource() && 1 == site.getIsOpenSynchronization()) { |
| | | tcecClient.notificationEquipChargeStatus(order.getStartChargeSeq(), order.getOperatorId()); |
| | | } |
| | | |
| | |
| | | redisService.setCacheObject("chargingOrderStatus:" + vo.getTransaction_serial_number(), 5, 100L, TimeUnit.SECONDS); |
| | | |
| | | chargingOrder = this.getById(chargingOrder.getId()); |
| | | |
| | | Site site = siteClient.getSiteByIds(Arrays.asList(chargingOrder.getSiteId())).getData().get(0); |
| | | //推送三方平台 |
| | | if (2 == chargingOrder.getOrderSource()) { |
| | | if (2 == chargingOrder.getOrderSource() && 1 == site.getIsOpenSynchronization()) { |
| | | TChargingOrder finalChargingOrder = chargingOrder; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | |
| | | chargingGunClient.updateChargingGunById(chargingGun); |
| | | chargingGun = chargingGunClient.getChargingGunById(chargingOrder.getChargingGunId()).getData(); |
| | | //推送状态给三方平台 |
| | | if (2 == chargingOrder.getOrderSource()) { |
| | | if (2 == chargingOrder.getOrderSource() && 1 == site.getIsOpenSynchronization()) { |
| | | tcecClient.pushChargingGunStatus(chargingGun.getFullNumber(), 2); |
| | | } |
| | | |
| | |
| | | // scheduler.shutdown(); |
| | | // } |
| | | // }, 5, 1, TimeUnit.SECONDS); |
| | | |
| | | //推送三方平台订单状态 |
| | | tcecClient.notificationEquipChargeStatus(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | Site site = siteClient.getSiteByIds(Arrays.asList(chargingOrder.getSiteId())).getData().get(0); |
| | | if(1 == site.getIsOpenSynchronization()){ |
| | | //推送三方平台订单状态 |
| | | tcecClient.notificationEquipChargeStatus(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public R tripartitePlatformStopCharge(String startChargeSeq) { |
| | | log.info("三方平台请求停止充电:" + startChargeSeq); |
| | | TChargingOrder order = this.getOne(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getStartChargeSeq, startChargeSeq)); |
| | | Integer status = order.getStatus(); |
| | | String code1 = order.getCode(); |
| | | if (status != 3) { |
| | | log.info("【" + code1 + "】三方平台请求停止充电失败:还未开始充电"); |
| | | return R.fail("还未开始充电"); |
| | | } |
| | | if (status == 4 || status == 5) { |
| | | log.info("【" + code1 + "】三方平台请求停止充电:不能重复操作"); |
| | | return R.fail("不能重复操作"); |
| | | } |
| | | TChargingOrder chargingOrder = new TChargingOrder(); |
| | |
| | | chargingOrder.setStatus(4); |
| | | chargingOrder.setEndMode(1); |
| | | this.updateById(chargingOrder); |
| | | tcecClient.notificationEquipChargeStatus(order.getStartChargeSeq(), order.getOperatorId()); |
| | | |
| | | String code1 = order.getCode(); |
| | | Site site = siteClient.getSiteByIds(Arrays.asList(order.getSiteId())).getData().get(0); |
| | | if(1 == site.getIsOpenSynchronization()){ |
| | | tcecClient.notificationEquipChargeStatus(order.getStartChargeSeq(), order.getOperatorId()); |
| | | } |
| | | TChargingGun chargingGun = chargingGunClient.getChargingGunById(order.getChargingGunId()).getData(); |
| | | //异步线程处理停机 |
| | | ExecutorService cachedThreadPool = Executors.newFixedThreadPool(1); |
| | |
| | | PlatformStopCharging platformStopCharging = new PlatformStopCharging(); |
| | | platformStopCharging.setCharging_pile_code(chargingPile.getCode()); |
| | | platformStopCharging.setCharging_gun_code(chargingGun.getCode()); |
| | | log.info("【" + code1 + "】三方平台请求停止充电发起消息:" + JSON.toJSONString(platformStopCharging)); |
| | | sendMessageClient.platformStopCharging(platformStopCharging); |
| | | log.info(code1 + ":-------------------远程停止充电请求-------------------"); |
| | | log.info("【" + code1 + "】三方平台请求停止充电发起消息结束"); |
| | | log.info(platformStopCharging.toString()); |
| | | }); |
| | | return R.ok(); |
| | |
| | | // tcecClient.notificationEquipChargeStatus(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | // tcecClient.notificationStopChargeResult(chargingOrder.getStartChargeSeq(), chargingOrder.getChargingGunId().toString(), |
| | | // chargingOrder.getOperatorId()); |
| | | tcecClient.notificationChargeOrderInfo(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | return R.ok(); |
| | | return tcecClient.notificationChargeOrderInfo(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | } |
| | | |
| | | |