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

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

/**
 * 导出模板按钮执行者
 */
public class ButtonReceiverExportTemplate implements IButtonCommandReceiver<MoreSheetConfig> {


    private String pluginKey;

    private ButtonParamExportTemplate param;

    public ButtonReceiverExportTemplate(ButtonParamExportTemplate param) {
        this.param = param;
    }

    /**
     * 执行命令
     * @return
     */
    @Override
    public MoreSheetConfig receiver() {
        IExcelService excelService = SpringUtils.getBean(IExcelService.class);

        MoreSheetConfig excelTemplateModel = excelService.getImportExcelTemplate(param.getDbFormId());
        return excelTemplateModel;
    }


}
