예제 #1
0
 @Override
 public boolean findByCodeAndId(String code, String id) throws DatabaseException {
   DataField dataField = null;
   code = StringUtils.trimToEmpty(code);
   if (Strings.isNullOrEmpty(code)) {
     return false;
   }
   if (StringUtils.isNotBlank(id)) {
     dataField = dataFieldDao.findByCodeAndId(code, id);
   } else {
     dataField = dataFieldDao.findByCode(code);
   }
   if (dataField != null) {
     return false;
   }
   return true;
 }
예제 #2
0
  @Override
  public List<DataField> findDataFieldByEnable(User user, String menuIds) throws DatabaseException {
    List<DataField> resultList = Lists.newArrayList();
    List<DataField> dataFieldList = dataFieldDao.findDataFieldByEnable();
    for (DataField dataField : dataFieldList) {
      String users = dataField.getUsers();
      if (users.contains(user.getId())) {
        dataField.setIsChecked(1);
      }

      if (StringUtils.isNotBlank(menuIds)
          && dataField.getMenu() != null
          && StringUtils.isNotBlank(dataField.getMenu().getId())) {
        if (!menuIds.contains(dataField.getMenu().getId())) { // 过滤所有包含该菜单ID的按钮
          resultList.add(dataField);
        }
      }
    }

    if (resultList != null && resultList.size() > 0) {
      dataFieldList.removeAll(resultList);
    }
    return dataFieldList;
  }
예제 #3
0
 @Override
 @Transactional(readOnly = false)
 public Integer updateDataFieldIsEnable(String id) throws DatabaseException {
   return dataFieldDao.updateDataFieldIsEnable(id);
 }
예제 #4
0
 @Override
 @Transactional(readOnly = false)
 public DataField update(DataField dataField) throws DatabaseException {
   return dataFieldDao.save(dataField);
 }
예제 #5
0
 @Transactional(readOnly = false)
 public DataField save(DataField dataField) {
   return dataFieldDao.save(dataField);
 }
예제 #6
0
 public DataField findByCode(String code) throws DatabaseException {
   return dataFieldDao.findByCode(code);
 }
예제 #7
0
 public DataField findOne(String id) {
   return dataFieldDao.findOne(id);
 }
예제 #8
0
 @Override
 public List<DataField> findAll() throws DatabaseException {
   return (List<DataField>) dataFieldDao.findAll(new Sort(Direction.ASC, "id"));
 }