Search in sources :

Example 1 with GroupTransferActionForm

use of org.mifos.customers.group.struts.actionforms.GroupTransferActionForm in project head by mifos.

the class GroupTransferAction method transferToCenter.

@TransactionDemarcate(validateAndResetToken = true)
@CloseSession
public ActionForward transferToCenter(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    GroupTransferActionForm actionForm = (GroupTransferActionForm) form;
    GroupBO groupInSession = (GroupBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
    CustomerDetailDto groupDetail = this.groupServiceFacade.transferGroupToCenter(groupInSession.getGlobalCustNum(), actionForm.getCenterSystemId(), groupInSession.getVersionNo());
    GroupBO group = this.customerDao.findGroupBySystemId(groupDetail.getGlobalCustNum());
    SessionUtils.setAttribute(Constants.BUSINESS_KEY, group, request);
    return mapping.findForward(ActionForwards.update_success.toString());
}
Also used : GroupTransferActionForm(org.mifos.customers.group.struts.actionforms.GroupTransferActionForm) CustomerDetailDto(org.mifos.dto.domain.CustomerDetailDto) GroupBO(org.mifos.customers.group.business.GroupBO) CloseSession(org.mifos.framework.util.helpers.CloseSession) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 2 with GroupTransferActionForm

use of org.mifos.customers.group.struts.actionforms.GroupTransferActionForm in project head by mifos.

the class GroupTransferAction method transferToBranch.

@TransactionDemarcate(validateAndResetToken = true)
@CloseSession
public ActionForward transferToBranch(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    GroupTransferActionForm actionForm = (GroupTransferActionForm) form;
    GroupBO groupInSession = (GroupBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
    CustomerDetailDto groupDetail = this.groupServiceFacade.transferGroupToBranch(groupInSession.getGlobalCustNum(), actionForm.getOfficeIdValue(), groupInSession.getVersionNo());
    GroupBO group = this.customerDao.findGroupBySystemId(groupDetail.getGlobalCustNum());
    SessionUtils.setAttribute(Constants.BUSINESS_KEY, group, request);
    return mapping.findForward(ActionForwards.update_success.toString());
}
Also used : GroupTransferActionForm(org.mifos.customers.group.struts.actionforms.GroupTransferActionForm) CustomerDetailDto(org.mifos.dto.domain.CustomerDetailDto) GroupBO(org.mifos.customers.group.business.GroupBO) CloseSession(org.mifos.framework.util.helpers.CloseSession) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 3 with GroupTransferActionForm

use of org.mifos.customers.group.struts.actionforms.GroupTransferActionForm in project head by mifos.

the class GroupTransferAction method removeGroupMemberShip.

@CloseSession
@TransactionDemarcate(validateAndResetToken = true)
public ActionForward removeGroupMemberShip(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    GroupTransferActionForm actionForm = (GroupTransferActionForm) form;
    CustomerBO customerBOInSession = (CustomerBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
    ClientBO client = this.customerDao.findClientBySystemId(customerBOInSession.getGlobalCustNum());
    checkVersionMismatch(customerBOInSession.getVersionNo(), client.getVersionNo());
    Short loanOfficerId = null;
    if (StringUtils.isNotBlank(actionForm.getAssignedLoanOfficerId())) {
        loanOfficerId = Short.valueOf(actionForm.getAssignedLoanOfficerId());
    }
    this.clientServiceFacade.removeGroupMembership(customerBOInSession.getGlobalCustNum(), loanOfficerId, actionForm.getComment());
    return mapping.findForward(ActionForwards.view_client_details_page.toString());
}
Also used : GroupTransferActionForm(org.mifos.customers.group.struts.actionforms.GroupTransferActionForm) ClientBO(org.mifos.customers.client.business.ClientBO) CustomerBO(org.mifos.customers.business.CustomerBO) CloseSession(org.mifos.framework.util.helpers.CloseSession) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 4 with GroupTransferActionForm

use of org.mifos.customers.group.struts.actionforms.GroupTransferActionForm 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());
}
Also used : ClientRemovalFromGroupDto(org.mifos.dto.screen.ClientRemovalFromGroupDto) GroupTransferActionForm(org.mifos.customers.group.struts.actionforms.GroupTransferActionForm) ClientBO(org.mifos.customers.client.business.ClientBO) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

GroupTransferActionForm (org.mifos.customers.group.struts.actionforms.GroupTransferActionForm)4 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)4 CloseSession (org.mifos.framework.util.helpers.CloseSession)3 ClientBO (org.mifos.customers.client.business.ClientBO)2 GroupBO (org.mifos.customers.group.business.GroupBO)2 CustomerDetailDto (org.mifos.dto.domain.CustomerDetailDto)2 CustomerBO (org.mifos.customers.business.CustomerBO)1 ClientRemovalFromGroupDto (org.mifos.dto.screen.ClientRemovalFromGroupDto)1