sunyj преди 8 години
родител
ревизия
3d3794a921

+ 4 - 0
src/main/java/com/uas/report/controller/FileController.java

@@ -40,6 +40,7 @@ public class FileController {
 	@ResponseBody
 	public String upload(String userName, String fileType, String filePath, Boolean isAbsolutePath,
 			@RequestParam("file") MultipartFile[] files) {
+		userName = userName == null ? null : userName.toUpperCase();
 		// 未指定上传文件路径,则按照账套名称上传
 		// 该情况下,不会上传多个文件的
 		if (StringUtils.isEmpty(filePath)) {
@@ -72,6 +73,7 @@ public class FileController {
 	 */
 	@RequestMapping("/download/zip")
 	public void downloadZip(String userName, HttpServletResponse response) {
+		userName = userName == null ? null : userName.toUpperCase();
 		fileService.downloadZip(userName, response);
 	}
 
@@ -86,6 +88,7 @@ public class FileController {
 	 */
 	@RequestMapping("/download/jrxml")
 	public void downloadJrxml(String userName, String reportName, HttpServletResponse response) {
+		userName = userName == null ? null : userName.toUpperCase();
 		fileService.download(fileService.getJrxmlFilePath(userName, reportName), true, response);
 	}
 
@@ -98,6 +101,7 @@ public class FileController {
 	@RequestMapping("/standardJrxmls")
 	@ResponseBody
 	public Map<String, Object> standardJrxmls(String userName, String onlyData, HttpServletResponse response) {
+		userName = userName == null ? null : userName.toUpperCase();
 		// onlyData为真,只返回字节数据(自动部署时只获取标准模板字节数据),否则下载标准模板zip
 		if (!StringUtils.isEmpty(onlyData) && (onlyData.equals("1") || onlyData.equals("true"))) {
 			Map<String, Object> result = new HashMap<>();

+ 10 - 5
src/main/java/com/uas/report/controller/PrintController.java

@@ -72,6 +72,7 @@ public class PrintController {
 	@RequestMapping()
 	public void print(String userName, String profile, String reportName, String whereCondition, String otherParameters,
 			String printType, String title, HttpServletRequest request, HttpServletResponse response) {
+		userName = userName == null ? null : userName.toUpperCase();
 		// printType为空,默认进入预览页
 		if (StringUtils.isEmpty(printType)) {
 			printType = ReportConstants.PREVIEW_PRINT_TYPE;
@@ -134,6 +135,7 @@ public class PrintController {
 	public void export(String userName, String profile, String reportName, String whereCondition,
 			String otherParameters, String exportFileType, Boolean flush, String title, HttpServletRequest request,
 			HttpServletResponse response) {
+		userName = userName == null ? null : userName.toUpperCase();
 		ReportUtils.checkParameters(userName, reportName);
 		if (printService.overload(userName, profile, reportName, whereCondition, otherParameters)) {
 			throw new ReportException("数据量过大,无法提供服务");
@@ -226,9 +228,10 @@ public class PrintController {
 	 */
 	@RequestMapping(value = "/loadPdfData")
 	@ResponseBody
-	public Map<String, Object> loadPdfData(final String userName, final String profile, final String reportName,
+	public Map<String, Object> loadPdfData(String userName, final String profile, final String reportName,
 			final String whereCondition, final String otherParameters, Integer pageIndex, Boolean flush,
 			HttpServletRequest request, HttpServletResponse response) {
+		userName = userName == null ? null : userName.toUpperCase();
 		ReportUtils.checkParameters(userName, reportName);
 		if (printService.overload(userName, profile, reportName, whereCondition, otherParameters)) {
 			throw new ReportException("数据量过大,无法提供服务");
@@ -256,11 +259,12 @@ public class PrintController {
 						1);
 				result.put("pageSize", pageSize);
 				// 再开线程生成后面页的pdf、总的pdf(即未分页的pdf)
+				final String userNameCopy = userName;
 				new Thread(new Runnable() {
 					@Override
 					public void run() {
 						// 生成总的pdf
-						printService.createPdfFile(userName, profile, reportName, whereCondition, otherParameters,
+						printService.createPdfFile(userNameCopy, profile, reportName, whereCondition, otherParameters,
 								file.getPath(), null);
 						fileService.createPagedPdfFiles(file.getPath());
 					}
@@ -304,9 +308,9 @@ public class PrintController {
 	 */
 	@RequestMapping(value = "/pdfData")
 	@ResponseBody
-	public Map<String, Object> getPdfData(final String userName, final String profile, final String reportName,
-			final String whereCondition, final String otherParameters, HttpServletRequest request,
-			HttpServletResponse response) {
+	public Map<String, Object> getPdfData(String userName, String profile, String reportName, String whereCondition,
+			String otherParameters, HttpServletRequest request, HttpServletResponse response) {
+		userName = userName == null ? null : userName.toUpperCase();
 		ReportUtils.checkParameters(userName, reportName);
 		Map<String, Object> result = new HashMap<>();
 		// 判断是否过载
@@ -344,6 +348,7 @@ public class PrintController {
 	@ResponseBody
 	public Map<String, Object> getGeneratedPdfOrXlsInformation(String userName, String profile, String reportName,
 			String whereCondition, String otherParameters, String fileType, HttpServletRequest request) {
+		userName = userName == null ? null : userName.toUpperCase();
 		ReportUtils.checkParameters(userName, reportName);
 		Map<String, Object> result = new HashMap<>();
 		if (StringUtils.isEmpty(fileType)) {

+ 1 - 0
src/main/java/com/uas/report/controller/ResourceController.java

@@ -23,6 +23,7 @@ public class ResourceController {
 	@ResponseBody
 	public List<Resource> syncResources(String userName)
 			throws ClientProtocolException, URISyntaxException, IOException {
+		userName = userName == null ? null : userName.toUpperCase();
 		return resourceService.syncResources(userName);
 	}