| | |
| | | |
| | | @Resource |
| | | private ChengDuJianGuanClient chengDuJianGuanClient; |
| | | |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(10, 100, 1, TimeUnit.MINUTES, new LinkedBlockingDeque<>()); |
| | | |
| | | |
| | | /** |
| | |
| | | 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(); |
| | |
| | | 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(()->{ |
| | | if (chargingOrder.getStatus() == 3) { |
| | | //推送监管平台订单状态 |
| | |
| | | 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(()->{ |
| | | if (chargingOrder.getStatus() == 3) { |
| | | //推送监管平台订单状态 |
| | |
| | | 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(); |
| | |
| | | Object refund_fee1 = amount1.get("refund_fee"); |
| | | BigDecimal refund_fee = new BigDecimal(null == refund_fee1 ? "0" : refund_fee1.toString()).divide(new BigDecimal(100)); |
| | | chargingOrderRefund.setRefundFee(refund_fee); |
| | | chargingOrderRefundService.updateById(chargingOrderRefund); |
| | | chargingOrderRefundService.lambdaUpdate() |
| | | .eq(TChargingOrderRefund::getId, chargingOrderRefund.getId()) |
| | | .eq(TChargingOrderRefund::getChargingOrderId, chargingOrderRefund.getChargingOrderId()) |
| | | .set(TChargingOrderRefund::getRefundFee, refund_fee) |
| | | .update(); |
| | | |
| | | //回退会员折扣次数 |
| | | if (chargingOrder.getVipDiscountAmount().compareTo(BigDecimal.ZERO) > 0) { |
| | | TAppUser appUser = appUserClient.getUserById(chargingOrder.getAppUserId()).getData(); |
| | |
| | | Object refund_fee1 = amount1.get("refund_fee"); |
| | | BigDecimal refund_fee = new BigDecimal(null == refund_fee1 ? "0" : refund_fee1.toString()).divide(new BigDecimal(100)); |
| | | chargingOrderRefund.setRefundFee(refund_fee); |
| | | chargingOrderRefundService.updateById(chargingOrderRefund); |
| | | chargingOrderRefundService.lambdaUpdate() |
| | | .eq(TChargingOrderRefund::getChargingOrderId, chargingOrderRefund.getChargingOrderId()) |
| | | .eq(TChargingOrderRefund::getId, chargingOrderRefund.getId()) |
| | | .set(TChargingOrderRefund::getRefundFee, refund_fee) |
| | | .update(); |
| | | } |
| | | } |
| | | if (2 == rechargePaymentType) { |
| | |
| | | one.setRefundSerialNumber(refund_id); |
| | | one.setRefundStatus(2); |
| | | one.setRefundTime(LocalDateTime.now()); |
| | | chargingOrderRefundService.updateById(one); |
| | | |
| | | chargingOrderRefundService.update(one, new LambdaUpdateWrapper<TChargingOrderRefund>() |
| | | .eq(TChargingOrderRefund::getChargingOrderId, one.getChargingOrderId()) |
| | | .eq(TChargingOrderRefund::getId, one.getId())); |
| | | |
| | | if (money(one.getBalanceRefundAmount()).compareTo(BigDecimal.ZERO) > 0) { |
| | | changeUserBalance(order.getAppUserId(), money(one.getBalanceRefundAmount())); |
| | |
| | | log.info(platformStopCharging.toString()); |
| | | }); |
| | | Site site = siteClient.getSiteByIds(Arrays.asList(order.getSiteId())).getData().get(0); |
| | | //推送三方平台 |
| | | 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(()->{ |
| | | //推送三方平台 |
| | | if (2 == order.getOrderSource() && 1 == site.getIsOpenSynchronization()) { |
| | | tcecClient.notificationEquipChargeStatus(order.getStartChargeSeq(), order.getOperatorId()); |
| | | } |
| | | //推送成都监管 |
| | | NotificationConnectorChargeStatusVo vo = new NotificationConnectorChargeStatusVo(); |
| | | vo.setOrderCode(order.getCode()); |
| | |
| | | } |
| | | }).start(); |
| | | } |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.SECONDS, new LinkedBlockingDeque<>()); |
| | | TChargingOrder finalChargingOrder1 = chargingOrder; |
| | | threadPoolExecutor.execute(()->{ |
| | | //推送成都监管 |
| | |
| | | statusVo.setChargingGunId(finalChargingOrder1.getChargingGunId()); |
| | | chengDuJianGuanClient.notificationConnectorChargeStatus(statusVo); |
| | | chengDuJianGuanClient.notificationOrderInfo(statusVo); |
| | | |
| | | //推送监管平台订单状态和订单详情 |
| | | ChargingOrderVo chargingOrderVo = new ChargingOrderVo(); |
| | | BeanUtils.copyProperties(finalChargingOrder1, chargingOrderVo); |
| | | chargingMessageClient.pushOrderInfo(chargingOrderVo); |
| | | chargingMessageClient.pushOrderStatus(chargingOrderVo); |
| | | }); |
| | | |
| | | //开始将优惠券优惠的金额添加到明细中 |
| | |
| | | chargingGun = chargingGunClient.getChargingGunById(chargingOrder.getChargingGunId()).getData(); |
| | | //推送状态给三方平台 |
| | | if (2 == chargingOrder.getOrderSource() && 1 == site.getIsOpenSynchronization()) { |
| | | tcecClient.pushChargingGunStatus(chargingGun.getFullNumber(), 2); |
| | | TChargingGun finalChargingGun = chargingGun; |
| | | threadPoolExecutor.execute(()->{ |
| | | tcecClient.pushChargingGunStatus(finalChargingGun.getFullNumber(), 2); |
| | | }); |
| | | } |
| | | |
| | | //添加积分 |
| | |
| | | summaryData.setElectricPrice(electronic_reduce.setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | summaryData.setServicePrice(serviceMoney.setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | chargingOrderSummaryDataService.save(summaryData); |
| | | |
| | | //推送监管平台订单状态和订单详情 |
| | | ChargingOrderVo chargingOrderVo = new ChargingOrderVo(); |
| | | BeanUtils.copyProperties(chargingOrder, chargingOrderVo); |
| | | chargingMessageClient.pushOrderInfo(chargingOrderVo); |
| | | chargingMessageClient.pushOrderStatus(chargingOrderVo); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | Object refund_fee1 = amount1.get("refund_fee"); |
| | | BigDecimal refund_fee = new BigDecimal(null == refund_fee1 ? "0" : refund_fee1.toString()).divide(new BigDecimal(100)); |
| | | chargingOrderRefund.setRefundFee(refund_fee); |
| | | chargingOrderRefundService.updateById(chargingOrderRefund); |
| | | |
| | | chargingOrderRefundService.lambdaUpdate() |
| | | .eq(TChargingOrderRefund::getId, chargingOrderRefund.getId()) |
| | | .eq(TChargingOrderRefund::getChargingOrderId, chargingOrderRefund.getChargingOrderId()) |
| | | .set(TChargingOrderRefund::getRefundFee, refund_fee) |
| | | .update(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if(5 == tChargingOrder.getStatus()){ |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.SECONDS, new LinkedBlockingDeque<>()); |
| | | threadPoolExecutor.execute(()->{ |
| | | //推送成都监管 |
| | | NotificationConnectorChargeStatusVo statusVo = new NotificationConnectorChargeStatusVo(); |
| | |
| | | //推送三方平台订单状态 |
| | | tcecClient.notificationEquipChargeStatus(chargingOrder.getStartChargeSeq(), chargingOrder.getOperatorId()); |
| | | } |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.SECONDS, new LinkedBlockingDeque<>()); |
| | | threadPoolExecutor.execute(()->{ |
| | | //推送成都监管 |
| | | NotificationConnectorChargeStatusVo statusVo = new NotificationConnectorChargeStatusVo(); |
| | |
| | | log.info("【" + code1 + "】三方平台请求停止充电发起消息结束"); |
| | | log.info(platformStopCharging.toString()); |
| | | }); |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.SECONDS, new LinkedBlockingDeque<>()); |
| | | threadPoolExecutor.execute(()->{ |
| | | //推送成都监管 |
| | | NotificationConnectorChargeStatusVo statusVo = new NotificationConnectorChargeStatusVo(); |