Commit e5d9dc67 authored by linjian's avatar linjian

添加打印

parent c7da757f
...@@ -31,7 +31,7 @@ public class ContractWordServiceldImpl implements ContractWordServiceld { ...@@ -31,7 +31,7 @@ public class ContractWordServiceldImpl implements ContractWordServiceld {
/*String str = "[{\"DESC1\":\"123\",\"DESC13\":\"浙江鑫诺检测技术有限公司\",\"DESC3\":\"123\",\"handling_dept\":\"中国能源建设集团浙江火电建设有限公司\",\"handled_by\":\"林建\",\"dept\":\"林建 2023-12-21\",\"deptLeader\":\"【林健】林健 2023-12-21 14:25:37\\n 同意\",\"depts\":\"【林健】林健 2023-12-21 14:26:01\\n同意\"},{\"DESC1\":\"4\",\"DESC13\":\"保定市方为电气制造有限公司\",\"DESC3\":\"4\",\"handling_dept\":\"林建\",\"handled_by\":\"林建\",\"dept\":\"林健 2023-12-20\",\"deptLeader\":\"【林健】林健 2023-12-21 13:46:39\\n 同意\",\"depts\":\"【林健】林健 2023-12-21 13:47:21\\n同意\\n【卢太春】卢太春 2023-12-21 13:47:56\\n同意\\n【杜文浩】杜文浩 2023-12-21 13:48:13\\n同意\\n\"}]"; /*String str = "[{\"DESC1\":\"123\",\"DESC13\":\"浙江鑫诺检测技术有限公司\",\"DESC3\":\"123\",\"handling_dept\":\"中国能源建设集团浙江火电建设有限公司\",\"handled_by\":\"林建\",\"dept\":\"林建 2023-12-21\",\"deptLeader\":\"【林健】林健 2023-12-21 14:25:37\\n 同意\",\"depts\":\"【林健】林健 2023-12-21 14:26:01\\n同意\"},{\"DESC1\":\"4\",\"DESC13\":\"保定市方为电气制造有限公司\",\"DESC3\":\"4\",\"handling_dept\":\"林建\",\"handled_by\":\"林建\",\"dept\":\"林健 2023-12-20\",\"deptLeader\":\"【林健】林健 2023-12-21 13:46:39\\n 同意\",\"depts\":\"【林健】林健 2023-12-21 13:47:21\\n同意\\n【卢太春】卢太春 2023-12-21 13:47:56\\n同意\\n【杜文浩】杜文浩 2023-12-21 13:48:13\\n同意\\n\"}]";
JSONArray array = JSONObject.parseArray(str);*/ JSONArray array = JSONObject.parseArray(str);*/
System.out.println(request.getData());
for(int i = 0; i < request.getData().size(); i++) { for(int i = 0; i < request.getData().size(); i++) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
/*JSONObject item = array.getJSONObject(i);*/ /*JSONObject item = array.getJSONObject(i);*/
...@@ -64,15 +64,16 @@ public class ContractWordServiceldImpl implements ContractWordServiceld { ...@@ -64,15 +64,16 @@ public class ContractWordServiceldImpl implements ContractWordServiceld {
XWPFDocument word = new MyXWPFDocument(resource); XWPFDocument word = new MyXWPFDocument(resource);
WordExportUtil.exportWord07(word, map); WordExportUtil.exportWord07(word, map);
word.write(fileOutputStream); word.write(fileOutputStream);
/*response.setHeader("Content-disposition", "attachment;filename=\"" // response.setHeader("Content-disposition", "attachment;filename=\""
+ new String(fileName.getBytes("UTF-8"), "ISO8859_1") + "\""); // + new String(fileName.getBytes("UTF-8"), "ISO8859_1") + "\"");
response.setContentType("application/download;charset=UTF-8"); // response.setContentType("application/download;charset=UTF-8");
//
OutputStream outputStream = response.getOutputStream(); // OutputStream outputStream = response.getOutputStream();
word.write(outputStream);*/ // word.write(outputStream);
//文件上传oss //文件上传oss
fileUrl = ossService.uploadOssObject(request.getTenantId(), System.currentTimeMillis() + "/" + fileName, fileInputStream); fileUrl = ossService.uploadOssObject(request.getTenantId(), System.currentTimeMillis() + "/" + fileName, fileInputStream);
System.out.println(fileUrl);
fileUrls.add(fileUrl); fileUrls.add(fileUrl);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment