| | |
| | | * 站点车辆满架率预警 |
| | | * @throws Exception |
| | | */ |
| | | @Scheduled(fixedDelay = 1000L * 60L * 5L) |
| | | @Scheduled(fixedDelay = 1000L * 60L * 3L) |
| | | public void siteReserves() throws Exception { |
| | | log.info("=====================开始 站点车辆满架率预警======================="); |
| | | sitesService.siteReservesNotice();; |
| | |
| | | } |
| | | BigDecimal warnMin = new BigDecimal(systemDictDataBiz.queryByCode(Constants.MINI_PROGRAMME,Constants.WARN_MIN).getCode()); |
| | | BigDecimal warnMax = new BigDecimal(systemDictDataBiz.queryByCode(Constants.MINI_PROGRAMME,Constants.WARN_MAX).getCode()); |
| | | BigDecimal rata = new BigDecimal(s.getBikeCount()).divide(new BigDecimal(s.getAllLockNum()),2,BigDecimal.ROUND_HALF_UP); |
| | | BigDecimal rata = new BigDecimal(s.getBikeCount()).divide(new BigDecimal(s.getAllLockNum()),2,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100L)); |
| | | if(rata.compareTo(warnMax)>Constants.ZERO){ |
| | | //发送钉钉通知 |
| | | DingDingNotice.reservesNotice(s.getName(), |