| | |
| | | } |
| | | } |
| | | |
| | | private synchronized void notifyMsg(String deviceType, Integer device) { |
| | | private synchronized void notifyMsg(String notifyType, Integer device) { |
| | | Config notifyEnableConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyEnable")); |
| | | if(notifyEnableConfig == null){ |
| | | return; |
| | |
| | | } |
| | | String notifyUriPath = notifyUriPathConfig.getValue(); |
| | | |
| | | List<String> keys = notifyUtils.takeKeys(deviceType, device); |
| | | List<String> keys = notifyUtils.takeKeys(notifyType, device); |
| | | if(keys == null){ |
| | | return; |
| | | } |
| | |
| | | if(code == 200){ |
| | | //通知成功 |
| | | redisUtil.del(key); |
| | | return; |
| | | continue; |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | if (times >= notifyDto.getFailTimes()) { |
| | | //超过次数 |
| | | redisUtil.del(key); |
| | | return; |
| | | continue; |
| | | } |
| | | |
| | | notifyDto.setLastRetryTime(System.currentTimeMillis()); |
| | | notifyDto.setRetryTimes(times); |
| | | redisUtil.set(key, notifyDto); |
| | | return; |
| | | continue; |
| | | } |
| | | } |
| | | |