Package org.joda.time

Examples of org.joda.time.YearMonth


  @CalendarModelAttribute
  public String displayOperations(@PathVariable String accountNumber, @PathVariable int year, @PathVariable int month, ModelMap model) {

    Integer accountId = bankService.findAccountIdByNumber(accountNumber);

    Map<Card, BigDecimal[]> cardSums = bankService.sumResolvedCardOperationsByAccountIdAndYearMonth(accountId, new YearMonth(year, month));
    BigDecimal creditSum = bankService.sumResolvedAmountByAccountIdAndYearMonthAndSign(accountId, new YearMonth(year, month), OperationSign.CREDIT);
    BigDecimal debitSum = bankService.sumResolvedAmountByAccountIdAndYearMonthAndSign(accountId, new YearMonth(year, month), OperationSign.DEBIT);

    model.put("cardSums", cardSums.entrySet());
    model.put("creditSum", creditSum);
    model.put("debitSum", debitSum);
View Full Code Here


  public @ResponseBody
  OperationsTable paginateOperations(@PathVariable String accountNumber, @PathVariable int year, @PathVariable int month, @PathVariable int page) {

    Integer accountId = bankService.findAccountIdByNumber(accountNumber);

    Page<Operation> operationPage = bankService.findNonCardOperationsByAccountIdAndYearMonth(accountId, new YearMonth(year, month), page);
    return converter.convert(operationPage);
  }
View Full Code Here

    BigDecimal creditSum, debitSum = null;

    if (!cardNumber.equals(ALL_CARDS)) {
      Integer cardId = bankService.findCardIdByNumber(cardNumber);
      creditSum = bankService.sumResolvedCardAmountByCardIdAndYearMonthAndSign(cardId, new YearMonth(year, month), OperationSign.CREDIT);
      debitSum = bankService.sumResolvedCardAmountByCardIdAndYearMonthAndSign(cardId, new YearMonth(year, month), OperationSign.DEBIT);

    } else {
      Assert.notNull(accountNumber, "if no cardNumber, accountNumber is required");

      Integer accountId = bankService.findAccountIdByNumber(accountNumber);
      creditSum = bankService.sumResolvedCardAmountByAccountIdAndYearMonthAndSign(accountId, new YearMonth(year, month), OperationSign.CREDIT);
      debitSum = bankService.sumResolvedCardAmountByAccountIdAndYearMonthAndSign(accountId, new YearMonth(year, month), OperationSign.DEBIT);
    }

    model.put("creditSum", creditSum);
    model.put("debitSum", debitSum);
View Full Code Here

    Page<Operation> operations = null;

    if (!cardNumber.equals(CardOperationsController.ALL_CARDS)) {
      Integer cardId = bankService.findCardIdByNumber(cardNumber);
      operations = bankService.findResolvedCardOperationsByCardIdAndYearMonth(cardId, new YearMonth(year, month), page);

    } else {
      Assert.notNull(accountNumber, "if no cardNumber, accountNumber is required");

      Integer accountId = bankService.findAccountIdByNumber(accountNumber);
      operations = bankService.findResolvedCardOperationsByAccountIdAndYearMonth(accountId, new YearMonth(year, month), page);
    }

    return converter.convert(operations);
  }
View Full Code Here

                                                    @RequestParam(defaultValue = "1", value = "page") int page,
                                                    Model model) {

        Pageable pageRequest = PageableFactory.forLists(page);
        Page<Post> result = service.getPublishedPostsByDate(year, month, pageRequest);
        YearMonth yearMonth = new YearMonth(year, month);
        model.addAttribute("title", "Archive for " + yearMonth.toString("MMMM yyyy"));
        return renderListOfPosts(result, model, "All Posts");
    }
View Full Code Here

TOP

Related Classes of org.joda.time.YearMonth

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.