Search in sources :

Example 1 with BudgetListResponse

use of com.tony.billing.response.budget.BudgetListResponse in project BillingDubbo by TonyJiangWJ.

the class BudgetController method listBudget.

@RequestMapping("/budget/list")
public BudgetListResponse listBudget(@ModelAttribute("request") @Validated BudgetListRequest request) {
    BudgetListResponse response = new BudgetListResponse();
    try {
        Budget query = new Budget();
        query.setBelongMonth(request.getMonth());
        query.setBelongYear(request.getYear());
        query.setUserId(request.getUserId());
        List<BudgetDTO> budgets = budgetService.queryBudgetsByCondition(query);
        if (CollectionUtils.isNotEmpty(budgets)) {
            response.setBudgetList(budgets);
            ResponseUtil.success(response);
        } else {
            ResponseUtil.dataNotExisting(response);
        }
    } catch (Exception e) {
        logger.error("/budget/list error", e);
        ResponseUtil.sysError(response);
    }
    return response;
}
Also used : BudgetListResponse(com.tony.billing.response.budget.BudgetListResponse) Budget(com.tony.billing.entity.Budget) BudgetDTO(com.tony.billing.dto.BudgetDTO) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

BudgetDTO (com.tony.billing.dto.BudgetDTO)1 Budget (com.tony.billing.entity.Budget)1 BudgetListResponse (com.tony.billing.response.budget.BudgetListResponse)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1