use of org.mifos.dto.screen.ChangeAccountStatusDto in project head by mifos.
the class PentahoParamParser method updatePossibleValuesForParam.
private Map<String, String> updatePossibleValuesForParam(ListParameter paramDefEntry, ParameterContext paramContext, Map<String, AbstractPentahoParameter> selectedValues) throws ReportDataFactoryException {
Map<String, String> result = new HashMap<String, String>();
String id;
if (parameterIsOffice(paramDefEntry.getName())) {
ParameterValues paramValues = paramDefEntry.getValues(paramContext);
for (int i = 0; i < paramValues.getRowCount(); i++) {
String key = String.valueOf(paramValues.getKeyValue(i));
String value = String.valueOf(paramValues.getTextValue(i));
result.put(key, value);
}
} else if (parameterIsCenter(paramDefEntry.getName())) {
String keyValue = searchKey("(.*officer$)|(.*officer_id$)", selectedValues, paramDefEntry.getName());
if (!keyValue.equals("")) {
id = (String) selectedValues.get(keyValue).getParamValue();
if (!id.equals("-1")) {
List<CustomerDetailDto> customerList = ApplicationContextProvider.getBean(CenterServiceFacade.class).retrieveCustomersUnderUser(new Short(id));
for (CustomerDetailDto office : customerList) {
String key = office.getCustomerId().toString();
String value = office.getDisplayName();
result.put(key, value);
}
} else {
ParameterValues paramValues = paramDefEntry.getValues(paramContext);
for (int i = 0; i < paramValues.getRowCount(); i++) {
String key = String.valueOf(paramValues.getKeyValue(i));
String value = String.valueOf(paramValues.getTextValue(i));
result.put(key, value);
}
}
} else {
keyValue = searchKey("(selected_office$)|(.*BRANCH_NAME.*)", selectedValues, paramDefEntry.getName());
if (!keyValue.equals("")) {
id = (String) selectedValues.get(keyValue).getParamValue();
if (!id.equals("-1")) {
List<CustomerDetailDto> customerList = ApplicationContextProvider.getBean(CenterServiceFacade.class).retrieveCustomersUnderBranch(new Short(id));
for (CustomerDetailDto office : customerList) {
String key = office.getCustomerId().toString();
String value = office.getDisplayName();
result.put(key, value);
}
} else {
ParameterValues paramValues = paramDefEntry.getValues(paramContext);
for (int i = 0; i < paramValues.getRowCount(); i++) {
String key = String.valueOf(paramValues.getKeyValue(i));
String value = String.valueOf(paramValues.getTextValue(i));
result.put(key, value);
}
}
} else {
ParameterValues paramValues = paramDefEntry.getValues(paramContext);
for (int i = 0; i < paramValues.getRowCount(); i++) {
String key = String.valueOf(paramValues.getKeyValue(i));
String value = String.valueOf(paramValues.getTextValue(i));
result.put(key, value);
}
}
}
String key = "-1";
String value = "All";
result.put(key, value);
} else if (parameterIsGroup(paramDefEntry.getName())) {
String keyValue = searchKey("(.*officer*)", selectedValues, paramDefEntry.getName());
if (!keyValue.equals("")) {
id = (String) selectedValues.get(keyValue).getParamValue();
if (!id.equals("-1")) {
List<CustomerDetailDto> customerList = ApplicationContextProvider.getBean(CenterServiceFacade.class).retrieveGroupForPentahoReport(new Short(id));
for (CustomerDetailDto office : customerList) {
String key = office.getCustomerId().toString();
String value = office.getDisplayName();
result.put(key, value);
}
} else {
ParameterValues paramValues = paramDefEntry.getValues(paramContext);
for (int i = 0; i < paramValues.getRowCount(); i++) {
String key = String.valueOf(paramValues.getKeyValue(i));
String value = String.valueOf(paramValues.getTextValue(i));
result.put(key, value);
}
}
} else {
ParameterValues paramValues = paramDefEntry.getValues(paramContext);
for (int i = 0; i < paramValues.getRowCount(); i++) {
String key = String.valueOf(paramValues.getKeyValue(i));
String value = String.valueOf(paramValues.getTextValue(i));
result.put(key, value);
}
}
String key = "-1";
String value = "All";
result.put(key, value);
} else if (parameterIsOfficer(paramDefEntry.getName())) {
String keyValue = searchKey("(.*office$)|(.*office_id$)|(.*branch_id$)|(.*office$)|(.*selectedBranch.*)", selectedValues, paramDefEntry.getName());
if (!keyValue.equals("")) {
id = (String) selectedValues.get(keyValue).getParamValue();
if (!id.equals("-1")) {
ChangeAccountStatusDto changeAccountStatusDto = ApplicationContextProvider.getBean(LoanAccountServiceFacade.class).retrieveLoanOfficerDetailsForBranch(new Short(id));
List<PersonnelDto> officers = changeAccountStatusDto.getLoanOfficers();
for (PersonnelDto officer : officers) {
String key = officer.getPersonnelId().toString();
String value = officer.getDisplayName();
result.put(key, value);
}
}
String key = "-1";
String value = "All";
result.put(key, value);
}
} else {
ParameterValues paramValues = paramDefEntry.getValues(paramContext);
for (int i = 0; i < paramValues.getRowCount(); i++) {
String key = String.valueOf(paramValues.getKeyValue(i));
String value = String.valueOf(paramValues.getTextValue(i));
result.put(key, value);
}
}
return result;
}
use of org.mifos.dto.screen.ChangeAccountStatusDto in project head by mifos.
the class AccountStatusAction method load.
@TransactionDemarcate(saveToken = true)
public ActionForward load(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse httpservletresponse) throws Exception {
cleanUp(form, request);
ChangeAccountStatusDto activeBranchesAndLoanOfficers = this.loanAccountServiceFacade.retrieveAllActiveBranchesAndLoanOfficerDetails();
SessionUtils.setCollectionAttribute(OfficeConstants.OFFICESBRANCHOFFICESLIST, activeBranchesAndLoanOfficers.getActiveBranches(), request);
SessionUtils.setCollectionAttribute(LoanConstants.LOAN_OFFICERS, activeBranchesAndLoanOfficers.getLoanOfficers(), request);
return mapping.findForward(ActionForwards.changeAccountStatus_success.toString());
}
Aggregations