package thyyxxk.webserver.controller.reports;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.config.auth.PassToken;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.casefrontsheet.JieShouHuiZhenPojo;
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
import thyyxxk.webserver.service.reports.HuiZhenTongJiService;

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

/**
 * <p>
 * 描述： 会诊统计3
 * </p>
 *
 * @author xc
 * @date 2021-07-30 10:02
 */
@RestController
@RequestMapping("/queryHuiZhen")
public class HuiZhenTongJiController {

    private final HuiZhenTongJiService service;

    @Autowired
    public HuiZhenTongJiController(HuiZhenTongJiService service) {
        this.service = service;
    }

    @GetMapping("/getDept")
    public ResultVo<List<GetDropdownBox>> getDept() {
        return service.getDept();
    }

    @PostMapping("/getHuiZhenData")
    public ResultVo<IPage<JieShouHuiZhenPojo>> getHuiZhenData(@RequestBody JieShouHuiZhenPojo param) {
        return service.getHuiZhenData(param);
    }

    @PassToken
    @PostMapping("/exportExcel")
    public void getExportExcel(HttpServletResponse response,
                               @RequestBody @Validated JieShouHuiZhenPojo param) {
        service.excel(response, param);
    }
}
