
package com.lideeyunji.core.framework.config.btncommand.receiver;

import com.lideeyunji.core.framework.config.btncommand.param.ButtonParamExport;
import com.lideeyunji.core.framework.service.IExcelService;
import com.lideeyunji.tool.framework.excel.model.MoreSheetConfig;
import com.lideeyunji.tool.framework.yunji.tool.spring.SpringUtils;

import java.util.List;

/**
 * 新增导出执行者
 */
public class ButtonReceiverExport implements IButtonCommandReceiver<List<MoreSheetConfig>> {


    private String pluginKey;

    private ButtonParamExport param;

    public ButtonReceiverExport(ButtonParamExport param) {
        this.param = param;
    }

    /**
     * 执行命令
     * @return
     */
    @Override
    public List<MoreSheetConfig> receiver() {
        IExcelService excelService = SpringUtils.getBean(IExcelService.class);
        List<MoreSheetConfig> sheetList = excelService.getExportExcelSheetList(param.getDbFormId(), param.getParams());
        return sheetList;
    }


}
