package thyyxxk.webserver.controller.reports;

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 thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.querydata.KeShiFeiiYongTongJi;
import thyyxxk.webserver.entity.querydata.QueryDrugsAndProjects;
import thyyxxk.webserver.service.reports.KeShiShouRuServer;

import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 * 描述： 各个科室收入的情况
 * </p>
 *
 * @author xc
 * @date 2021-10-19 14:51
 */
@RequestMapping("/keShiTongJi")
@RestController
public class KeShiShouRuController {

    private final KeShiShouRuServer service;

    public KeShiShouRuController(KeShiShouRuServer service) {
        this.service = service;
    }

    @PostMapping("/getKeShouFei")
    public ResultVo<KeShiFeiiYongTongJi> getKeShouFei(@RequestBody QueryDrugsAndProjects param) {
        return service.getKeShouFei(param);
    }

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


}
