| | |
| | | import com.ruoyi.integration.api.model.*; |
| | | import com.ruoyi.integration.api.vo.ChargingOrderVo; |
| | | import com.ruoyi.integration.api.vo.GetPlatformStopChargingReply; |
| | | import com.ruoyi.integration.api.vo.NotificationConnectorChargeStatusVo; |
| | | import com.ruoyi.integration.api.vo.StartChargeResult; |
| | | import com.ruoyi.order.api.dto.SettlementConfirmAdd; |
| | | import com.ruoyi.order.api.feignClient.AccountingStrategyDetailOrderClient; |
| | |
| | | |
| | | @Resource |
| | | private ChargingMessageClient chargingMessageClient; |
| | | |
| | | @Resource |
| | | private ChengDuJianGuanClient chengDuJianGuanClient; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | log.info(chargingOrder.getCode() + ":-------------------远程调起开始充电请求-------------------" + platformStartCharging.toString()); |
| | | sendMessageClient.platformStartCharging(platformStartCharging); |
| | | |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.SECONDS, new LinkedBlockingDeque<>()); |
| | | threadPoolExecutor.execute(()->{ |
| | | //推送成都监管 |
| | | NotificationConnectorChargeStatusVo vo = new NotificationConnectorChargeStatusVo(); |
| | | vo.setOrderCode(chargingOrder.getCode()); |
| | | vo.setChargingGunId(chargingOrder.getChargingGunId()); |
| | | chengDuJianGuanClient.notificationConnectorChargeStatus(vo); |
| | | }); |
| | | |
| | | |
| | | // //异步线程检测远程启动的应答结果。如果失败,则需要全额退款 |
| | | // Long id = chargingOrder.getId(); |
| | | // //执行5分钟的定时任务检测 |
| | |
| | | chargingOrder.setStartTime(LocalDateTime.now()); |
| | | } |
| | | this.updateById(chargingOrder); |
| | | |
| | | if (chargingOrder.getStatus() == 3) { |
| | | //推送监管平台订单状态 |
| | | new Thread(() -> { |
| | |
| | | if (2 == chargingOrder.getOrderSource() && 1 == site.getIsOpenSynchronization()) { |
| | | tcecClient.notificationEquipChargeStatus(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | } |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.SECONDS, new LinkedBlockingDeque<>()); |
| | | threadPoolExecutor.execute(()->{ |
| | | //推送成都监管 |
| | | NotificationConnectorChargeStatusVo vo = new NotificationConnectorChargeStatusVo(); |
| | | vo.setOrderCode(chargingOrder.getCode()); |
| | | vo.setChargingGunId(chargingOrder.getChargingGunId()); |
| | | chengDuJianGuanClient.notificationConnectorChargeStatus(vo); |
| | | }); |
| | | return true; |
| | | } else { |
| | | Integer counter = boot_failed_map.get(code); |
| | |
| | | if (2 == chargingOrder.getOrderSource() && 1 == site.getIsOpenSynchronization()) { |
| | | tcecClient.notificationEquipChargeStatus(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | } |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.SECONDS, new LinkedBlockingDeque<>()); |
| | | threadPoolExecutor.execute(()->{ |
| | | //推送成都监管 |
| | | NotificationConnectorChargeStatusVo vo = new NotificationConnectorChargeStatusVo(); |
| | | vo.setOrderCode(chargingOrder.getCode()); |
| | | vo.setChargingGunId(chargingOrder.getChargingGunId()); |
| | | chengDuJianGuanClient.notificationConnectorChargeStatus(vo); |
| | | }); |
| | | return true; |
| | | } |
| | | } |
| | |
| | | if (2 == order.getOrderSource() && 1 == site.getIsOpenSynchronization()) { |
| | | tcecClient.notificationEquipChargeStatus(order.getStartChargeSeq(), order.getOperatorId()); |
| | | } |
| | | |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.SECONDS, new LinkedBlockingDeque<>()); |
| | | threadPoolExecutor.execute(()->{ |
| | | //推送成都监管 |
| | | NotificationConnectorChargeStatusVo vo = new NotificationConnectorChargeStatusVo(); |
| | | vo.setOrderCode(order.getCode()); |
| | | vo.setChargingGunId(order.getChargingGunId()); |
| | | chengDuJianGuanClient.notificationConnectorChargeStatus(vo); |
| | | }); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | } |
| | | }).start(); |
| | | } |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.SECONDS, new LinkedBlockingDeque<>()); |
| | | TChargingOrder finalChargingOrder1 = chargingOrder; |
| | | threadPoolExecutor.execute(()->{ |
| | | //推送成都监管 |
| | | NotificationConnectorChargeStatusVo statusVo = new NotificationConnectorChargeStatusVo(); |
| | | statusVo.setOrderCode(finalChargingOrder1.getCode()); |
| | | statusVo.setChargingGunId(finalChargingOrder1.getChargingGunId()); |
| | | chengDuJianGuanClient.notificationConnectorChargeStatus(statusVo); |
| | | chengDuJianGuanClient.notificationOrderInfo(statusVo); |
| | | }); |
| | | |
| | | //开始将优惠券优惠的金额添加到明细中 |
| | | BigDecimal couponDiscountAmount = chargingOrder.getCouponDiscountAmount(); |
| | |
| | | chargingOrderRefundService.save(chargingOrderRefund); |
| | | |
| | | } |
| | | } |
| | | |
| | | if(5 == tChargingOrder.getStatus()){ |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.SECONDS, new LinkedBlockingDeque<>()); |
| | | threadPoolExecutor.execute(()->{ |
| | | //推送成都监管 |
| | | NotificationConnectorChargeStatusVo statusVo = new NotificationConnectorChargeStatusVo(); |
| | | statusVo.setOrderCode(tChargingOrder.getCode()); |
| | | statusVo.setChargingGunId(tChargingOrder.getChargingGunId()); |
| | | chengDuJianGuanClient.notificationConnectorChargeStatus(statusVo); |
| | | chengDuJianGuanClient.notificationOrderInfo(statusVo); |
| | | }); |
| | | } |
| | | } |
| | | if (payOrderQueryDto.getType() == 2) { |
| | |
| | | //推送三方平台订单状态 |
| | | tcecClient.notificationEquipChargeStatus(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | } |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.SECONDS, new LinkedBlockingDeque<>()); |
| | | threadPoolExecutor.execute(()->{ |
| | | //推送成都监管 |
| | | NotificationConnectorChargeStatusVo statusVo = new NotificationConnectorChargeStatusVo(); |
| | | statusVo.setOrderCode(chargingOrder.getCode()); |
| | | statusVo.setChargingGunId(chargingOrder.getChargingGunId()); |
| | | chengDuJianGuanClient.notificationConnectorChargeStatus(statusVo); |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | log.info("【" + code1 + "】三方平台请求停止充电发起消息结束"); |
| | | log.info(platformStopCharging.toString()); |
| | | }); |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.SECONDS, new LinkedBlockingDeque<>()); |
| | | threadPoolExecutor.execute(()->{ |
| | | //推送成都监管 |
| | | NotificationConnectorChargeStatusVo statusVo = new NotificationConnectorChargeStatusVo(); |
| | | statusVo.setOrderCode(chargingOrder.getCode()); |
| | | statusVo.setChargingGunId(chargingOrder.getChargingGunId()); |
| | | chengDuJianGuanClient.notificationConnectorChargeStatus(statusVo); |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |