package cn.cecep.talroad.task;

import cn.cecep.talroad.common.log.annotation.Log;
import cn.cecep.talroad.common.log.enums.BusinessType;
import cn.cecep.talroad.service.analysis.IDischargeMathService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: cjh
 * @Date: 2023-06-10 14:27
 * @Class: PollutantDischargeController
 * @Deseription:
 * @Version V1.0
 */
@Api("污染物排放量状态标记-定时任务")
@RestController
@RequestMapping("/pollutantDischarge")
public class PollutantDischargeController {

    @Autowired
    private IDischargeMathService dischargeMathService;

    @ApiOperation(value = "定时任务-大气污染物小时排放量：每1小时执行一次")
    @Log(title = "大气污染物小时排放量", businessType = BusinessType.UPDATE)
    @PostMapping(value = "/doProcessGasStationDataFlag")
    public void doProcessGasStationDataFlag(){

        dischargeMathService.doProcessGasStationDataFlag();
    }

    @ApiOperation(value = "定时任务-水污染物日排放量：每日执行一次")
    @Log(title = "水污染物日排放量", businessType = BusinessType.UPDATE)
    @PostMapping(value = "/doProcessWaterStationDataFlag")
    public void doProcessWaterStationDataFlag(){

        dischargeMathService.doProcessWaterStationDataFlag();
    }

    @ApiOperation(value = "定时任务-污染物小时均值连续8H处于标准值的20%以下：每小时执行一次")
    @Log(title = "污染物小时均值连续8H处于标准值的20%以下", businessType = BusinessType.UPDATE)
    @PostMapping(value = "/doProcessHourPollutantConcentration")
    public void doProcessHourPollutantConcentration(){

        dischargeMathService.doProcessHourPollutantConcentration();
    }

}
