package com.fgkj.actions; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Vector; import javax.servlet.http.HttpSession; import org.apache.struts2.ServletActionContext; import com.fgkj.dto.DLG_Progress; import com.fgkj.dto.ServiceModel; import com.fgkj.dto.User; import com.fgkj.dto.User_inf; import com.fgkj.fbo.FboData; import com.fgkj.fbo.FboDataInf; import com.fgkj.services.FboDataUploadService; import com.google.gson.Gson; import com.mysql.fabric.xmlrpc.base.Array; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.Result; import com.sun.xml.internal.ws.wsdl.writer.document.Service; public class FboDataUploadAction extends ActionSupport { private String tableRowData; private int battgroupid; private File[] file; // 提交过来的file的名字 private String[] fileFileName; private String result; // 文件上传 public String uploadFile() { User_inf user = (User_inf) ActionUtil.getUser(); if(user!=null){ // System.out.println(tableRowData.length()); HttpSession session = ActionUtil.getSession(); Gson gson = new Gson(); createFile(); String[][] tableRowDatas = gson .fromJson(tableRowData, String[][].class); //System.out.println(file.length + "---" + tableRowDatas.length); FboDataUploadService fduservice = new FboDataUploadService(user, battgroupid, tableRowDatas, file, session); fduservice.start(); } return SUCCESS; } // 停止上传 public String stopUpload() { HttpSession session = ActionUtil.getSession(); DLG_Progress progress = (DLG_Progress) session.getAttribute("progress"); if (progress != null) { progress.setJudge(false); ServiceModel model=new ServiceModel(); model.setCode(1); model.setData(model); result = ActionUtil.tojson(progress); } return SUCCESS; } // 查询进度 public String selectprogress() { HttpSession session = ActionUtil.getSession(); DLG_Progress progress = (DLG_Progress) session.getAttribute("progress"); // for(int i=0;i