예제 #1
0
 @Override
 public List<SysParamItemVo> queryValid(String type) {
   if (StringUtils.isEmpty(type)) {
     throw new IllegalArgumentException("根据参数类型查询有效的选项时,没有获得类型编号!");
   }
   SysParamItemBo bo = new SysParamItemBo();
   bo.setType(type);
   bo.setStatus(CommonStatus.ACTIVE.getValue());
   List<SysParamItem> items = dao.query(bo);
   return VoHelper.wrapVos(
       items,
       new VoWrapper<SysParamItem, SysParamItemVo>() {
         @Override
         public SysParamItemVo wrap(SysParamItem sysParamItem) {
           SysParamItemVo vo = new SysParamItemVo();
           vo.setId(sysParamItem.getId());
           vo.setName(sysParamItem.getName());
           vo.setType(sysParamItem.getType());
           vo.setValue(sysParamItem.getValue());
           vo.setCascadeTypeCode(sysParamItem.getCascadeTypeCode());
           vo.setCascadeItemValue(sysParamItem.getCascadeItemValue());
           return vo;
         }
       });
 }
예제 #2
0
 /**
  * 查询用户是否在线 如果userId为空,返回false
  *
  * @param userId 用户id
  * @return true在线,false不在线
  */
 public boolean isOnline(String userId) {
   if (StringUtils.isEmpty(userId)) return false;
   String tenementId = SecurityContext.getTenementId();
   Set<UserVo> vos = pool.get(tenementId);
   if (vos == null) return false;
   UserVo vo = new UserVo();
   vo.setId(userId);
   return vos.contains(vo);
 }