@Override @Transactional(readOnly = true) public void refreshAllData(int start, int end, int entityId, ITransactionCallback callBack) { User user = SharedData.getSharedInstace().getCurrentUser(); user = userService.findById(user.getId(), false); List<Transaction> transactions = new ArrayList<>(); // this.fetchAllByRole(start, end, entityId); Integer totalRows = service.getTotalTransactionCount(entityId); List<Payer> payerList = payerService.getAll(); List<Practice> practiceList = new ArrayList<>(); // practiseService.fetchAllByRole(); List<Provider> providerList = new ArrayList<>(); // providerService.fetchAllByRole(); Map<String, Object> otherInfo = new HashMap<>(); otherInfo.put("count", totalRows); callBack.refreshAllData(user, transactions, payerList, practiceList, providerList, otherInfo); }
@Transactional(readOnly = true) public List<Transaction> fetchAllByRole(int start, int end, int entityId) { String userRole = SharedData.getSharedInstace().getCurrentUser().getRoleName(); final List<Transaction> dataList = new ArrayList<>(); // if (SharedData.getSharedInstace().shouldReturnFullList()) { // dataList.addAll(getAll()); // } else { service.findTransactionsByEntity( start, end, entityId, (List<Transaction> list) -> { dataList.addAll(list); }); // } return dataList; }