| | |
| | | /** |
| | | * 根据分机ID获取分机信息 |
| | | * |
| | | * @param deptId |
| | | * @return |
| | | */ |
| | | public GatewaySer getCacheSerByDeptId(String deptId) { |
| | | if (StringUtils.isEmpty(deptId)) { |
| | | return null; |
| | | } |
| | | |
| | | String patten = RedisConst.buildKey(ContextUtil.getCompanyId(), RedisConst.KEY_GATEWAY_SER_LIST) + "*"; |
| | | Collection<String> keys = redisCache.keys(patten); |
| | | if (null == keys) { |
| | | return null; |
| | | } |
| | | |
| | | GatewaySer ser = null; |
| | | for (String key : keys) { |
| | | ser = (GatewaySer) redisCache.getCacheObject(key); |
| | | if(deptId.equals(ser.getDeptId())){ |
| | | return ser; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 根据分机ID获取分机信息 |
| | | * |
| | | * @param companyId |
| | | * @param id |
| | | * @return |