class EruptExcelController {

    private final EruptProp eruptProp;

    private final EruptExcelService dataFileService;

    private final EruptModifyController eruptModifyController;

    private final EruptService eruptService;

    //模板下载
    @GetMapping(value = "/template/{erupt}")
    @EruptRouter(authIndex = 2, verifyType = EruptRouter.VerifyType.ERUPT)
    public void getExcelTemplate(@PathVariable("erupt") String eruptName, HttpServletRequest request,
                                 HttpServletResponse response) throws IOException {
        if (eruptProp.isCsrfInspect() && SecurityUtil.csrfInspect(request, response)) return;
        EruptModel eruptModel = EruptCoreService.getErupt(eruptName);
        Erupts.powerLegal(eruptModel, PowerObject::isImportable);
        try (Workbook wb = dataFileService.createExcelTemplate(eruptModel)) {
            wb.write(ExcelUtil.downLoadFile(request, response, eruptModel.getErupt().name() + "_template" + EruptExcelService.XLS_FORMAT));
        }
    }

    //导出
    @PostMapping("/export/{erupt}")
    @EruptRecordOperate(value = "Export Excel", dynamicConfig = EruptRecordNaming.class)
    @EruptRouter(authIndex = 2, verifyType = EruptRouter.VerifyType.ERUPT)
    public void exportData(@PathVariable("erupt") String eruptName,
                           @RequestBody(required = false) List<Condition> conditions,
                           HttpServletRequest request, HttpServletResponse response) throws IOException {
        if (eruptProp.isCsrfInspect() && SecurityUtil.csrfInspect(request, response)) return;
        EruptModel eruptModel = EruptCoreService.getErupt(eruptName);
        Erupts.powerLegal(eruptModel, PowerObject::isExport);
        TableQuery tableQuery = new TableQuery();
        tableQuery.setPageIndex(1);
        tableQuery.setPageSize(Page.PAGE_MAX_DATA);
        Optional.ofNullable(conditions).ifPresent(tableQuery::setCondition);
        Page page = eruptService.getEruptData(eruptModel, tableQuery, null);
        try (Workbook wb = dataFileService.exportExcel(eruptModel, page)) {
            DataProxyInvoke.invoke(eruptModel, (dataProxy -> dataProxy.excelExport(wb)));
            wb.write(ExcelUtil.downLoadFile(request, response, eruptModel.getErupt().name() + EruptExcelService.XLSX_FORMAT));
        }
    }

    //导入
    @PostMapping("/import/{erupt}")
    @EruptRecordOperate(value = "Import Excel", dynamicConfig = EruptRecordNaming.class)
    @EruptRouter(authIndex = 2, verifyType = EruptRouter.VerifyType.ERUPT)
    @Transactional(rollbackOn = Exception.class)
    public EruptApiModel importExcel(@PathVariable("erupt") String eruptName, @RequestParam("file") MultipartFile file) {<FILL_FUNCTION_BODY>}


}

        EruptModel eruptModel = EruptCoreService.getErupt(eruptName);
        Erupts.powerLegal(eruptModel, PowerObject::isImportable, "Not import permission");
        if (file.isEmpty() || null == file.getOriginalFilename()) return EruptApiModel.errorApi("上传失败，请选择文件");
        List<JsonObject> list;
        int i = 1;
        try {
            i++;
            Workbook wb;
            if (file.getOriginalFilename().endsWith(EruptExcelService.XLS_FORMAT)) {
                wb = new HSSFWorkbook(file.getInputStream());
            } else if (file.getOriginalFilename().endsWith(EruptExcelService.XLSX_FORMAT)) {
                wb = new XSSFWorkbook(file.getInputStream());
            } else {
                throw new EruptWebApiRuntimeException("上传文件格式必须为Excel");
            }
            DataProxyInvoke.invoke(eruptModel, (dataProxy -> dataProxy.excelImport(wb)));
            list = dataFileService.excelToEruptObject(eruptModel, wb);
            wb.close();
        } catch (Exception e) {
            throw new EruptWebApiRuntimeException("Excel解析异常，出错行数：" + i + "，原因：" + e.getMessage(), e);
        }
        try {
            eruptModifyController.batchAddEruptData(eruptModel, list);
        } catch (Exception e) {
            throw new EruptWebApiRuntimeException("数据导入异常，原因：" + e.getMessage());
        }
        return EruptApiModel.successApi();
    
<no_super_class>