|
|
@@ -80,9 +80,9 @@ public class PrintController {
|
|
|
* @throws JRException
|
|
|
* @throws ServletException
|
|
|
*/
|
|
|
- @RequestMapping(value = "/pre")
|
|
|
+ @RequestMapping(value = "")
|
|
|
@ResponseBody
|
|
|
- public String preprint(String userName, String profile, String reportName, String whereCondition, String otherParameters,
|
|
|
+ public void preprint(String userName, String profile, String reportName, String whereCondition, String otherParameters,
|
|
|
String printType, String title, HttpServletRequest request, HttpServletResponse response)
|
|
|
throws JRException, IOException, DocumentException, SQLException, ServletException {
|
|
|
userName = userName == null ? null : userName.toUpperCase();
|
|
|
@@ -90,7 +90,7 @@ public class PrintController {
|
|
|
PrintType type = StringUtils.isEmpty(printType) ? PrintType.PREVIEW : PrintType.checkType(printType);
|
|
|
String requestId = UUID.randomUUID().toString().replace("-", "");
|
|
|
printParameters.put(requestId, new PrintParameter(userName, profile, reportName, whereCondition, otherParameters, type, title));
|
|
|
- return requestId;
|
|
|
+ response.sendRedirect("print/routing?id=" +requestId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -121,14 +121,14 @@ public class PrintController {
|
|
|
* @throws JRException
|
|
|
* @throws ServletException
|
|
|
*/
|
|
|
- @RequestMapping(method = RequestMethod.GET)
|
|
|
- public void print(@RequestParam String id, HttpServletRequest request, HttpServletResponse response)
|
|
|
+ @RequestMapping(value = "/routing", method = RequestMethod.GET)
|
|
|
+ public void routing(@RequestParam String id, HttpServletRequest request, HttpServletResponse response)
|
|
|
throws JRException, IOException, DocumentException, SQLException, ServletException {
|
|
|
switch (getPrintParameter(id, request, response).getPrintType()) {
|
|
|
// 预览或打印
|
|
|
case PREVIEW:
|
|
|
case PRINT:
|
|
|
- request.getRequestDispatcher("preview").forward(request, response);
|
|
|
+ response.sendRedirect("../preview?id=" + id);
|
|
|
break;
|
|
|
case PDF:
|
|
|
export(id, ExportType.PDF.name(), true, request, response);
|
|
|
@@ -163,7 +163,7 @@ public class PrintController {
|
|
|
* @throws IOException
|
|
|
* @throws JRException
|
|
|
*/
|
|
|
- @RequestMapping(value = "/export", method = RequestMethod.GET)
|
|
|
+ @RequestMapping(value = "/export")
|
|
|
@ResponseBody
|
|
|
public void export(@RequestParam String id, String exportFileType, Boolean flush, HttpServletRequest request,
|
|
|
HttpServletResponse response) throws JRException, IOException, DocumentException, SQLException {
|