}
public List<String> findPositionUserIds(PartyEntity parent,
String positionName) {
List<String> userIds = new ArrayList<String>();
PartyEntity partyEntity = this.findUpperDepartment(parent);
while (partyEntity != null) {
if (partyEntity.getPartyType().getType() == TYPE_ORG) {
for (PartyStruct partyStruct : partyEntity.getChildStructs()) {
PartyEntity child = partyStruct.getChildEntity();
if ((child.getPartyType().getType() == TYPE_POSITION)
&& child.getName().equals(positionName)) {
for (PartyStruct ps : child.getChildStructs()) {
userIds.add(ps.getChildEntity().getRef());
}
}
}
} else if ((parent.getPartyType().getType() == TYPE_POSITION)
&& parent.getName().equals(positionName)) {
for (PartyStruct partyStruct : parent.getChildStructs()) {
PartyEntity child = partyStruct.getChildEntity();
if (child.getPartyType().getType() == TYPE_USER) {
userIds.add(child.getRef());
}
}
}
if (userIds.isEmpty()) {