package com.zcloud.util.absreport;

import org.apache.commons.lang.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * 说明：TODO
 * 作者：wangxuan
 * 官网：www.zcloudchina.com
 */
public class BatchReportFactory {
    private static Map<String, AbsHandlerReportExport> strategyMap = new HashMap<>();

    /*
    * varList: [{ NAME: '安全培训教材会审表', TYPE: 100 },
            { NAME: '培训日程安排通知/也可称为培训计划', TYPE: 101 },
            { NAME: '安全培训教材或课程讲义', TYPE: 106 },
            { NAME: '安全培训教育记录及签字表', TYPE: 102 },
            { NAME: '培训影像资料', TYPE: 107 },
            { NAME: '培训考核试卷', TYPE: 103 },
            { NAME: '学员考核成绩统计表', TYPE: 104 },
            { NAME: '本期综合考评报告', TYPE: 105 },
            { NAME: '与培训机构签订的服务合同或者协议复印件', TYPE: 6 }],
    * */
    public static AbsHandlerReportExport getInvokeStrategy(String type) {
        return strategyMap.get(type);
    }

    public static void register(String type, AbsHandlerReportExport handler) {
        if (StringUtils.isEmpty(type) && handler == null) {
            return;
        }
        strategyMap.put(type, handler);
    }

}
