package com.kcim.web;

import com.kcim.common.util.Result;
import com.kcim.service.StandardReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 相关导入导出操作
 */
@Slf4j
@Api(tags = "标准成本报表")
@RestController
@RequestMapping("standardReport")
@AllArgsConstructor
public class StandardReportController extends AbstractController {

    private StandardReportService standardReportService;

    @ApiOperation("医院科室直接成本表（医疗成本）")
    @GetMapping("/getDeptDirectMedicalCost")
    public Result getDeptDirectMedicalCost(@RequestParam String computeDate){
        return Result.ok(standardReportService.getDeptDirectMedicalCost(computeDate));
    }
    @ApiOperation("医院科室直接成本表（全成本）")
    @GetMapping("/getDeptFullDirectCost")
    public Result getDeptFullDirectCost(@RequestParam String computeDate){
        return Result.ok(standardReportService.getDeptFullDirectCost(computeDate));
    }

    @ApiOperation("临床服务类科室全成本（医疗成本）")
    @GetMapping("/getClinicalDeptMedicalCost")
    public Result getClinicalDeptMedicalCost(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getClinicalDeptMedicalCost(computeDate));
    }

    @ApiOperation("临床服务类科室全成本（全成本）")
    @GetMapping("/getClinicalDeptFullCost")
    public Result getClinicalDeptFullCost(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getClinicalDeptFullCost(computeDate));
    }

    @ApiOperation("临床服务类科室全成本构成分析表")
    @GetMapping("/getClinicalDeptFullCostAnalysis")
    public Result getClinicalDeptFullCostAnalysis(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getClinicalDeptFullCostAnalysis(computeDate));
    }

    @ApiOperation("医院科室成本分摊汇总表")
    @GetMapping("/getHospitalDeptCostAllocation")
    public Result getHospitalDeptCostAllocation(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getHospitalDeptCostAllocation(computeDate));
    }

    @ApiOperation("医院诊次成本构成表")
    @GetMapping("/getHospitalVisitCostComposition")
    public Result getHospitalVisitCostComposition(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getHospitalVisitCostComposition(computeDate));
    }

    @ApiOperation("医院科室诊次成本表")
    @GetMapping("/getHospitalDeptVisitCost")
    public Result getHospitalDeptVisitCost(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getHospitalDeptVisitCost(computeDate));
    }


    @ApiOperation("医院床日成本构成表")
    @GetMapping("/getHospitalBedDayCostComposition")
    public Result getHospitalBedDayCostComposition(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getHospitalBedDayCostComposition(computeDate));
    }

    @ApiOperation("医院科室床日成本表")
    @GetMapping("/getHospitalDeptBedDayCost")
    public Result getHospitalDeptBedDayCost(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getHospitalDeptBedDayCost(computeDate));
    }

    @ApiOperation("医院医疗服务项目成本汇总表")
    @GetMapping("/getHospitalServiceProjectCost")
    public Result getHospitalServiceProjectCost(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getHospitalServiceProjectCost(computeDate));
    }

    @ApiOperation("医院医疗服务项目成本明细表")
    @GetMapping("/getMedicalServiceCostDetail")
    public Result getMedicalServiceCostDetail(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getMedicalServiceCostDetail(computeDate));
    }

    @ApiOperation("医院病种成本明细表")
    @GetMapping("/getDiseaseCostDetail")
    public Result getDiseaseCostDetail(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getDiseaseCostDetail(computeDate));
    }

    @ApiOperation("医院病种成本明细表(分页)")
    @GetMapping("/getDiseaseCostDetailByPage")
    public Result getDiseaseCostDetailByPage(@RequestParam(defaultValue = "1") Integer current,
                                             @RequestParam(defaultValue = "10") Integer pageSize,
                                             @RequestParam String computeDate,
                                             @RequestParam(required = false) String diseaseFilter) {
        return Result.ok(standardReportService.getDiseaseCostDetailByPage(current, pageSize, computeDate, diseaseFilter));
    }

    @ApiOperation("医院病种成本构成明细表")
    @GetMapping("/getDiseaseCostCompositionDetail")
    public Result getDiseaseCostCompositionDetail(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getDiseaseCostCompositionDetail(computeDate));
    }

    @ApiOperation("医院病种成本构成明细表(分页)")
    @GetMapping("/getDiseaseCostCompositionDetailByPage")
    public Result getDiseaseCostCompositionDetailByPage(@RequestParam(defaultValue = "1") Integer current,
                                                        @RequestParam(defaultValue = "10") Integer pageSize,
                                                        @RequestParam String computeDate,
                                                        @RequestParam(required = false) String diseaseFilter) {
        return Result.ok(standardReportService.getDiseaseCostCompositionDetailByPage(current, pageSize, computeDate, diseaseFilter));
    }

    @ApiOperation("医院服务单元病种成本构成明细表")
    @GetMapping("/getDeptDiseaseCostCompositionDetail")
    public Result getDeptDiseaseCostCompositionDetail(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getDeptDiseaseCostCompositionDetail(computeDate));
    }

    @ApiOperation("医院服务单元病种成本构成明细表(分页)")
    @GetMapping("/getDeptDiseaseCostCompositionDetailByPage")
    public Result getDeptDiseaseCostCompositionDetailByPage(@RequestParam(defaultValue = "1") Integer current,
                                                            @RequestParam(defaultValue = "10") Integer pageSize,
                                                            @RequestParam String computeDate,
                                                            @RequestParam(required = false) String diseaseFilter) {
        return Result.ok(standardReportService.getDeptDiseaseCostCompositionDetailByPage(current, pageSize, computeDate, diseaseFilter));
    }

    @ApiOperation("医院DRG成本明细表")
    @GetMapping("/getDrgCostDetail")
    public Result getDrgCostDetail(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getDrgCostDetail(computeDate));
    }

    @ApiOperation("医院DRG成本构成明细表")
    @GetMapping("/getDrgCostCompositionDetail")
    public Result getDrgCostCompositionDetail(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getDrgCostCompositionDetail(computeDate));
    }

    @ApiOperation("医院服务单元DRG成本构成明细表")
    @GetMapping("/getDeptDrgCostCompositionDetail")
    public Result getDeptDrgCostCompositionDetail(@RequestParam String computeDate) {
        return Result.ok(standardReportService.getDeptDrgCostCompositionDetail(computeDate));
    }
}
