package org.jeecg.modules.stm.rectify.charts.controller;

import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.system.entity.SysDepart;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.jeecg.modules.stm.rectify.charts.service.RectifyChartService;
import org.jeecg.modules.stm.rectify.charts.vo.ChartVo;

import java.util.List;

/**
 * @Author: yzh
 * @Date 2023/8/1 19:50
 * @Description:
 */
@RestController
@RequestMapping("/rectify.chart/stRectifyChart")
public class RectifyChartController {

    @Autowired
    private RectifyChartService rectifyChartService;

    @GetMapping("/projectStatisticChart")
    public Result<ChartVo> projectStatisticChart(){
        ChartVo chartVo = rectifyChartService.projectStatisticChart();
        return Result.OK(chartVo);
    }

    /**
     * 获取涉及问题的部门信息
     * @return
     */
    @GetMapping("/problemDepList")
    public Result<List<SysDepart>> problemDepList(){
        List<SysDepart> data = rectifyChartService.problemDepList();
        return Result.OK(data);
    }

    @GetMapping("/problemDepStatisticChart")
    public Result<ChartVo> problemDepStatisticChart(String depCode){
        ChartVo data = rectifyChartService.problemDepStatisticChart(depCode);
        return Result.OK(data);
    }

    /**
     * 年度整改
     * @return
     */
    @GetMapping("/yearStatisticChart")
    public Result<ChartVo> yearStatisticChart(){
        ChartVo data = rectifyChartService.yearStatisticChart();
        return Result.OK(data);
    }

    /**
     * 年度整改
     * @return
     */
    @GetMapping("/domainStatisticChart")
    public Result<ChartVo> domainStatisticChart(){
        ChartVo data = rectifyChartService.domainStatisticChart();
        return Result.OK(data);
    }


}
