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

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


 
  /**
   * 根据人员ID查询人事信息
   */
  public Employee getByPerson(String personId){
    Person p = new Person();
    p.setId( personId);
   
    return getDao().get(p);
  }
View Full Code Here


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

        hql.append( " AND m.name like ? " );
        params.add( "%" + t.getName().trim() + "%");
      }
     
      if( t instanceof Person ){
        Person p = (Person)t;
        if( StringUtils.isNotEmpty(p.getIdentityCardNumber()) ){
          hql.append( " AND m.identityCardNumber like ? " );
          params.add( "%" + p.getIdentityCardNumber().trim() + "%");
        }
       
        if( p.getCredentialsType() != null ){
          hql.append( " AND m.credentialsType = ? " );
          params.add( p.getCredentialsType() );
        }
       
        //人事信息
        if(p.getEmployee() != null ){
          Employee employee = p.getEmployee();
         
          StringBuffer hql_emp = new StringBuffer(" SELECT e.person.id FROM " );
          hql_emp.append( Employee.class.getName() );
          hql_emp.append(" AS e WHERE 1=1 ");
         
View Full Code Here

  @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

   
    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 );
View Full Code Here

TOP

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

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.