Package com.ketayao.ketacustom.exception

Examples of com.ketayao.ketacustom.exception.NotDeletedException


   * @see com.ketayao.ketacustom.service.OrganizationService#delete(java.lang.Long
   */
  @Override
  public void delete(Long id) {
    if (isRoot(id)) {
      throw new NotDeletedException("不允许删除根组织。");
    }
   
    Organization organization = this.get(id);
   
    //先判断是否存在子模块,如果存在子模块,则不允许删除
    if(organization.getChildren().size() > 0){
      throw new NotDeletedException(organization.getName() + "组织下存在子组织,不允许删除。");
    }
   
    if (userDAO.findByOrganizationId(id).size() > 0) {
      throw new NotDeletedException(organization.getName() + "组织下存在用户,不允许删除。");
    }
   
    organizationDAO.delete(organization);
  }
View Full Code Here


  @Override
  public void delete(Long id) {
    if (isSupervisor(id)) {
      logger.warn("操作员{},尝试删除超级管理员用户", SecurityUtils.getSubject()
          .getPrincipal() + "。");
      throw new NotDeletedException("不能删除超级管理员用户。");
    }
    User user = userDAO.findOne(id);
    userDAO.delete(user.getId());
   
    // TODO 从shiro中注销
View Full Code Here

   * @see com.ketayao.ketacustom.service.ModuleService#delete(java.lang.Long
   */
  @Override
  public void delete(Long id) {
    if (isRoot(id)) {
      throw new NotDeletedException("不允许删除根模块。");
    }
   
    Module module = this.get(id);
   
    //先判断是否存在子模块,如果存在子模块,则不允许删除
    if(module.getChildren().size() > 0){
      throw new NotDeletedException(module.getName() + "模块下存在子模块,不允许删除。");
    }
   
    moduleDAO.delete(module);
  }
View Full Code Here

TOP

Related Classes of com.ketayao.ketacustom.exception.NotDeletedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.