package cn.palmte.work.controller.backend;

import cn.palmte.work.bean.CashFlowStatisticsBean;
import cn.palmte.work.bean.PrimaryIndicatorBean;
import cn.palmte.work.bean.StatisticsBean;
import cn.palmte.work.service.StatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/statistics")
public class StatisticsController extends BaseController{

    @Autowired
    private StatisticsService statisticsService;

    @RequestMapping("/month")
    public String month(Map<String, Object> model){
        StatisticsBean statisticsData = statisticsService.getStatisticsData();
        model.put("primaryIndicatorList",statisticsData.getPrimaryIndicatorBeanList());
        model.put("profitAndLossList",statisticsData.getProfitAndLossBeanList());
        model.put("cashFlowList",statisticsData.getCashFlowStatisticsBeanList());
        return "admin/month_statistics";
    }

}
