|
@@ -27,6 +27,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.ServletOutputStream;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.IOException;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -167,8 +169,11 @@ public class PurchaseDocumentaryController {
|
|
|
outputStream = response.getOutputStream();
|
|
|
service.pdfPreview(pdfPreviewDto, outputStream);
|
|
|
} catch (Exception e) {
|
|
|
- log.error("预览pdf失败", e);
|
|
|
- throw new ServiceException("预览pdf失败");
|
|
|
+ try {
|
|
|
+ outputStream.write("预览pdf失败".getBytes(StandardCharsets.UTF_8));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ throw new RuntimeException(ex);
|
|
|
+ }
|
|
|
} finally {
|
|
|
IoUtil.close(outputStream);
|
|
|
}
|