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

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


    if( ReceiveType.ALL.equals(type) ){
      return "所有人";
    }else if( ReceiveType.DEPARTMENT.equals(type)
        || ReceiveType.PERSON.equals(type)  ){
      PartyManager partyMgr = (PartyManager)SpringContextHelper.getBean( "partyManager" );
      Party party = partyMgr.get( val );
     
      return party==null?"":party.getName();
    }else if( ReceiveType.ROLE.equals(type) ){
      RoleManager roleMgr = (RoleManager)SpringContextHelper.getBean( "roleManager" );
      Role role = roleMgr.get( val );
     
      return role==null?"":role.getName();
View Full Code Here


  public void remove(Party t, Access access) {
    Class<?> clazz = Person.class;
    if( t instanceof Organization )
      clazz = Organization.class;
   
    Party party = getDao().read(clazz,t);
    if( party != null ){
      dao.delete(party);
     
      if( access != null && isDoLog(party))
        accessManager.log(access, party, null);
View Full Code Here

  @Override
  public void save(Party party, Access access) {
    if( party == null )
      throw new ApplicationException("数据为空,不能进行保存!");
   
    Party original = null;
    boolean inserted = StringUtil.clean( party.getIdentity() ) == null;
   
    if( party instanceof Organization && !isUniqueName( party ) )
      throw new ApplicationException("名称["+party.getName()+"]已经存在!");
   
    if( party instanceof Person ){
      Person p =  ((Person) party);
      if( p.getCountry() != null
          && StringUtils.isEmpty(p.getCountry().getIdentity()))
        p.setCountry(null);
     
      if( p.getSecondaryGeo() != null
          && StringUtils.isEmpty(p.getSecondaryGeo().getIdentity()) )
        p.setSecondaryGeo(null);
     
      if( p.getThirdGeo() != null
          && StringUtils.isEmpty(p.getThirdGeo().getIdentity()) )
        p.setThirdGeo(null);
     
      if( p.getFourthGeo() != null
          && StringUtils.isEmpty(p.getFourthGeo().getIdentity()) )
        p.setFourthGeo(null);
    }
   
    if( inserted ){
      party.setId( sequenceManager.nextSequenceNumber( party ) );
      dao.create( party );
    }else{
      Party old = dao.read( party );
      if( old != null ){
        original = old.clone();
        ReflectionUtil.assign(party, old);
        dao.update( old );
      }
    }
   
View Full Code Here

      }
    }
   
    if( root != null ){
      for( PartyRelationship pr:list ){
        Party to = pr.getTo().getParty();
        Party from = pr.getFrom().getParty();
        if( set.contains( to ) ) //构造树
          ((Organization)to).addChild( (Organization)from );
      }
    }
   
View Full Code Here

TOP

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

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.