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

修复模板中出现动态表格时可能会导致重复生成动态表格内容标签的bug

parent cedc0461
......@@ -155,6 +155,7 @@ public class CertificateCatalogServiceImpl extends AbstractCRUDServiceImpl<Certi
cons.setUploadFileUrl(uploadUrl);
if (type.equalsIgnoreCase(ComponentEnum.DYNAMIC_TABLE.getValue())) {
HashSet<String> dhs = new HashSet<>(); //去除重复标签
List<TableColItem> colList = new ArrayList<>();
//表格 结构化绑定数据
ConfigureBuilder builderTable = Configure.builder();
......@@ -164,6 +165,11 @@ public class CertificateCatalogServiceImpl extends AbstractCRUDServiceImpl<Certi
XWPFTemplate templateTable = XWPFTemplate.compile(filepath, builderTable.build());
for (MetaTemplate col : templateTable.getElementTemplates()) {
if(dhs.contains(col.variable())){
continue;
}else {
dhs.add(col.variable());
}
String colVal = StrUtil.strip(col.variable(), "[", "]");
if (!StrUtil.startWith(colVal, label)) {
continue;
......
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