|
|
@@ -227,8 +227,8 @@ public class ReportServiceImpl extends BaseServiceImpl<ReportMapper, Report> imp |
|
|
|
ReportInfoVO reportInfoVO = detail(reportId); |
|
|
|
//创建word |
|
|
|
String fileName = "汤山林场无人机巡检报告【"+ reportInfoVO.getReportNo() + "】.doc"; |
|
|
|
String filePath = UploadFileConfig.uploadFolder+"/doc/"+fileName; |
|
|
|
File fd = new File(UploadFileConfig.uploadFolder+"/doc"); |
|
|
|
String filePath = UploadFileConfig.uploadFolder+"doc/"+fileName; |
|
|
|
File fd = new File(UploadFileConfig.uploadFolder+"doc"); |
|
|
|
File f = new File(filePath); |
|
|
|
if(!fd.exists()){ |
|
|
|
fd.mkdirs(); |
|
|
@@ -506,11 +506,11 @@ public class ReportServiceImpl extends BaseServiceImpl<ReportMapper, Report> imp |
|
|
|
response.reset(); |
|
|
|
// 定义浏览器响应表头,并定义下载名 |
|
|
|
//String urlFileName = URLEncoder.encode("汤山林场无人机巡检报告【"+ reportInfoVO.getReportNo() + "】.doc", "UTF-8"); |
|
|
|
String urlFileName =new String(("汤山林场无人机巡检报告【"+ reportInfoVO.getReportNo() + "】.doc").getBytes(), StandardCharsets.ISO_8859_1); |
|
|
|
String urlFileName =new String(("汤山林场无人机巡检报告【"+ reportInfoVO.getReportNo() + "】.doc").getBytes(), StandardCharsets.UTF_8); |
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + urlFileName); |
|
|
|
response.setCharacterEncoding("utf-8"); |
|
|
|
//定义下载的类型 |
|
|
|
response.setContentType("application/octet-stream;charset=utf-8"); |
|
|
|
response.setContentType("application/msword;charset=GBK"); |
|
|
|
|
|
|
|
OutputStream out; |
|
|
|
//File files = new File(filePath); |