use of org.mifos.dto.screen.CustomerCheckBoxItemDto in project head by mifos.
the class CheckListServiceFacadeWebTier method retreiveAllCustomerCheckLists.
@Override
public List<CustomerCheckBoxItemDto> retreiveAllCustomerCheckLists() {
try {
List<CustomerCheckListBO> customerCheckLists = new CheckListBusinessService().retreiveAllCustomerCheckLists();
List<CustomerCheckBoxItemDto> dtoList = new ArrayList<CustomerCheckBoxItemDto>();
for (CustomerCheckListBO bo : customerCheckLists) {
String lookUpName = bo.getCustomerStatus().getLookUpValue() != null ? bo.getCustomerStatus().getLookUpValue().getLookUpName() : null;
CustomerCheckBoxItemDto dto = new CustomerCheckBoxItemDto(bo.getChecklistId(), bo.getChecklistName(), bo.getChecklistStatus(), null, lookUpName, bo.getCustomerStatus().getId(), bo.getCustomerLevel().getId());
if (dto.getLookUpName() != null) {
dto.setName(ApplicationContextProvider.getBean(MessageLookup.class).lookup(dto.getLookUpName()));
}
dtoList.add(dto);
}
return dtoList;
} catch (ServiceException e) {
throw new MifosRuntimeException(e);
}
}
use of org.mifos.dto.screen.CustomerCheckBoxItemDto in project head by mifos.
the class ChkListAction method deleteExistingStates.
private void deleteExistingStates(List<CheckListStatesView> stateList, boolean isCustomer, String masterTypeId, Short masterEditStateId) {
if (isCustomer) {
Short levelId = getShortValue(masterTypeId);
List<CustomerCheckBoxItemDto> customerCheckLists = filterCustomerCheckListsByLevel(checkListServiceFacade.retreiveAllCustomerCheckLists(), CustomerLevel.getLevel(levelId));
for (int i = stateList.size() - 1; i >= 0; i--) {
Short state = stateList.get(i).getStateId();
for (CustomerCheckBoxItemDto customer : customerCheckLists) {
if (state.equals(customer.getCustomerStatusId()) && !state.equals(masterEditStateId)) {
stateList.remove(i);
}
}
}
} else {
Short prdTypeId = getShortValue(masterTypeId);
List<AccountCheckBoxItemDto> accountCheckLists = filterAccountCheckListsByProductType(checkListServiceFacade.retreiveAllAccountCheckLists(), ProductType.fromInt((int) prdTypeId));
for (int i = stateList.size() - 1; i >= 0; i--) {
Short state = stateList.get(i).getStateId();
for (AccountCheckBoxItemDto account : accountCheckLists) {
if (state.equals(account.getAccountStateId()) && !state.equals(masterEditStateId)) {
stateList.remove(i);
}
}
}
}
}
Aggregations