From a9d395b60d6ef168c856c2efba6268cb67e4a11c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Sat, 7 Sep 2024 13:28:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8B=86=E5=88=86w:pict?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../split/service/impl/FileSpiltService.java | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java b/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java index e2ae51a..4a1dd0a 100644 --- a/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java +++ b/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java @@ -402,10 +402,13 @@ public class FileSpiltService { }else if (StringUtils.isNotBlank(paragraphString) && titleNumberMap.containsKey(paragraphString)){ replaceNumberFlag = true; List stringList = titleNumberMap.get(paragraphString); - replaceNumber = stringList.get(0); - //replaceNumber = titleNumberMap.get(paragraphString); - paragraphString = replaceNumber + paragraphString; - stringList.remove(0); + if(CollectionUtils.isNotEmpty(stringList)){ + replaceNumber = stringList.get(0); + //replaceNumber = titleNumberMap.get(paragraphString); + paragraphString = replaceNumber + paragraphString; + stringList.remove(0); + } + } String startDigit; if (replaceNumberFlag){ @@ -922,6 +925,22 @@ public class FileSpiltService { c.selectPath("./*"); while (c.toNextSelection()) { XmlObject o = c.getObject(); + if(o.getDomNode().getNodeName().equals("w:pict")){ + String str = o.toString(); + String imgId = ""; + Pattern pattern = Pattern.compile("v:imagedata r:id=\"([^\"]+)\""); + Matcher matcher = pattern.matcher(str); + // 查找匹配项 + if (matcher.find()) { + // 提取捕获组中的内容 + String result = matcher.group(1); + imgId = result; + } + if(StringUtils.isNotBlank(imgId)){ + imageBundleList.add(imgId); + continue; + } + } if(o.getDomNode().getNodeName().equals("mc:AlternateContent")){ String str = o.toString(); String imgId = "";