|
|
@@ -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)) {
|