use of com.axelor.apps.bankpayment.db.repo.BankOrderRepository in project axelor-open-suite by axelor.
the class BankOrderController method merge.
@SuppressWarnings("unchecked")
public void merge(ActionRequest request, ActionResponse response) {
try {
List<Integer> listSelectedBankOrder = (List<Integer>) request.getContext().get("_ids");
BankOrderRepository bankOrderRepository = Beans.get(BankOrderRepository.class);
List<BankOrder> bankOrderList = Lists.newArrayList();
if (listSelectedBankOrder != null) {
for (Integer bankOrderId : listSelectedBankOrder) {
BankOrder bankOrder = bankOrderRepository.find(bankOrderId.longValue());
if (bankOrder != null) {
bankOrderList.add(bankOrder);
}
}
BankOrder bankOrder = Beans.get(BankOrderMergeService.class).mergeBankOrders(bankOrderList);
response.setView(ActionView.define(I18n.get("Bank Order")).model(BankOrder.class.getName()).add("form", "bank-order-form").param("forceEdit", "true").context("_showRecord", String.valueOf(bankOrder.getId())).map());
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
Aggregations