| | |
| | | if (StringUtils.isNotBlank(parentId)) { |
| | | queryWrapper.likeRight("dept_id", parentId); |
| | | } |
| | | queryWrapper.orderByAsc("order_num"); |
| | | |
| | | return gatewaySerMapper.selectList(queryWrapper); |
| | | } |
| | |
| | | |
| | | if(isUpdateTime){ |
| | | //心跳时间 |
| | | ser.setHeartbeatTime(new Date()); |
| | | ser.setUpdateTime(new Date()); |
| | | } |
| | | |
| | | ser.setUpdateTime(new Date()); |
| | | ser.setStatus(status); |
| | | gatewaySerMapper.updateById(ser); |
| | | |
| | |
| | | |
| | | //删除缓存 |
| | | delCache(ser); |
| | | } |
| | | |
| | | /** |
| | | * 获取组织下所有网关信息 |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | public List<GatewaySer> getCacheSer(String companyId) { |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | |
| | | List<GatewaySer> result = new ArrayList<>(); |
| | | String patten = RedisConst.buildKey(companyId, RedisConst.KEY_GATEWAY_SER_LIST) + "*"; |
| | | Collection<String> keys = redisCache.keys(patten); |
| | | if (null != keys) { |
| | | for (String key : keys) { |
| | | result.add((GatewaySer) redisCache.getCacheObject(key)); |
| | | } |
| | | } |
| | | if(result.isEmpty()){ |
| | | result = getAllSer(); |
| | | this.setCacheSer(result); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |