package com.emr.controller;

import com.emr.service.BatchExportService;
import com.emr.vo.ExportTaskVo;
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 BatchExportController
 * @Description 批量导出接口
 * @Author linjj
 * @Date 2024/4/12 11:16
 * @Version 1.0
 */
@Controller
@RequestMapping("/batch/export")
public class BatchExportController {

    @Autowired
    private BatchExportService batchExportService;

    @RequestMapping(value = "/exportPdf")
    public String faults(Model model) {
        return "batchExport/batchExpoer";
    }

    /**
     * @description: 查询所有任务
     * @params: taskState
     * @return: ExportTaskVo
     * @author linjj
     * @date: 2024/4/12 11:40
     */
    @ResponseBody
    @RequestMapping(value = "/selectAll")
    public List<ExportTaskVo> selectAll(int taskState) {
        return batchExportService.selectAll(taskState);
    }
}
