| | |
| | | package com.fgkj.controller; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | |
| | | import javax.servlet.http.HttpSession; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import org.apache.struts2.ServletActionContext; |
| | | import com.fgkj.util.*; |
| | | |
| | | import com.fgkj.dto.DLG_Progress; |
| | | import com.fgkj.dto.ServiceModel; |
| | | import com.fgkj.dto.User_inf; |
| | | 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 io.swagger.annotations.Api; |
| | | import com.fgkj.util.*; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpSession; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @RequestMapping("fboDataUpload") |
| | | @RestController |
| | | @Api |
| | | @Api(tags = "fboDataUpload接口") |
| | | public class FboDataUploadController { |
| | | |
| | | // private String tableRowData; |
| | |
| | | // // 提交过来的file的名字s |
| | | // private String[] fileFileName; |
| | | // private String result; |
| | | @Autowired |
| | | @Resource |
| | | private FboDataUploadService service; |
| | | |
| | | // 文件上传 |
| | | @PostMapping("uploadFile") |
| | | @ApiOperation(notes = "",value="文件上传") |
| | | public boolean uploadFile(@RequestParam String tableRowData,@RequestParam int battgroupid, |
| | | @RequestParam File[] file,@RequestParam String[] fileFileName) { |
| | | boolean res=false; |
| | |
| | | |
| | | // 停止上传 |
| | | @PutMapping("/") |
| | | @ApiOperation(notes = "",value="停止上传") |
| | | public DLG_Progress stopUpload() { |
| | | HttpSession session = ActionUtil.getSession(); |
| | | DLG_Progress progress = (DLG_Progress) session.getAttribute("progress"); |
| | |
| | | |
| | | // 查询进度 |
| | | @GetMapping("progress") |
| | | @ApiOperation(notes = "",value="查询进度") |
| | | public ServiceModel selectprogress() { |
| | | ServiceModel model = new ServiceModel(); |
| | | HttpSession session = ActionUtil.getSession(); |
| | |
| | | } |
| | | |
| | | public void createFile(File[] file,String[] fileFileName){ |
| | | String root = ServletActionContext.getServletContext().getRealPath(""); // 上传路径 |
| | | String root = ActionUtil.getApplication().getRealPath(""); // 上传路径 |
| | | //System.out.println(root); |
| | | for(int i=0;i<file.length;i++){ |
| | | long times=new Date().getTime(); |