| | |
| | | private SystemConfigurationClient systemConfigurationClient; |
| | | @Autowired |
| | | private TCECSuperviseUtil tcecSuperviseUtil; |
| | | |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(10, 50, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue<Runnable>()); |
| | | |
| | | private final static String operatorId = "906171535"; |
| | | |
| | | /** |
| | |
| | | NotificationStationChangeResult notificationStationChange = TCECKDUtil.notificationStationChange(operator, 3, siteIds); |
| | | //启动重试推送机制 |
| | | if(null == notificationStationChange || 1 == notificationStationChange.getSuccStat()){ |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); |
| | | |
| | | threadPoolExecutor.execute(new Runnable() { |
| | | //计数器 |
| | | Integer size = 0; |
| | |
| | | //启动重试推送机制 |
| | | if(null == notificationStartChargeResult || 1 == notificationStartChargeResult.getSuccStat()){ |
| | | |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); |
| | | threadPoolExecutor.execute(new Runnable() { |
| | | //计数器 |
| | | Integer size = 0; |
| | |
| | | NotificationEquipChargeStatusResult notificationEquipChargeStatusResult = TCECUtil.notificationEquipChargeStatus(operator, queryEquipChargeStatusResult); |
| | | //启动重试推送机制 |
| | | if(null == notificationEquipChargeStatusResult || 1 == notificationEquipChargeStatusResult.getSuccStat()){ |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); |
| | | threadPoolExecutor.execute(new Runnable() { |
| | | //计数器 |
| | | Integer size = 0; |
| | |
| | | @PostMapping("/notificationStopChargeResult") |
| | | public R notificationStopChargeResult(@RequestParam("startChargeSeq") String startChargeSeq, @RequestParam("connectorID") String connectorID, |
| | | @RequestParam("operatorId") Integer operatorId){ |
| | | TChargingOrder chargingOrder = chargingOrderClient.getChargingOrderByStartChargeSeq(startChargeSeq).getData(); |
| | | if(null == chargingOrder){ |
| | | return null; |
| | | } |
| | | List<TChargingOrderAccountingStrategy> data = chargingOrderAccountingStrategyClient.getChargingOrderAccountingStrategyByOrderId(chargingOrder.getId()).getData(); |
| | | Operator operator = operatorClient.getOperatorById(operatorId).getData(); |
| | | NotificationStopChargeResult info = new NotificationStopChargeResult(); |
| | | info.setStartChargeSeq(startChargeSeq); |
| | | info.setStartChargeSeqStat(4); |
| | | info.setConnectorID(connectorID); |
| | | info.setSuccStat(0); |
| | | info.setFailReason(0); |
| | | info.setStartChargeSeqStat(4); |
| | | if(data.isEmpty()){ |
| | | info.setSuccStat(1); |
| | | info.setFailReason(3); |
| | | }else{ |
| | | info.setSuccStat(0); |
| | | info.setFailReason(0); |
| | | } |
| | | NotificationStopCharge notificationStopCharge = TCECUtil.notificationStopChargeResult(operator, info); |
| | | //启动重试推送机制 |
| | | if(null == notificationStopCharge || 1 == notificationStopCharge.getSuccStat()){ |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); |
| | | threadPoolExecutor.execute(new Runnable() { |
| | | //计数器 |
| | | Integer size = 0; |
| | |
| | | @PostMapping("/notificationChargeOrderInfo") |
| | | public R notificationChargeOrderInfo(@RequestParam("startChargeSeq") String startChargeSeq, @RequestParam("operatorId") Integer operatorId){ |
| | | NotificationChargeOrderInfo info = buildNotificationChargeOrderInfo(startChargeSeq); |
| | | if(null == info){ |
| | | return R.fail("引流平台同步数据失败"); |
| | | } |
| | | Operator operator = operatorClient.getOperatorById(operatorId).getData(); |
| | | NotificationChargeOrderInfoResult notificationChargeOrderInfoResult = TCECUtil.notificationChargeOrderInfo(operator, info); |
| | | //启动重试推送机制 |
| | | if(null == notificationChargeOrderInfoResult || 1 == notificationChargeOrderInfoResult.getConfirmResult()){ |
| | | ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); |
| | | threadPoolExecutor.execute(new Runnable() { |
| | | //计数器 |
| | | Integer size = 0; |
| | |
| | | notificationChargeOrderInfo.setTotalPower(chargingOrder.getElectricity()); |
| | | |
| | | List<TChargingOrderAccountingStrategy> data = chargingOrderAccountingStrategyClient.getChargingOrderAccountingStrategyByOrderId(chargingOrder.getId()).getData(); |
| | | if(data.isEmpty()){ |
| | | return null; |
| | | } |
| | | if(data.size() > 0){ |
| | | BigDecimal totalElectricity = data.stream().map(TChargingOrderAccountingStrategy::getPeriodElectricPrice).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(4, RoundingMode.HALF_EVEN); |
| | | BigDecimal serviceCharge = data.stream().map(TChargingOrderAccountingStrategy::getPeriodServicePrice).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(4, RoundingMode.HALF_EVEN); |