package com.ruoyi.web.modules.screen.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.web.modules.screen.domain.vo.ScreenEpidemicReportListItemVo;
import com.ruoyi.web.modules.screen.service.IEpidemicRiskScreenService;

/**
 * 大屏 — 疫病风险统计（只读）
 */
@RestController
@RequestMapping("/bigScreen/epidemicRisk")
public class EpidemicRiskScreenController extends BaseController
{
    @Autowired
    private IEpidemicRiskScreenService epidemicRiskScreenService;

    @GetMapping("/dashboard")
    public AjaxResult dashboard(@RequestParam("statYear") String statYear)
    {
        return success(epidemicRiskScreenService.loadDashboard(statYear));
    }

    @GetMapping("/reports")
    public TableDataInfo reports(@RequestParam("statYear") String statYear)
    {
        startPage();
        List<ScreenEpidemicReportListItemVo> list = epidemicRiskScreenService.listReportsByReportYear(statYear);
        return getDataTable(list);
    }
}
