|
|
@@ -114,7 +114,9 @@ public class PrintController {
|
|
|
* @param id 预打印时获取的 id
|
|
|
* @return 缓存的打印参数
|
|
|
*/
|
|
|
- private PrintParameter getPrintParameter(String id) {
|
|
|
+ @RequestMapping(value = "/parameter")
|
|
|
+ @ResponseBody
|
|
|
+ public PrintParameter getPrintParameter(String id, HttpServletRequest request, HttpServletResponse response) {
|
|
|
Assert.hasText(id, "Required String parameter 'id' is not present");
|
|
|
PrintParameter printParameter = printParameters.get(id);
|
|
|
Assert.notNull(printParameter, "id 不存在");
|
|
|
@@ -136,7 +138,7 @@ public class PrintController {
|
|
|
@RequestMapping(value = "/routing", method = RequestMethod.GET)
|
|
|
public void routing(String id, HttpServletRequest request, HttpServletResponse response)
|
|
|
throws JRException, IOException, DocumentException, SQLException, ServletException {
|
|
|
- PrintParameter printParameter = getPrintParameter(id);
|
|
|
+ PrintParameter printParameter = getPrintParameter(id, request, response);
|
|
|
switch (printParameter.getPrintType()) {
|
|
|
// 预览或打印
|
|
|
case PREVIEW:
|
|
|
@@ -186,7 +188,7 @@ public class PrintController {
|
|
|
public void export(String id, String exportFileType, Boolean flush, HttpServletRequest request,
|
|
|
HttpServletResponse response) throws JRException, IOException, DocumentException, SQLException {
|
|
|
// TODO show download process
|
|
|
- PrintParameter printParameter = getPrintParameter(id);
|
|
|
+ PrintParameter printParameter = getPrintParameter(id, request, response);
|
|
|
String userName = printParameter.getUserName();
|
|
|
String profile = printParameter.getProfile();
|
|
|
String reportName = printParameter.getReportName();
|
|
|
@@ -233,7 +235,7 @@ public class PrintController {
|
|
|
@RequestMapping(value = "/pdfPath")
|
|
|
@ResponseBody
|
|
|
public String getPdfPath(String id, Boolean flush, HttpServletRequest request, HttpServletResponse response) throws JRException, IOException, DocumentException, SQLException {
|
|
|
- PrintParameter printParameter = getPrintParameter(id);
|
|
|
+ PrintParameter printParameter = getPrintParameter(id, request, response);
|
|
|
String userName = printParameter.getUserName();
|
|
|
String profile = printParameter.getProfile();
|
|
|
String reportName = printParameter.getReportName();
|