package com.njcn.harmonic.controller.report;

import cn.hutool.core.date.TimeInterval;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.harmonic.pojo.dto.FpyReportDTO;
import com.njcn.harmonic.pojo.param.QualifiedReportParam;
import com.njcn.harmonic.pojo.param.report.AreaHarmReportParam;
import com.njcn.harmonic.service.majornetwork.QualifiedReportService;
import com.njcn.harmonic.service.report.AreaHarmonicService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;


/**
 * pqs
 * 合格率报告
 * @author cdf
 * @date 2023/5/31
 */
@Slf4j
@RestController
@RequestMapping("/areaHarmonicReport")
@Api(tags = "区域稳态报告")
@RequiredArgsConstructor
public class AreaHarmonicReportController extends BaseController {

    private final AreaHarmonicService areaHarmonicService;

    /**
     * 区域稳态报告
     * @author cdf
     * @date 2023/6/7
     */
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/areaHarmonicReport")
    @ApiOperation("导出区域稳态报告")
    public void areaHarmonicReport(@RequestBody AreaHarmReportParam areaHarmReportParam, HttpServletResponse response) {
        TimeInterval timeInterval = new TimeInterval();
        String methodDescribe = getMethodDescribe("areaHarmonicReport");
        areaHarmonicService.areaHarmonicReport(areaHarmReportParam,response);

        log.info("区域稳态报告执行时长:"+timeInterval.interval());
        //return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);

    }


}
