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

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.web.modules.prosperity.service.IAchievementReportService;

/**
 * 共同富裕成果年度报告（只读）
 */
@RestController
@RequestMapping("/commonProsperity/achievementReport")
public class BizCommonProsperityAchievementReportController extends BaseController
{
    @Autowired
    private IAchievementReportService achievementReportService;

    @PreAuthorize("@ss.hasPermi('commonProsperity:achievementReport:query')")
    @GetMapping
    public AjaxResult getAnnualReport(@RequestParam("statYear") String statYear)
    {
        return success(achievementReportService.getAnnualReport(statYear));
    }

    @PreAuthorize("@ss.hasPermi('commonProsperity:achievementReport:query')")
    @GetMapping("/years")
    public AjaxResult listYears()
    {
        return success(achievementReportService.listAvailableYears());
    }
}
