use of org.mifos.customers.business.PositionEntity in project head by mifos.
the class CenterServiceFacadeWebTier method generatePositionsFromExistingCustomerPositions.
private void generatePositionsFromExistingCustomerPositions(CustomerBO customer, List<PositionEntity> customerPositions, List<CustomerPositionDto> customerPositionDtos) {
for (PositionEntity position : customerPositions) {
for (CustomerPositionEntity entity : customer.getCustomerPositions()) {
if (position.getId().equals(entity.getPosition().getId())) {
CustomerPositionDto customerPosition;
if (entity.getCustomer() != null) {
customerPosition = new CustomerPositionDto(entity.getCustomer().getCustomerId(), entity.getPosition().getId(), entity.getPosition().getName());
} else {
customerPosition = new CustomerPositionDto(customer.getCustomerId(), entity.getPosition().getId(), entity.getPosition().getName());
}
customerPositionDtos.add(customerPosition);
}
}
}
}
use of org.mifos.customers.business.PositionEntity in project head by mifos.
the class GroupServiceFacadeWebTier method generatePositionsFromExistingCustomerPositions.
private void generatePositionsFromExistingCustomerPositions(CustomerBO customer, List<PositionEntity> customerPositions, List<CustomerPositionDto> customerPositionDtos) {
for (PositionEntity position : customerPositions) {
for (CustomerPositionEntity entity : customer.getCustomerPositions()) {
if (position.getId().equals(entity.getPosition().getId())) {
CustomerPositionDto customerPosition;
if (entity.getCustomer() != null) {
customerPosition = new CustomerPositionDto(entity.getCustomer().getCustomerId(), entity.getPosition().getId(), entity.getPosition().getName());
} else {
customerPosition = new CustomerPositionDto(customer.getCustomerId(), entity.getPosition().getId(), entity.getPosition().getName());
}
customerPositionDtos.add(customerPosition);
}
}
}
}
use of org.mifos.customers.business.PositionEntity in project head by mifos.
the class GroupServiceFacadeWebTier method generateNewListOfPositions.
private void generateNewListOfPositions(CustomerBO customer, List<PositionEntity> customerPositions, List<CustomerPositionDto> customerPositionDtos) {
for (PositionEntity position : customerPositions) {
CustomerPositionDto customerPosition = new CustomerPositionDto(customer.getCustomerId(), position.getId(), position.getName());
customerPositionDtos.add(customerPosition);
}
}
use of org.mifos.customers.business.PositionEntity in project head by mifos.
the class CustomerServiceImpl method assembleCustomerPostionsFromDto.
private void assembleCustomerPostionsFromDto(List<CustomerPositionDto> customerPositions, CustomerBO customer) {
for (CustomerPositionDto positionView : customerPositions) {
boolean isPositionFound = false;
for (CustomerPositionEntity positionEntity : customer.getCustomerPositions()) {
if (positionView.getPositionId().equals(positionEntity.getPosition().getId())) {
CustomerBO customerInPosition = null;
if (positionView.getCustomerId() != null) {
customerInPosition = customerDao.findCustomerById(positionView.getCustomerId());
}
positionEntity.setCustomer(customerInPosition);
isPositionFound = true;
break;
}
}
if (!isPositionFound) {
CustomerBO customerInPosition = null;
if (positionView.getCustomerId() != null) {
customerInPosition = customerDao.findCustomerById(positionView.getCustomerId());
}
CustomerPositionEntity customerPosition = new CustomerPositionEntity(new PositionEntity(positionView.getPositionId()), customerInPosition, customer);
customer.addCustomerPosition(customerPosition);
}
}
}
use of org.mifos.customers.business.PositionEntity in project head by mifos.
the class CenterServiceFacadeWebTier method generateNewListOfPositions.
private void generateNewListOfPositions(CustomerBO customer, List<PositionEntity> customerPositions, List<CustomerPositionDto> customerPositionDtos) {
for (PositionEntity position : customerPositions) {
CustomerPositionDto customerPosition = new CustomerPositionDto(customer.getCustomerId(), position.getId(), position.getName());
customerPositionDtos.add(customerPosition);
}
}
Aggregations