package com.emr.controller;

import com.emr.dto.ThreeDaysFileDto;
import com.emr.entity.OffsetLimitPage;
import com.emr.service.StatementService;
import com.emr.util.Msg;
import com.emr.vo.ThreeDaysFileVo;
import com.emr.vo.ExecuteVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @ClassName StatementController
 * @Description 报表接口
 * @Author linjj
 * @Date 2024/1/11 14:28
 * @Version 1.0
 */
@Controller
@RequestMapping("statement")
public class StatementController {

    @Autowired
    StatementService statementService;

    @RequestMapping(value = "/threeDaysFile")
    public String threeDaysFile(Model model) {
        return "statementDir/ThreeDaysFile";
    }

    @RequestMapping(value = "/threeDaysFileList")
    @ResponseBody
    public List<ThreeDaysFileVo> threeDaysFileList(ThreeDaysFileDto dto) {
        return statementService.threeDaysFileList(dto);
    }

    @RequestMapping(value = "/reportList")
    @ResponseBody
    public OffsetLimitPage getMedicalOverdueReportList(Integer offset, Integer limit) {
        OffsetLimitPage result = statementService.getMedicalOverdueReportList(offset, limit);
        return result;
    }

    @RequestMapping(value = "/saveExecute")
    @ResponseBody
    public Msg saveMedicalOverdueExecute(ThreeDaysFileDto dto) {
        return statementService.saveMedicalOverdueExecute(dto);
    }


    @RequestMapping(value = "/echoExecute")
    @ResponseBody
    public ExecuteVo executeList() {
        return statementService.executeList();
    }
}
