package com.diagbot.web;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.diagbot.annotation.SysLogger;
import com.diagbot.dto.BehospitalInfoDTO;
import com.diagbot.dto.GetEntryDefectImproveDeptDTO;
import com.diagbot.dto.GetQcClickDTO;
import com.diagbot.dto.RespDTO;
import com.diagbot.facade.DataAnalysisDeptFacade;
import com.diagbot.facade.DataAnalysisFacade;
import com.diagbot.vo.GetEntryDefectImproveDeptVO;
import com.diagbot.vo.GetEntryDefectImproveInnerVO;
import com.diagbot.vo.GetQcClickInnerPageVO;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;

/**
 * @Description:数据分析（科室）
 * @Author: cy
 * @time: 2021/11/25 11:42
 */
@RestController
@Api(value = "数据分析（科室）相关API", tags = { "数据分析（科室）相关API" })
@RequestMapping("/qc/analysisDept")
public class DataAnalysisDeptController {

    @Autowired
    DataAnalysisFacade dataAnalysisFacade;
    @Autowired
    DataAnalysisDeptFacade dataAnalysisDeptFacade;


    /**
     * 条目缺陷改善统计（科室）
     *
     * @param getEntryDefectImproveDeptVO
     * @return
     */
    @ApiOperation(value = "条目缺陷改善统计（科室）[by:cy]")
    @PostMapping("/getEntryDefectImproveDept")
    @SysLogger("getEntryDefectImproveDept")
    public RespDTO<IPage<GetEntryDefectImproveDeptDTO>> getEntryDefectImprove(@RequestBody @Valid GetEntryDefectImproveDeptVO getEntryDefectImproveDeptVO) {
        return RespDTO.onSuc(dataAnalysisDeptFacade.getEntryDefectImproveDept(getEntryDefectImproveDeptVO));
    }

    /**
     * 条目缺陷改善统计（科室）-导出
     *
     * @param getEntryDefectImproveDeptVO
     * @return
     */
    @ApiOperation(value = "条目缺陷改善统计（科室）-导出[by:cy]")
    @PostMapping("/getEntryDefectImproveByDeptExport")
    @SysLogger("getEntryDefectImproveByDeptExport")
    public void getEntryDefectImproveByDeptExport(HttpServletResponse response,@RequestBody @Valid GetEntryDefectImproveDeptVO getEntryDefectImproveDeptVO) {
        dataAnalysisDeptFacade.getEntryDefectImproveByDeptExport(response,getEntryDefectImproveDeptVO);
    }

    /**
     * 条目缺陷改善统计（科室）-内页
     *
     * @param getEntryDefectImproveInnerVO
     * @return
     */
    @ApiOperation(value = "条目缺陷改善统计（科室）-内页[by:cy]")
    @PostMapping("/getEntryDefectImproveInnerDept")
    @SysLogger("getEntryDefectImproveInnerDept")
    public RespDTO<IPage<BehospitalInfoDTO>> getEntryDefectImproveInnerDept(@RequestBody GetEntryDefectImproveInnerVO getEntryDefectImproveInnerVO) {
        return RespDTO.onSuc(dataAnalysisFacade.getEntryDefectImproveInner(getEntryDefectImproveInnerVO));
    }

    /**
     * 条目缺陷改善统计（科室）-内页导出
     *
     * @param getEntryDefectImproveInnerVO
     * @return
     */
    @ApiOperation(value = "条目缺陷改善统计（科室）-内页导出[by:cy]")
    @PostMapping("/getDefectImproveInnerByDeptExport")
    @SysLogger("getDefectImproveInnerByDeptExport")
    public void getDefectImproveInnerByDeptExport(HttpServletResponse response, @RequestBody GetEntryDefectImproveInnerVO getEntryDefectImproveInnerVO) {
        dataAnalysisFacade.getDefectImproveInnerByExport(response, getEntryDefectImproveInnerVO);
    }

}
