|
|
@@ -5,6 +5,7 @@ import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -33,14 +34,15 @@ public class FileController {
|
|
|
|
|
|
@RequestMapping("/autoDeploy")
|
|
|
@ResponseBody
|
|
|
- public String autoDeploy(String sourceUserName, String destinationUserNames) throws IOException {
|
|
|
+ public String autoDeploy(String sourceUserName, String destinationUserNames, HttpServletRequest request)
|
|
|
+ throws IOException {
|
|
|
return fileService.autoDeploy(sourceUserName, destinationUserNames);
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/upload")
|
|
|
@ResponseBody
|
|
|
public String upload(String userName, String fileType, String filePath, Boolean isAbsolutePath,
|
|
|
- @RequestParam("file") MultipartFile[] files) throws IOException {
|
|
|
+ @RequestParam("file") MultipartFile[] files, HttpServletRequest request) throws IOException {
|
|
|
userName = userName == null ? null : userName.toUpperCase();
|
|
|
// 未指定上传文件路径,则按照账套名称上传
|
|
|
// 该情况下,不会上传多个文件的
|
|
|
@@ -62,7 +64,8 @@ public class FileController {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
@RequestMapping("/download")
|
|
|
- public void download(String filePath, Boolean isAbsolutePath, HttpServletResponse response) throws IOException {
|
|
|
+ public void download(String filePath, Boolean isAbsolutePath, HttpServletRequest request,
|
|
|
+ HttpServletResponse response) throws IOException {
|
|
|
fileService.download(filePath, isAbsolutePath, response);
|
|
|
}
|
|
|
|
|
|
@@ -75,7 +78,8 @@ public class FileController {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
@RequestMapping("/download/zip")
|
|
|
- public void downloadZip(String userName, HttpServletResponse response) throws IOException {
|
|
|
+ public void downloadZip(String userName, HttpServletRequest request, HttpServletResponse response)
|
|
|
+ throws IOException {
|
|
|
userName = userName == null ? null : userName.toUpperCase();
|
|
|
fileService.downloadZip(userName, response);
|
|
|
}
|
|
|
@@ -91,7 +95,8 @@ public class FileController {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
@RequestMapping("/download/jrxml")
|
|
|
- public void downloadJrxml(String userName, String reportName, HttpServletResponse response) throws IOException {
|
|
|
+ public void downloadJrxml(String userName, String reportName, HttpServletRequest request,
|
|
|
+ HttpServletResponse response) throws IOException {
|
|
|
userName = userName == null ? null : userName.toUpperCase();
|
|
|
fileService.download(fileService.getJrxmlFilePath(userName, reportName), true, response);
|
|
|
}
|
|
|
@@ -105,8 +110,8 @@ public class FileController {
|
|
|
*/
|
|
|
@RequestMapping("/standardJrxmls")
|
|
|
@ResponseBody
|
|
|
- public Map<String, Object> standardJrxmls(String userName, String onlyData, HttpServletResponse response)
|
|
|
- throws IOException {
|
|
|
+ public Map<String, Object> standardJrxmls(String userName, String onlyData, HttpServletRequest request,
|
|
|
+ HttpServletResponse response) throws IOException {
|
|
|
userName = userName == null ? null : userName.toUpperCase();
|
|
|
// onlyData为真,只返回字节数据(自动部署时只获取标准模板字节数据),否则下载标准模板zip
|
|
|
if (!StringUtils.isEmpty(onlyData) && (onlyData.equals("1") || onlyData.equals("true"))) {
|
|
|
@@ -123,13 +128,14 @@ public class FileController {
|
|
|
|
|
|
@RequestMapping("/delete")
|
|
|
@ResponseBody
|
|
|
- public String delete(String filePath, Boolean isAbsolutePath) throws IOException {
|
|
|
+ public String delete(String filePath, Boolean isAbsolutePath, HttpServletRequest request) throws IOException {
|
|
|
return "Deleted... " + fileService.delete(filePath, isAbsolutePath);
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/listFiles")
|
|
|
@ResponseBody
|
|
|
- public List<Map<String, Object>> listFiles(String filePath, Boolean isAbsolutePath) throws IOException {
|
|
|
+ public List<Map<String, Object>> listFiles(String filePath, Boolean isAbsolutePath, HttpServletRequest request)
|
|
|
+ throws IOException {
|
|
|
return fileService.listFiles(filePath, isAbsolutePath);
|
|
|
}
|
|
|
}
|