package cn.cecep.talroad.task;

import cn.cecep.talroad.data.analyse.task.execute.report.excess.*;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
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;

@Api(tags = "执行报告中出现废水废气超总量排污行为,未有效落实排污许可制度")
@RestController
@RequestMapping("/report/excess")
@Slf4j
public class ReportExcessController {

    @Autowired
    private AirExcessMonthProcessService airExcessMonthProcessService;

    @Autowired
    private AirExcessQuarterProcessService airExcessQuarterProcessService;

    @Autowired
    private AirExcessYearProcessService airExcessYearProcessService;

    @Autowired
    private WaterExcessMonthProcessService waterExcessMonthProcessService;

    @Autowired
    private WaterExcessQuarterProcessService waterExcessQuarterProcessService;

    @Autowired
    private WaterExcessYearProcessService waterExcessYearProcessService;

    @Autowired
    private AirExcessMonthAvgProcessService airExcessMonthAvgProcessService;

    @Autowired
    private AirExcessQuarterAvgProcessService airExcessQuarterAvgProcessService;

    @Autowired
    private AirExcessYearAvgProcessService airExcessYearAvgProcessService;

    @Autowired
    private WaterExcessMonthAvgProcessService waterExcessMonthAvgProcessService;

    @Autowired
    private WaterExcessQuarterAvgProcessService waterExcessQuarterAvgProcessService;

    @Autowired
    private WaterExcessYearAvgProcessService waterExcessYearAvgProcessService;


    @GetMapping("/airExcessMonth")
    public void airExcessMonth() {
        try {
            airExcessMonthProcessService.process();
        } catch (Exception e) {
            e.printStackTrace();
            log.info("废气超量未落实排污许可 , 按月 . 原因：" + e.getMessage());
        }
    }

    @GetMapping("/airExcessQuarter")
    public void airExcessQuarter() {
        try {
            airExcessQuarterProcessService.process();
        } catch (Exception e) {
            e.printStackTrace();
            log.info("废气超量未落实排污许可 , 按季度 . 原因：" + e.getMessage());
        }
    }

    @GetMapping("/airExcessYear")
    public void airExcessYear() {
        try {
            airExcessYearProcessService.process();
        } catch (Exception e) {
            e.printStackTrace();
            log.info("废气超量未落实排污许可 , 按年 . 原因：" + e.getMessage());
        }
    }

    @GetMapping("/waterExcessMonth")
    public void waterExcessMonth() {
        try {
            waterExcessMonthProcessService.process();
        } catch (Exception e) {
            e.printStackTrace();
            log.info("废水超量未落实排污许可 , 按月 . 原因：" + e.getMessage());
        }
    }

    @GetMapping("/waterExcessQuarter")
    public void waterExcessQuarter() {
        try {
            waterExcessQuarterProcessService.process();
        } catch (Exception e) {
            e.printStackTrace();
            log.info("废水超量未落实排污许可 , 按季度 . 原因：" + e.getMessage());
        }
    }

    @GetMapping("/waterExcessYear")
    public void waterExcessYear() {
        try {
            waterExcessYearProcessService.process();
        } catch (Exception e) {
            e.printStackTrace();
            log.info("废水超量未落实排污许可 , 按年 . 原因：" + e.getMessage());
        }
    }

    /////
    @GetMapping("/airAvgExcessMonth")
    public void airAvgExcessMonth() {
        try {
            airExcessMonthAvgProcessService.process();
        } catch (Exception e) {
            e.printStackTrace();
            log.info("废气均值监测超量未落实排污许可 , 按月 . 原因：" + e.getMessage());
        }
    }

    @GetMapping("/airAvgExcessQuarter")
    public void airAvgExcessQuarter() {
        try {
            airExcessQuarterAvgProcessService.process();
        } catch (Exception e) {
            e.printStackTrace();
            log.info("废气均值监测超量未落实排污许可 , 按季度 . 原因：" + e.getMessage());
        }
    }

    @GetMapping("/airAvgExcessYear")
    public void airAvgExcessYear() {
        try {
            airExcessYearAvgProcessService.process();
        } catch (Exception e) {
            e.printStackTrace();
            log.info("废气均值监测超量未落实排污许可 , 按年 . 原因：" + e.getMessage());
        }
    }

    @GetMapping("/waterAvgExcessMonth")
    public void waterAvgExcessMonth() {
        try {
            waterExcessMonthAvgProcessService.process();
        } catch (Exception e) {
            e.printStackTrace();
            log.info("废水均值监测超量未落实排污许可 , 按月 . 原因：" + e.getMessage());
        }
    }

    @GetMapping("/waterAvgExcessQuarter")
    public void waterAvgExcessQuarter() {
        try {
            waterExcessQuarterAvgProcessService.process();
        } catch (Exception e) {
            e.printStackTrace();
            log.info("废水均值监测超量未落实排污许可 , 按季度 . 原因：" + e.getMessage());
        }
    }

    @GetMapping("/waterAvgExcessYear")
    public void waterAvgExcessYear() {
        try {
            waterExcessYearAvgProcessService.process();
        } catch (Exception e) {
            e.printStackTrace();
            log.info("废水均值监测超量未落实排污许可 , 按年 . 原因：" + e.getMessage());
        }
    }

}
