package thyyxxk.webserver.controller.reports;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.dictionary.CodeName;
import thyyxxk.webserver.entity.reports.deptperiodreport.QueryDeptEarnParam;
import thyyxxk.webserver.service.reports.DeptPeriodReportService;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/deptPeriodReport")
public class DeptPeriodReportController {
    private final DeptPeriodReportService service;

    @Autowired
    public DeptPeriodReportController(DeptPeriodReportService service) {
        this.service = service;
    }

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

    @PostMapping("/getDeptEarn")
    public ResultVo<Map<String, Object>> getDeptEarn(@RequestBody @Validated QueryDeptEarnParam param) {
        return service.getDeptEarn(param);
    }

    @PostMapping("/getDoctorEarn")
    public ResultVo<Map<String, Object>> getDoctorEarn(@RequestBody QueryDeptEarnParam param) {
        return service.getDoctorEarn(param);
    }

    @PostMapping("/getPatientBill")
    public ResultVo<Map<String, Object>> getPatientBill(@RequestBody QueryDeptEarnParam param) {
        return service.getPatientBill(param);
    }
}
