java基于xml配置的通用excel单表数据导入组件(五、Action处理类)

package xxxxxx.manage.importexcel;

import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;

import net.sf.json.JSONObject;

import xxxxxx.supp.ACT_Common;

/**
 * <p>
 * Title:excel数据导入
 * </p>
 * <p>
 * Description:excel数据导入
 * </p>
 * <p>
 * Copyright: Copyright (c) 2013
 * </p>
 * <p>
 * Company:
 * </p>
 * 
 * @author lxj
 * @version 1.0
 */

public class ACT_ImportExcel extends ACT_Common {

    private static final Logger logger = Logger.getLogger(ACT_ImportExcel.class
            .getName());

    // 返回结果给客户端
    private JSONObject jsonResult;
    private File excel;
    private String excelContentType;
    private String excelFileName;
    private String tableTarget;

    /**
     * excel数据导入至"_import"临时表
     * 
     * @return
     */
    public String doImport() {
        DAO_ImportExcel importExcel = new DAO_ImportExcel(tableTarget, excel);
        jsonResult = JSONObject.fromObject(importExcel.doImport());
        return "doFormJSON";
    }

    public JSONObject getJsonResult() {
        return jsonResult;
    }

    public void setJsonResult(JSONObject jsonResult) {
        this.jsonResult = jsonResult;
    }

    public File getExcel() {
        return excel;
    }

    public void setExcel(File excel) {
        this.excel = excel;
    }

    public String getTableTarget() {
        return tableTarget;
    }

    public void setTableTarget(String tableTarget) {
        this.tableTarget = tableTarget;
    }

    public String getExcelContentType() {
        return excelContentType;
    }

    public void setExcelContentType(String excelContentType) {
        this.excelContentType = excelContentType;
    }

    public String getExcelFileName() {
        return excelFileName;
    }

    public void setExcelFileName(String excelFileName) {
        this.excelFileName = excelFileName;
    }

}

 

posted @ 2013-08-28 09:50  李小加  阅读(323)  评论(1编辑  收藏  举报