一、提取字段:
依赖
<dependency><groupId>org.apache.poi</groupId><artifactId>poi</artifactId><version>3.17</version></dependency><dependency><groupId>org.apache.poi</groupId><artifactId>poi-ooxml</artifactId><version>3.17</version></dependency><dependency><groupId>org.apache.poi</groupId><artifactId>poi-ooxml-schemas</artifactId><version>3.17</version></dependency>
代码
public InputStream wordReplaceModel(Map<String, String> modelMapValue, InputStream inputStream) {if (modelMapValue == null || modelMapValue.isEmpty()) {throw new BusinessException("500", "模板值参数不能为空");}try (XWPFDocument xwpfDocument = new XWPFDocument(inputStream);ByteArrayOutputStream outputStream = new