From dcdba8bc1cf004e8e40e71c99902e88b73e85242 Mon Sep 17 00:00:00 2001 From: yjz <3131811435@qq.com> Date: Tue, 23 Jul 2024 19:23:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=96=87=E6=A1=A3=E6=8B=86=E5=88=86):?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../split/service/impl/FileSpiltService.java | 64 +++++++++---------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java b/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java index d1e8bd55..0e0f5814 100644 --- a/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java +++ b/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java @@ -2,8 +2,6 @@ package com.jero.modules.split.service.impl; import cn.hutool.core.lang.RegexPool; import cn.hutool.core.util.ReUtil; -import cn.hutool.http.Header; -import cn.hutool.http.HttpRequest; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.jero.common.exception.JeroBootException; import com.jero.common.system.vo.LoginUser; @@ -41,8 +39,6 @@ import org.openxmlformats.schemas.drawingml.x2006.main.CTGraphicalObject; import org.openxmlformats.schemas.drawingml.x2006.picture.CTPicture; import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTAnchor; import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTInline; -import org.openxmlformats.schemas.officeDocument.x2006.math.CTOMath; -import org.openxmlformats.schemas.officeDocument.x2006.math.CTOMathPara; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDrawing; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTLevelText; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR; @@ -222,34 +218,34 @@ public class FileSpiltService { // //处理段落中的文本以及图片 // handleParagraphRun(content, (XWPFRun) child, imageParser); //} else - if (child instanceof CTOMath) { - CTOMath ctoMath = (CTOMath) child; - String xmlText = ctoMath.xmlText().replaceAll("xml-fragment","m:oMath"); - Map map = new HashMap<>(); - map.put("encode", xmlText); - String post = HttpRequest.post(mathToImgUrl) - .header(Header.CONTENT_TYPE, "application/json") - .body(xmlText) - .execute().body(); - //String post = HttpUtil.post(mathToImgUrl, map); - if (messageList.size() > 0) { - addItermsMathImage(messageList.get(messageList.size() - 1), itemValList, post); - } - } - else if (child instanceof CTOMathPara) { - CTOMathPara ctoMathPara = (CTOMathPara) child; - String xmlText = ctoMathPara.xmlText().replaceAll("xml-fragment","m:oMath");; - Map map = new HashMap<>(); - map.put("encode",xmlText); - String post = HttpRequest.post(mathToImgUrl) - .header(Header.CONTENT_TYPE, "application/json") - .body(xmlText) - .execute().body(); - //String post = HttpUtil.post(mathToImgUrl, map); - if (messageList.size() > 0) { - addItermsMathImage(messageList.get(messageList.size() - 1), itemValList, post); - } - } +// if (child instanceof CTOMath) { +// CTOMath ctoMath = (CTOMath) child; +// String xmlText = ctoMath.xmlText().replaceAll("xml-fragment","m:oMath"); +// Map map = new HashMap<>(); +// map.put("encode", xmlText); +// String post = HttpRequest.post(mathToImgUrl) +// .header(Header.CONTENT_TYPE, "application/json") +// .body(xmlText) +// .execute().body(); +// //String post = HttpUtil.post(mathToImgUrl, map); +// if (messageList.size() > 0) { +// addItermsMathImage(messageList.get(messageList.size() - 1), itemValList, post); +// } +// } +// else if (child instanceof CTOMathPara) { +// CTOMathPara ctoMathPara = (CTOMathPara) child; +// String xmlText = ctoMathPara.xmlText().replaceAll("xml-fragment","m:oMath");; +// Map map = new HashMap<>(); +// map.put("encode",xmlText); +// String post = HttpRequest.post(mathToImgUrl) +// .header(Header.CONTENT_TYPE, "application/json") +// .body(xmlText) +// .execute().body(); +// //String post = HttpUtil.post(mathToImgUrl, map); +// if (messageList.size() > 0) { +// addItermsMathImage(messageList.get(messageList.size() - 1), itemValList, post); +// } +// } } for (XWPFRun xwrun : p.getRuns()) { @@ -376,8 +372,8 @@ public class FileSpiltService { startDigit = getOneStartDigit(paragraphString, enumByValue); } for (int i = 0; i < nowStart.size(); i++) { - if (paragraphString.startsWith(nowStart.get(i))) { - //if (startDigit.equals(nowStart.get(i))) { +// if (paragraphString.startsWith(nowStart.get(i))) { + if (startDigit.equals(nowStart.get(i))) { // 判断真的是标题还是干扰项 TODO if (nowStart.get(i).matches(regex)) { boolean result = fileSplitPdfService.judge(preName, preNameNum, startDigit, g, startDigitList, ".");