use of org.mifos.dto.screen.ClientRemovalFromGroupDto in project head by mifos.
the class ClientServiceFacadeWebTier method retreiveClientDetailsForRemovalFromGroup.
@Override
public ClientRemovalFromGroupDto retreiveClientDetailsForRemovalFromGroup(String globalCustNum) {
try {
MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
UserContext userContext = toUserContext(user);
ClientBO client = this.customerDao.findClientBySystemId(globalCustNum);
client.updateDetails(userContext);
client.checkIfClientIsATitleHolder();
List<OfficeDetailsDto> activeBranches = this.officeDao.findActiveBranches(userContext.getBranchId());
boolean isCenterHierarchyExists = ClientRules.getCenterHierarchyExists();
boolean isActive = client.isActive();
Short loanOfficerId = client.getPersonnel().getPersonnelId();
CenterCreation clientDetails = new CenterCreation(client.getOfficeId(), userContext.getId(), userContext.getLevelId(), userContext.getPreferredLocale());
List<PersonnelDto> loanOfficers = this.personnelDao.findActiveLoanOfficersForOffice(clientDetails);
return new ClientRemovalFromGroupDto(client.getGlobalCustNum(), isActive, isCenterHierarchyExists, loanOfficerId, loanOfficers, activeBranches);
} catch (CustomerException e) {
throw new BusinessRuleException(e.getKey(), e);
}
}
use of org.mifos.dto.screen.ClientRemovalFromGroupDto in project head by mifos.
the class GroupTransferAction method loadGrpMemberShip.
@TransactionDemarcate(joinToken = true)
public ActionForward loadGrpMemberShip(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
GroupTransferActionForm actionForm = (GroupTransferActionForm) form;
actionForm.setComment(null);
ClientBO clientInSession = (ClientBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
ClientRemovalFromGroupDto clientRemovalFromGroupDetail = this.clientServiceFacade.retreiveClientDetailsForRemovalFromGroup(clientInSession.getGlobalCustNum());
actionForm.setAssignedLoanOfficerId(clientRemovalFromGroupDetail.getLoanOfficerId().toString());
actionForm.setIsActive(clientRemovalFromGroupDetail.isActive() ? Constants.YES : Constants.NO);
ClientBO client = this.customerDao.findClientBySystemId(clientInSession.getGlobalCustNum());
SessionUtils.removeAttribute(Constants.BUSINESS_KEY, request);
SessionUtils.setAttribute(Constants.BUSINESS_KEY, client, request);
SessionUtils.setCollectionAttribute(OfficeConstants.OFFICESBRANCHOFFICESLIST, clientRemovalFromGroupDetail.getActiveBranches(), request);
SessionUtils.setAttribute(CollectionSheetEntryConstants.ISCENTERHIERARCHYEXISTS, clientRemovalFromGroupDetail.isCenterHierarchyExists() ? Constants.YES : Constants.NO, request);
SessionUtils.setCollectionAttribute(CustomerConstants.LOAN_OFFICER_LIST, clientRemovalFromGroupDetail.getLoanOfficers(), request);
return mapping.findForward(ActionForwards.loadGrpMemberShip_success.toString());
}
Aggregations