Commit eeed0ec4 authored by 鲁鸿波's avatar 鲁鸿波

危险作业预览时技术交底重复生成问题

parent 49c71639
......@@ -1277,7 +1277,7 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan
for (Map.Entry<Integer, List<THazardDisclosure>> entry : listMap.entrySet()) {
Integer batch = entry.getKey();
String format = String.format("第%s次", Convert.numberToChinese(batch, false));
for (THazardDisclosure tHazardDisclosure : disclosureList) {
/*for (THazardDisclosure tHazardDisclosure : disclosureList) {
if (tHazardDisclosure != null) {
populateHazardDisclosureDetails(tHazardDisclosure, sdf, datas, format);
datas.put("index", index);
......@@ -1294,6 +1294,21 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan
// 导出Word
WordExportUtil.exportWord07(document, datas);
wordList.add(document);
}*/
for (THazardDisclosure tHazardDisclosure : entry.getValue()) {
if (tHazardDisclosure != null) {
populateHazardDisclosureDetails(tHazardDisclosure, sdf, datas, format);
datas.put("index", index);
index++;
}
// 加载模板(可优化到循环外)
Resource resource = resourceLoader.getResource("classpath:word/hazardousWorkPermit/disclosure.docx");
InputStream inputStream = resource.getInputStream();
if (inputStream == null) return;
XWPFDocument document = new MyXWPFDocument(inputStream);
WordExportUtil.exportWord07(document, datas);
wordList.add(document);
}
}
......
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