private OtherPersonnel getOtherPersonnel ( BudgetPeriodDto periodInfo ) { OtherPersonnel otherPersonnel = OtherPersonnel . Factory . newInstance ( ) ; int OtherpersonalCount = 0 ; List < OtherPersonnelDataType > otherPersonnelList = new ArrayList <> ( ) ; OtherPersonnelDataType otherPersonnelDataTypeArray [ ] = new OtherPersonnelDataType [ 1 ] ; if ( periodInfo != null ) { for ( OtherPersonnelDto otherPersonnelInfo : periodInfo . getOtherPersonnel ( ) ) { if ( OTHERPERSONNEL_POSTDOC . equals ( otherPersonnelInfo . getPersonnelType ( ) ) ) { otherPersonnel . setPostDocAssociates ( getPostDocAssociates ( otherPersonnelInfo ) ) ; } else if ( OTHERPERSONNEL_GRADUATE . equals ( otherPersonnelInfo . getPersonnelType ( ) ) ) { otherPersonnel . setGraduateStudents ( getGraduateStudents ( otherPersonnelInfo ) ) ; } else if ( OTHERPERSONNEL_UNDERGRADUATE . equals ( otherPersonnelInfo . getPersonnelType ( ) ) ) { otherPersonnel . setUndergraduateStudents ( getUndergraduateStudents ( otherPersonnelInfo ) ) ; } else if ( OTHERPERSONNEL_SECRETARIAL . equals ( otherPersonnelInfo . getPersonnelType ( ) ) ) { otherPersonnel . setSecretarialClerical ( getSecretarialClerical ( otherPersonnelInfo ) ) ; } else if ( OtherpersonalCount < OTHERPERSONNEL_MAX_ALLOWED ) { // Max // allowed // is 6 OtherPersonnelDataType otherPersonnelDataType = OtherPersonnelDataType . Factory . newInstance ( ) ; otherPersonnelDataType . setNumberOfPersonnel ( otherPersonnelInfo . getNumberPersonnel ( ) ) ; otherPersonnelDataType . setProjectRole ( otherPersonnelInfo . getRole ( ) ) ; otherPersonnelDataType . setCompensation ( getSectBCompensationDataType ( otherPersonnelInfo . getCompensation ( ) ) ) ; otherPersonnelList . add ( otherPersonnelDataType ) ; OtherpersonalCount ++ ; } } otherPersonnelDataTypeArray = otherPersonnelList . toArray ( otherPersonnelDataTypeArray ) ; otherPersonnel . setOtherArray ( otherPersonnelDataTypeArray ) ; if ( periodInfo . getOtherPersonnelTotalNumber ( ) != null ) { otherPersonnel . setOtherPersonnelTotalNumber ( periodInfo . getOtherPersonnelTotalNumber ( ) . intValue ( ) ) ; } if ( periodInfo . getTotalOtherPersonnelFunds ( ) != null ) { otherPersonnel . setTotalOtherPersonnelFund ( periodInfo . getTotalOtherPersonnelFunds ( ) . bigDecimalValue ( ) ) ; } } return otherPersonnel ; }
This method gets OtherPersonnel informations like PostDocAssociates GraduateStudents UndergraduateStudents SecretarialClerical based on PersonnelType and also gets NumberOfPersonnel ProjectRole Compensation OtherPersonnelTotalNumber and TotalOtherPersonnelFund based on BudgetPeriodInfo for the RRBudget .