Package com.google.code.lightssh.project.party.entity

Examples of com.google.code.lightssh.project.party.entity.Organization


      throw new ApplicationException("人员信息["+t.getPerson().getId()+"]不存在!");
   
    if( t.getOrganization() == null || StringUtils.isEmpty(t.getOrganization().getId()))
      throw new ApplicationException("部门信息为空!");
   
    Organization org = partyManager.getOrganization(t.getOrganization().getId());
    if( org == null )
      throw new ApplicationException("部门信息["+t.getOrganization().getId()+"]不存在!");
   
    Employee db_e = get(p);
    if( db_e == null ){
View Full Code Here


 
  /**
   * popup
   */
  public String popup( ){
    Organization root = partyManager.listRollup();
    request.setAttribute("popup_org_rollup", root );
   
    return SUCCESS;
  }
View Full Code Here

  private final String ORG = "organization";
 
  @SuppressWarnings("rawtypes")
  public Object convertFromString(Map context, String[] values, Class toClass){
    if( values == null || values[0] == null || values[0].equals(ORG))
      return new Organization();
   
    return new Person();
  }
View Full Code Here

    }
   
  }
 
  public void remove(Organization t, Access access) {
    Organization party = this.getOrganizationWithChildren( t );
    if( party == null )
      return;
   
    if( party.getChildren() != null && !party.getChildren().isEmpty() )
      throw new ApplicationException("组织机构("
          +party.getId()+")存在下级组织,不允许删除!");
   
    //dao.delete(party);
   
    if( access != null && isDoLog(party))
      accessManager.log(access, party, null);
View Full Code Here

  public Organization getParentOrganization() {
    List<Party> list = partyRoleManager.listParty( RoleType.PARENT_ORG );
    if (list==null||list.isEmpty())
      return null;
   
    Organization result = null;
    for( Party party:list )
      if( party instanceof Organization ){
        result = (Organization)party;
        break;
      }
View Full Code Here

  @Override
  public Organization getOrganization(String partyid) {
    if( partyid == null )
      return null;
   
    Organization org = new Organization();
    org.setId( partyid );
   
    return getOrganization( org );
  }
View Full Code Here

    return (Person)getDao().read(Person.class, party);
  }

  @Override
  public Organization getOrganizationWithParent(Party party) {
    Organization org = this.getOrganization(party);
    if( org != null ){
      PartyRelationship relationship = partyRelationshipManager
        .getRollupByFromParty(org);
      if( relationship != null && relationship.getTo() != null
          && relationship.getTo() != null ){

        Organization parent = this.getOrganization(relationship.getTo().getParty() );
        //&& relationship.getTo().getParty() instanceof Organization
        org.setParent( parent );
      }
    }
   
View Full Code Here

   
    return org;
  }
 
  public Organization getOrganizationWithChildren(Party party){
    Organization org = this.getOrganization(party);
    if( org != null ){
      List<PartyRelationship> relationships = partyRelationshipManager
        .listRollupByToParty(org);
      if( relationships != null && !relationships.isEmpty() )
        for( PartyRelationship item:relationships ){
          if( item.getTo() != null &&
              item.getFrom().getParty() instanceof Organization)
            org.addChild((Organization)item.getFrom().getParty() );
        }//end for
    }
   
    return org;
  }
View Full Code Here

          return (Organization)party;
     
      return null;
    }
   
    Organization root = null;
    Set<Party> set = new HashSet<Party>( );
    for( PartyRelationship pr:list ){
      Organization to = getOrganization(pr.getTo().getParty());
      Organization from = getOrganization(pr.getFrom().getParty());
      if( to !=null && from != null ){
        pr.getTo().setParty(to);
        pr.getFrom().setParty(from);
        set.add( to );
        set.add( from );
View Full Code Here

TOP

Related Classes of com.google.code.lightssh.project.party.entity.Organization

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.