|
@@ -9,8 +9,11 @@ import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import edu.nju.entities.*;
|
|
import edu.nju.entities.*;
|
|
|
|
+import edu.nju.service.RecommendService;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -31,6 +34,8 @@ import java.net.URLConnection;
|
|
public class ExtraController {
|
|
public class ExtraController {
|
|
@Autowired
|
|
@Autowired
|
|
ExtraService extraService;
|
|
ExtraService extraService;
|
|
|
|
+
|
|
|
|
+ Logger logger= LoggerFactory.getLogger(RecommendService.class);
|
|
|
|
|
|
//上传测试报告
|
|
//上传测试报告
|
|
@RequestMapping(value = "/uploadReport", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/uploadReport", method = RequestMethod.POST)
|
|
@@ -214,6 +219,17 @@ public class ExtraController {
|
|
public String uploadExamUrl(String file, String file_name, String paper_type,
|
|
public String uploadExamUrl(String file, String file_name, String paper_type,
|
|
String case_id, String test_type, String description, String app_name) {
|
|
String case_id, String test_type, String description, String app_name) {
|
|
try {
|
|
try {
|
|
|
|
+ logger.info(file);
|
|
|
|
+ logger.info(file_name);
|
|
|
|
+ logger.info(paper_type);
|
|
|
|
+ logger.info(case_id);
|
|
|
|
+ logger.info(test_type);
|
|
|
|
+ logger.info(description);
|
|
|
|
+ logger.info(app_name);
|
|
|
|
+
|
|
|
|
+// file=file.replaceAll("59.42.10.17","10.18.18.70");
|
|
|
|
+
|
|
|
|
+// logger.info("修改后fileurl"+file);
|
|
|
|
|
|
File dest = new File("/Users/hannatao/Downloads/" + file_name);
|
|
File dest = new File("/Users/hannatao/Downloads/" + file_name);
|
|
if(!dest.getParentFile().exists()) { dest.getParentFile().mkdirs(); }
|
|
if(!dest.getParentFile().exists()) { dest.getParentFile().mkdirs(); }
|
|
@@ -254,8 +270,11 @@ public class ExtraController {
|
|
bin.close();
|
|
bin.close();
|
|
out.close();
|
|
out.close();
|
|
String json = extraService.saveExam(case_id, dest.getPath(), app_name, paper_type, test_type, description);
|
|
String json = extraService.saveExam(case_id, dest.getPath(), app_name, paper_type, test_type, description);
|
|
|
|
+ logger.info(json);
|
|
return json;
|
|
return json;
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
|
+ logger.info("读取excel文件出错");
|
|
|
|
+ logger.info(e.toString());
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
return "";
|
|
return "";
|
|
}
|
|
}
|