Browse Source

账套名大写

sunyj 8 years ago
parent
commit
3d3794a921

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

@@ -40,6 +40,7 @@ public class FileController {
 	@ResponseBody
 	@ResponseBody
 	public String upload(String userName, String fileType, String filePath, Boolean isAbsolutePath,
 	public String upload(String userName, String fileType, String filePath, Boolean isAbsolutePath,
 			@RequestParam("file") MultipartFile[] files) {
 			@RequestParam("file") MultipartFile[] files) {
+		userName = userName == null ? null : userName.toUpperCase();
 		// 未指定上传文件路径,则按照账套名称上传
 		// 未指定上传文件路径,则按照账套名称上传
 		// 该情况下,不会上传多个文件的
 		// 该情况下,不会上传多个文件的
 		if (StringUtils.isEmpty(filePath)) {
 		if (StringUtils.isEmpty(filePath)) {
@@ -72,6 +73,7 @@ public class FileController {
 	 */
 	 */
 	@RequestMapping("/download/zip")
 	@RequestMapping("/download/zip")
 	public void downloadZip(String userName, HttpServletResponse response) {
 	public void downloadZip(String userName, HttpServletResponse response) {
+		userName = userName == null ? null : userName.toUpperCase();
 		fileService.downloadZip(userName, response);
 		fileService.downloadZip(userName, response);
 	}
 	}
 
 
@@ -86,6 +88,7 @@ public class FileController {
 	 */
 	 */
 	@RequestMapping("/download/jrxml")
 	@RequestMapping("/download/jrxml")
 	public void downloadJrxml(String userName, String reportName, HttpServletResponse response) {
 	public void downloadJrxml(String userName, String reportName, HttpServletResponse response) {
+		userName = userName == null ? null : userName.toUpperCase();
 		fileService.download(fileService.getJrxmlFilePath(userName, reportName), true, response);
 		fileService.download(fileService.getJrxmlFilePath(userName, reportName), true, response);
 	}
 	}
 
 
@@ -98,6 +101,7 @@ public class FileController {
 	@RequestMapping("/standardJrxmls")
 	@RequestMapping("/standardJrxmls")
 	@ResponseBody
 	@ResponseBody
 	public Map<String, Object> standardJrxmls(String userName, String onlyData, HttpServletResponse response) {
 	public Map<String, Object> standardJrxmls(String userName, String onlyData, HttpServletResponse response) {
+		userName = userName == null ? null : userName.toUpperCase();
 		// onlyData为真,只返回字节数据(自动部署时只获取标准模板字节数据),否则下载标准模板zip
 		// onlyData为真,只返回字节数据(自动部署时只获取标准模板字节数据),否则下载标准模板zip
 		if (!StringUtils.isEmpty(onlyData) && (onlyData.equals("1") || onlyData.equals("true"))) {
 		if (!StringUtils.isEmpty(onlyData) && (onlyData.equals("1") || onlyData.equals("true"))) {
 			Map<String, Object> result = new HashMap<>();
 			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()
 	@RequestMapping()
 	public void print(String userName, String profile, String reportName, String whereCondition, String otherParameters,
 	public void print(String userName, String profile, String reportName, String whereCondition, String otherParameters,
 			String printType, String title, HttpServletRequest request, HttpServletResponse response) {
 			String printType, String title, HttpServletRequest request, HttpServletResponse response) {
+		userName = userName == null ? null : userName.toUpperCase();
 		// printType为空,默认进入预览页
 		// printType为空,默认进入预览页
 		if (StringUtils.isEmpty(printType)) {
 		if (StringUtils.isEmpty(printType)) {
 			printType = ReportConstants.PREVIEW_PRINT_TYPE;
 			printType = ReportConstants.PREVIEW_PRINT_TYPE;
@@ -134,6 +135,7 @@ public class PrintController {
 	public void export(String userName, String profile, String reportName, String whereCondition,
 	public void export(String userName, String profile, String reportName, String whereCondition,
 			String otherParameters, String exportFileType, Boolean flush, String title, HttpServletRequest request,
 			String otherParameters, String exportFileType, Boolean flush, String title, HttpServletRequest request,
 			HttpServletResponse response) {
 			HttpServletResponse response) {
+		userName = userName == null ? null : userName.toUpperCase();
 		ReportUtils.checkParameters(userName, reportName);
 		ReportUtils.checkParameters(userName, reportName);
 		if (printService.overload(userName, profile, reportName, whereCondition, otherParameters)) {
 		if (printService.overload(userName, profile, reportName, whereCondition, otherParameters)) {
 			throw new ReportException("数据量过大,无法提供服务");
 			throw new ReportException("数据量过大,无法提供服务");
@@ -226,9 +228,10 @@ public class PrintController {
 	 */
 	 */
 	@RequestMapping(value = "/loadPdfData")
 	@RequestMapping(value = "/loadPdfData")
 	@ResponseBody
 	@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,
 			final String whereCondition, final String otherParameters, Integer pageIndex, Boolean flush,
 			HttpServletRequest request, HttpServletResponse response) {
 			HttpServletRequest request, HttpServletResponse response) {
+		userName = userName == null ? null : userName.toUpperCase();
 		ReportUtils.checkParameters(userName, reportName);
 		ReportUtils.checkParameters(userName, reportName);
 		if (printService.overload(userName, profile, reportName, whereCondition, otherParameters)) {
 		if (printService.overload(userName, profile, reportName, whereCondition, otherParameters)) {
 			throw new ReportException("数据量过大,无法提供服务");
 			throw new ReportException("数据量过大,无法提供服务");
@@ -256,11 +259,12 @@ public class PrintController {
 						1);
 						1);
 				result.put("pageSize", pageSize);
 				result.put("pageSize", pageSize);
 				// 再开线程生成后面页的pdf、总的pdf(即未分页的pdf)
 				// 再开线程生成后面页的pdf、总的pdf(即未分页的pdf)
+				final String userNameCopy = userName;
 				new Thread(new Runnable() {
 				new Thread(new Runnable() {
 					@Override
 					@Override
 					public void run() {
 					public void run() {
 						// 生成总的pdf
 						// 生成总的pdf
-						printService.createPdfFile(userName, profile, reportName, whereCondition, otherParameters,
+						printService.createPdfFile(userNameCopy, profile, reportName, whereCondition, otherParameters,
 								file.getPath(), null);
 								file.getPath(), null);
 						fileService.createPagedPdfFiles(file.getPath());
 						fileService.createPagedPdfFiles(file.getPath());
 					}
 					}
@@ -304,9 +308,9 @@ public class PrintController {
 	 */
 	 */
 	@RequestMapping(value = "/pdfData")
 	@RequestMapping(value = "/pdfData")
 	@ResponseBody
 	@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);
 		ReportUtils.checkParameters(userName, reportName);
 		Map<String, Object> result = new HashMap<>();
 		Map<String, Object> result = new HashMap<>();
 		// 判断是否过载
 		// 判断是否过载
@@ -344,6 +348,7 @@ public class PrintController {
 	@ResponseBody
 	@ResponseBody
 	public Map<String, Object> getGeneratedPdfOrXlsInformation(String userName, String profile, String reportName,
 	public Map<String, Object> getGeneratedPdfOrXlsInformation(String userName, String profile, String reportName,
 			String whereCondition, String otherParameters, String fileType, HttpServletRequest request) {
 			String whereCondition, String otherParameters, String fileType, HttpServletRequest request) {
+		userName = userName == null ? null : userName.toUpperCase();
 		ReportUtils.checkParameters(userName, reportName);
 		ReportUtils.checkParameters(userName, reportName);
 		Map<String, Object> result = new HashMap<>();
 		Map<String, Object> result = new HashMap<>();
 		if (StringUtils.isEmpty(fileType)) {
 		if (StringUtils.isEmpty(fileType)) {

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

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