@Override public List<ODAccountBookLogDto> findAccountBookLogDtos(String fromDate, String toDate) { List<ODAccountBookLog> accountBookLogs = logRepository.findByWhenDateBetweenOrderByWhenDateDesc(fromDate, toDate); List<ODAccountBookLogDto> result = new ArrayList<ODAccountBookLogDto>(); for (ODAccountBookLog accountBookLog : accountBookLogs) { ODAccountBookLogDto accountBookLogDto = ODAccountBookLogDto.toODAccountBookLogDto(accountBookLog); AssetDto assetDto = assetService.getAssetDto(accountBookLog.getAssetOid()); accountBookLogDto.setAssetName(assetDto.getName()); CategoryDto category = categoryService.getCategory(accountBookLog.getCategoryOid()); accountBookLogDto.setCategoryName(category.getName()); CategoryDto subCategory = categoryService.getCategory(accountBookLog.getSubCategoryOid()); accountBookLogDto.setSubCategoryName(subCategory.getName()); result.add(accountBookLogDto); } return result; }
@Override public ODAccountBookLogDto getAccountBookLog(long oid) { return ODAccountBookLogDto.toODAccountBookLogDto(logRepository.findOne(oid)); }