Commit c22f51d0 authored by 廖旭伟's avatar 廖旭伟

修改生成文档时导致ConcurrentModificationException的bug

parent c4f1b7ef
......@@ -233,6 +233,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
try {
Map<String, Object> data = mapper.readValue(docTemplate.getFormContent(), Map.class);
Map<String, Object> addMap = new HashMap<>();
//遍历查看是否有图片数据,多选框
data.entrySet().stream().forEach(entry -> {
if (entry.getKey().indexOf("@image") != -1) {
......@@ -242,7 +243,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
try {
PictureRenderData pictureRenderData = Pictures.ofStream(new FileInputStream(imagepath), PictureType.JPEG)
.size(100, 120).create();
data.put(StrUtil.removePrefixIgnoreCase(entry.getKey(),"@"),pictureRenderData);
addMap.put(StrUtil.removePrefixIgnoreCase(entry.getKey(),"@"),pictureRenderData);
//entry.setValue(pictureRenderData);
} catch (FileNotFoundException e) {
log.error("error", e);
......@@ -278,6 +279,9 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
builder.bind(entry.getKey(), new MultipleRowTableRenderPolicy());
}
});
if(addMap.size()>0){
data.putAll(addMap);
}
//查询是否有多选框,
//获取模板文件地址
String path = rootPath + docTemplate.getTemplatePath();
......
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