From 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4 Mon Sep 17 00:00:00 2001
From: whycrzg <ruanzhigang@whycst.com>
Date: 星期二, 23 二月 2021 17:19:23 +0800
Subject: [PATCH] update

---
 src/main/java/com/fgkj/controller/FboDataUploadController.java |   42 ++++++++++++++++++++++++------------------
 1 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/src/main/java/com/fgkj/controller/FboDataUploadController.java b/src/main/java/com/fgkj/controller/FboDataUploadController.java
index 760dcdd..9d24cb2 100644
--- a/src/main/java/com/fgkj/controller/FboDataUploadController.java
+++ b/src/main/java/com/fgkj/controller/FboDataUploadController.java
@@ -1,41 +1,44 @@
 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;
 	// private int battgroupid;
 	// private File[] file;
-	// // 鎻愪氦杩囨潵鐨刦ile鐨勫悕瀛�
+	// // 鎻愪氦杩囨潵鐨刦ile鐨勫悕瀛梥
 	// private String[] fileFileName;
 	// private String result;
+	@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;
@@ -48,9 +51,10 @@
 			String[][] tableRowDatas = gson
 					.fromJson(tableRowData, String[][].class);
 			//System.out.println(file.length + "---" + tableRowDatas.length);
-			FboDataUploadService fduservice = new FboDataUploadService(user,
+			/*FboDataUploadService fduservice = new FboDataUploadService(user,
 					battgroupid, tableRowDatas, file, session);
-			fduservice.start();
+			fduservice.start();*/
+			service.uploadFile(user,battgroupid,tableRowDatas,file,session);
 			res=true;
 		}
 		return res;
@@ -58,6 +62,7 @@
 
 	// 鍋滄涓婁紶
 	@PutMapping("/")
+	@ApiOperation(notes = "",value="鍋滄涓婁紶")
 	public DLG_Progress stopUpload() {
 		HttpSession session = ActionUtil.getSession();
 		DLG_Progress progress = (DLG_Progress) session.getAttribute("progress");
@@ -69,6 +74,7 @@
 
 	// 鏌ヨ杩涘害
 	@GetMapping("progress")
+	@ApiOperation(notes = "",value="鏌ヨ杩涘害")
 	public ServiceModel selectprogress() {
 		ServiceModel model = new ServiceModel();
 		HttpSession session = ActionUtil.getSession();
@@ -87,7 +93,7 @@
 	}
 
 	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();

--
Gitblit v1.9.1