diff --git a/pom.xml b/pom.xml
index 590d003..3eeef4e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -160,6 +160,22 @@
+
+ org.docx4j
+ docx4j-core
+ 11.5.4
+
+
+ org.docx4j
+ docx4j-JAXB-MOXy
+ 11.5.4
+
+
+
+ org.docx4j
+ docx4j-JAXB-Internal
+ 8.3.9
+
diff --git a/src/main/java/com/example/exam/exam/service/wpsword/ColorNameFinder.java b/src/main/java/com/example/exam/exam/service/wpsword/ColorNameFinder.java
deleted file mode 100644
index 0882a63..0000000
--- a/src/main/java/com/example/exam/exam/service/wpsword/ColorNameFinder.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package com.example.exam.exam.service.wpsword;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class ColorNameFinder {
- // 颜色代码到名称的映射
- private static final Map COLOR_MAP = new HashMap<>();
-
- static {
- COLOR_MAP.put("FF0000", "红色");
- COLOR_MAP.put("00FF00", "绿色");
- COLOR_MAP.put("0000FF", "蓝色");
- COLOR_MAP.put("FFFF00", "黄色");
- COLOR_MAP.put("FFA500", "橙色");
- COLOR_MAP.put("800080", "紫色");
- COLOR_MAP.put("000000", "黑色");
- COLOR_MAP.put("FFFFFF", "白色");
- COLOR_MAP.put("BB6433", "棕橙色");
- COLOR_MAP.put("FFC000", "淡黄色");
- COLOR_MAP.put("0070C0", "蓝色");
-
- // 你可以继续扩展
- }
-
- public static String getColorName(String input) {
- String hex = null;
-
- input = input.trim();
-
- if (input.startsWith("#")) {
- hex = input.substring(1).toUpperCase();
- } else if (input.matches("[0-9a-fA-F]{6}")) {
- hex = input.toUpperCase();
- } else if (input.toLowerCase().startsWith("rgb")) {
- // 解析 rgb(255,0,0) 格式
- hex = rgbToHex(input);
- }
-
- if (hex != null) {
- return COLOR_MAP.getOrDefault(hex, "未知颜色");
- }
-
- return "格式错误";
- }
-
- private static String rgbToHex(String rgb) {
- // rgb(255,0,0) -> "FF0000"
- try {
- String inner = rgb.substring(rgb.indexOf('(') + 1, rgb.indexOf(')'));
- String[] parts = inner.split(",");
- if (parts.length != 3) return null;
-
- int r = Integer.parseInt(parts[0].trim());
- int g = Integer.parseInt(parts[1].trim());
- int b = Integer.parseInt(parts[2].trim());
-
- if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) return null;
-
- return String.format("%02X%02X%02X", r, g, b);
- } catch (Exception e) {
- return null;
- }
- }
-}
diff --git a/src/main/java/com/example/exam/exam/service/wpsword/JudgementWpsWordServiceImpl.java b/src/main/java/com/example/exam/exam/service/wpsword/JudgementWpsWordServiceImpl.java
index 3889f28..d24cebd 100644
--- a/src/main/java/com/example/exam/exam/service/wpsword/JudgementWpsWordServiceImpl.java
+++ b/src/main/java/com/example/exam/exam/service/wpsword/JudgementWpsWordServiceImpl.java
@@ -4,11 +4,17 @@ package com.example.exam.exam.service.wpsword;
import com.example.exam.exam.dal.ExamQuestion;
import com.example.exam.exam.dal.ExamQuestionAnswer;
import com.example.exam.exam.dal.SourceAndText;
+import com.example.exam.exam.service.wpsword.docx4j.DocxMaster;
+import com.example.exam.exam.service.wpsword.docx4j.vo.JudgementWordsVO;
+import com.example.exam.exam.service.wpsword.docx4j.vo.WpsDocxInfoVo;
+import com.example.exam.exam.utils.CustomMultipartFile;
import com.example.exam.exam.utils.HtmlAppender;
import com.example.exam.exam.utils.c.LogFileUtils;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+import java.io.File;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
@@ -23,73 +29,58 @@ public class JudgementWpsWordServiceImpl implements JudgementWpsWordService {
@Override
public SourceAndText judgementWpsWord(double sorce, String pathC, String path, ExamQuestion examQuestion, String judgementStr) throws Exception {
SourceAndText sourceAndText = new SourceAndText();
+ List wpsDocxInfos = new ArrayList<>();
// 创建log文件txt,用于记录
-// LogFileUtils.createFile(pathC + "/WPS_Word判分过程.txt");
-// LogFileUtils.writeLine("✅ 开始WPS_Word判分");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "✅ 开始WPS_Word判分");
double wps_word_sorce = 0;
// 2、docx文件读取并返回考点及说明信息
-// List margins = WpsWordUtils.wps_word(path);
// 3、获取答案得组成
List answerList = examQuestion.getAnswerList();
// 4、进行关联判断
for (ExamQuestionAnswer examQuestionAnswer : answerList) {
// 拆分数据、
- String[] wordInfos = examQuestionAnswer.getContent().split("-/");
- String[] chineseName = examQuestionAnswer.getContentIn().split("-");
- String[] typeList = examQuestionAnswer.getImage().split("-");
- // 创建拼接数据
- // 只取三层结构
- List wordReqDto = new ArrayList<>();
- WpsWordReqDto wpsWordReqDto = new WpsWordReqDto();
- wpsWordReqDto.setName(examQuestionAnswer.getContentIn());
- wpsWordReqDto.setEnglishName(wordInfos[0].split("]")[0] + "]");
- wpsWordReqDto.setFilePath(path);
- // 存放类型
- wpsWordReqDto.setType(typeList[0]);
- wpsWordReqDto.setBelongTo(typeList[1]);
- wpsWordReqDto.setIsboo(typeList[2]);
- wpsWordReqDto.setUnit(typeList[3]);
- wpsWordReqDto.setFunction(wordInfos[0]);
- wpsWordReqDto.setIsExam("1");
- wordReqDto.add(wpsWordReqDto);
- System.out.println(examQuestionAnswer.getContentIn());
- System.out.println(examQuestionAnswer.getContent());
- List judgementDtos = WpsWordUtils.getWordInfo(wordReqDto);
- boolean flag = false;
- double one_sorce = 0;
- for (WpsWordJudgementDto wordJudgementDto : judgementDtos) {
+ String[] docxInfo = examQuestionAnswer.getContent().split("@");
+ WpsDocxInfoVo wpsDocxInfoVo = new WpsDocxInfoVo();
+ wpsDocxInfoVo.setFirstName(docxInfo[0]);
+ wpsDocxInfoVo.setIndex(docxInfo[1]);
+ wpsDocxInfoVo.setFunction(docxInfo[2]);
+ wpsDocxInfoVo.setExamName(docxInfo[3]);
+ wpsDocxInfoVo.setExamCode(docxInfo[4]);
+ // 组成判分的结果
+ wpsDocxInfos.add(wpsDocxInfoVo);
+ }
+ // 4.1、将文件转成文件流的形式
+ MultipartFile multipartFile = new CustomMultipartFile(new File(path));
+ // 5、进行判分
+ List judgementWordsVOS = DocxMaster.docxMaster(wpsDocxInfos, multipartFile);
+ boolean flag = false;
+ double one_sorce = 0;
+ // 6、进行得分计算
+ for (ExamQuestionAnswer examQuestionAnswer : answerList) {
+ for (JudgementWordsVO wordJudgementDto : judgementWordsVOS) {
if (wordJudgementDto.getContent() != null) {
-// for (String str : wordJudgementDto.getFunction()) {
- int index = 0;
- if (wordJudgementDto.getContent().equals(examQuestionAnswer.getContent())) {
- flag = true;
- // 得分 根据权重进行得分 每个选项分值 = 总分 / 总权重
- if (examQuestionAnswer.getScoreRate().equals("1")) {
- // 说明权重相等,直接平分分数
- one_sorce = sorce / answerList.size();
- } else {
- one_sorce = sorce * Double.parseDouble(examQuestionAnswer.getScoreRate());
- }
- break;
+ if (wordJudgementDto.getContent().equals(examQuestionAnswer.getContent())) {
+ flag = true;
+ // 得分 根据权重进行得分 每个选项分值 = 总分 / 总权重
+ if (examQuestionAnswer.getScoreRate().equals("1")) {
+ // 说明权重相等,直接平分分数
+ one_sorce = sorce / answerList.size();
+ } else {
+ one_sorce = sorce * Double.parseDouble(examQuestionAnswer.getScoreRate());
}
-// }
+ break;
+ }
}
}
wps_word_sorce += one_sorce;
if (flag) {
-// LogFileUtils.writeLine("✅ " + examQuestionAnswer.getContentIn() + " 得分成功,得分:" + one_sorce);
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "✅ " + examQuestionAnswer.getContentIn() + " 得分成功,得分:" + new BigDecimal(one_sorce).setScale(1, RoundingMode.HALF_UP));
} else {
-// LogFileUtils.writeLine("❌ " + examQuestionAnswer.getContentIn() + " 得分失败");
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, "❌ " + examQuestionAnswer.getContentIn() + " 得分失败");
}
}
-// LogFileUtils.writeLine("✅ 结束WPS_Word判分,试题得分:" + wps_word_sorce);
- // 关闭已经打开得文件
-// LogFileUtils.close();
sourceAndText.setScore(wps_word_sorce);
sourceAndText.setText(judgementStr);
return sourceAndText;
diff --git a/src/main/java/com/example/exam/exam/service/wpsword/PageSizeDetector.java b/src/main/java/com/example/exam/exam/service/wpsword/PageSizeDetector.java
deleted file mode 100644
index 7ffefc4..0000000
--- a/src/main/java/com/example/exam/exam/service/wpsword/PageSizeDetector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.example.exam.exam.service.wpsword;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class PageSizeDetector {
- public static String detectPaperSize(String pgSzXml) {
- Pattern pattern = Pattern.compile("w:w=\"(\\d+)\".*?");
- Matcher matcher = pattern.matcher(pgSzXml);
- int widthTwip = 0;
- if (matcher.find()) {
- widthTwip = Integer.parseInt(matcher.group(1));
- }
- Pattern patterns = Pattern.compile("w:h=\"(\\d+)\".*?");
- Matcher matchers = patterns.matcher(pgSzXml);
- int heightTwip = 0;
- if (matchers.find()) {
- heightTwip = Integer.parseInt(matchers.group(1));
- }
- Pattern patternss = Pattern.compile("w:orient\\s*=\\s*\"(.*?)\"");
- Matcher matcherss = patternss.matcher(pgSzXml);
- String orient = "";
- if (matcherss.find()) {
- orient = matcherss.group(1);
- }
- // 如果方向是 landscape,宽高调换(视觉上)
- if ("landscape".equalsIgnoreCase(orient)) {
- int temp = widthTwip;
- widthTwip = heightTwip;
- heightTwip = temp;
- }
- // 转换为 cm:1 twip = 1/1440 英寸 = 2.54 / 1440 cm
- double widthCm = widthTwip * 2.54 / 1440;
- double heightCm = heightTwip * 2.54 / 1440;
-
- // 四舍五入保留一位小数
- widthCm = Math.round(widthCm * 10) / 10.0;
- heightCm = Math.round(heightCm * 10) / 10.0;
-
- // 判断标准纸型(以 cm 为单位进行匹配)
- String paperType = "Unknown";
- if (approx(widthCm, 21.0) && approx(heightCm, 29.7)) {
- paperType = "A4";
- } else if (approx(widthCm, 29.7) && approx(heightCm, 42.0)) {
- paperType = "A3";
- } else if (approx(widthCm, 14.8) && approx(heightCm, 21.0)) {
- paperType = "A5";
- }
-
- return String.format("纸张类型:%s(%.1fcm × %.1fcm)", paperType, widthCm, heightCm);
- }
-
- public static String detectPaperPPTSize(String pgSzXml) {
- Pattern pattern = Pattern.compile("cx=\"(\\d+)\".*?");
- Matcher matcher = pattern.matcher(pgSzXml);
- int widthTwip = 0;
- if (matcher.find()) {
- widthTwip = Integer.parseInt(matcher.group(1));
- }
- Pattern patterns = Pattern.compile("cy=\"(\\d+)\".*?");
- Matcher matchers = patterns.matcher(pgSzXml);
- int heightTwip = 0;
- if (matchers.find()) {
- heightTwip = Integer.parseInt(matchers.group(1));
- }
- // 转换为 cm:1 twip = 1/1440 英寸 = 2.54 / 1440 cm
- double widthCm = widthTwip / 360000;
- double heightCm = heightTwip / 360000;
-
- // 四舍五入保留一位小数
- widthCm = Math.round(widthCm * 10) / 10.0;
- heightCm = Math.round(heightCm * 10) / 10.0;
-
- // 判断标准纸型(以 cm 为单位进行匹配)
- String paperType = "自定义";
- if (approx(widthCm, 21.0) && approx(heightCm, 29.7)) {
- paperType = "A4";
- } else if (approx(widthCm, 29.7) && approx(heightCm, 42.0)) {
- paperType = "A3";
- } else if (approx(widthCm, 14.8) && approx(heightCm, 21.0)) {
- paperType = "A5";
- }
-
- return String.format("纸张类型:%s(%.1fcm × %.1fcm)", paperType, widthCm, heightCm);
- }
-
- // 判断两个 double 值是否接近
- private static boolean approx(double a, double b) {
- return Math.abs(a - b) < 0.5; // 误差范围 0.5cm 内
- }
-
- // 示例用法
- public static void main(String[] args) {
- String xml = "";
- System.out.println(detectPaperSize(xml));
- }
-}
diff --git a/src/main/java/com/example/exam/exam/service/wpsword/ShadowDirectionUtils.java b/src/main/java/com/example/exam/exam/service/wpsword/ShadowDirectionUtils.java
deleted file mode 100644
index 2ff5784..0000000
--- a/src/main/java/com/example/exam/exam/service/wpsword/ShadowDirectionUtils.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.example.exam.exam.service.wpsword;
-
-public class ShadowDirectionUtils {
-
- // 中文阴影方向枚举
- public enum ShadowDirection {
- 上("上"),
- 右上("右上"),
- 右("右"),
- 右下("右下"),
- 下("下"),
- 左下("左下"),
- 左("左"),
- 左上("左上"),
- 中心("中心"),
- 未知("未知");
-
- private final String label;
-
- ShadowDirection(String label) {
- this.label = label;
- }
-
- public String getLabel() {
- return label;
- }
- }
-
- /**
- * 根据 dir 值判断阴影方向类型(返回中文方向)
- * @param dir 阴影方向(单位为 1/60000 度)
- * @return 中文方向名
- */
- public static ShadowDirection getShadowDirection(long dir) {
- // 转换为角度
- double angle = dir / 60000.0;
- angle = ((angle % 360) + 360) % 360; // 归一化到 0~360°
-
- if (angle >= 337.5 || angle < 22.5) {
- return ShadowDirection.右;
- } else if (angle >= 22.5 && angle < 67.5) {
- return ShadowDirection.右下;
- } else if (angle >= 67.5 && angle < 112.5) {
- return ShadowDirection.下;
- } else if (angle >= 112.5 && angle < 157.5) {
- return ShadowDirection.左下;
- } else if (angle >= 157.5 && angle < 202.5) {
- return ShadowDirection.左;
- } else if (angle >= 202.5 && angle < 247.5) {
- return ShadowDirection.左上;
- } else if (angle >= 247.5 && angle < 292.5) {
- return ShadowDirection.上;
- } else if (angle >= 292.5 && angle < 337.5) {
- return ShadowDirection.右上;
- } else {
- return ShadowDirection.未知;
- }
- }
-
- // 示例用法
- public static void main(String[] args) {
- long[] testDirs = {
- 0, // 右
- 1350000, // 右下
- 5400000, // 下
- 13500000, // 左
- 18900000, // 右上
- 16200000, // 上
- 21600000 // 右
- };
-
- for (long dir : testDirs) {
- ShadowDirection direction = getShadowDirection(dir);
- System.out.printf("dir=%d (%.1f°) => 阴影方向:%s%n", dir, dir / 60000.0, direction.getLabel());
- }
- }
-}
diff --git a/src/main/java/com/example/exam/exam/service/wpsword/TwipConverter.java b/src/main/java/com/example/exam/exam/service/wpsword/TwipConverter.java
deleted file mode 100644
index bd00907..0000000
--- a/src/main/java/com/example/exam/exam/service/wpsword/TwipConverter.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.example.exam.exam.service.wpsword;
-
-public class TwipConverter {
-
- // 转换常量
- private static final double TWIPS_PER_INCH = 1440.0;
- private static final double TWIPS_PER_CM = 567.0;
- private static final double TWIPS_PER_POINT = 20.0;
- private static final double EMUS_PER_POINT = 12700.0;
-
- // Twip 转厘米
- public static double toCentimeters(int twip) {
- return twip * 2.54 / TWIPS_PER_INCH;
- }
-
- // Twip 转英寸
- public static double toInches(int twip) {
- return twip / TWIPS_PER_INCH;
- }
-
- // Twip 转磅(point)
- public static double toPoints(int twip) {
- return twip / TWIPS_PER_POINT;
- }
- public static double toEmus(int twip) {
- return twip / EMUS_PER_POINT;
- }
- // 保留两位小数格式化(通用)
- public static String formatDouble(double value) {
- return String.format("%.2f", value);
- }
-
- // 示例主方法(可删除)
- public static void main(String[] args) {
- int twipValue = 1134;
-
- System.out.println("Twip: " + twipValue);
- System.out.println("厘米: " + formatDouble(toCentimeters(twipValue)) + " cm");
- System.out.println("英寸: " + formatDouble(toInches(twipValue)) + " in");
- System.out.println("磅数: " + formatDouble(toPoints(twipValue)) + " pt");
- }
-}
diff --git a/src/main/java/com/example/exam/exam/service/wpsword/WordHeaderFooterVo.java b/src/main/java/com/example/exam/exam/service/wpsword/WordHeaderFooterVo.java
deleted file mode 100644
index ecfbf76..0000000
--- a/src/main/java/com/example/exam/exam/service/wpsword/WordHeaderFooterVo.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.example.exam.exam.service.wpsword;
-
-import lombok.Data;
-
-@Data
-public class WordHeaderFooterVo {
-
- private String rid;
- private String type;
- private String xmlType;
-}
diff --git a/src/main/java/com/example/exam/exam/service/wpsword/WpsWordJudgementDto.java b/src/main/java/com/example/exam/exam/service/wpsword/WpsWordJudgementDto.java
deleted file mode 100644
index 06a1215..0000000
--- a/src/main/java/com/example/exam/exam/service/wpsword/WpsWordJudgementDto.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.example.exam.exam.service.wpsword;
-
-import lombok.Data;
-
-/**
- * @author REN
- */
-@Data
-public class WpsWordJudgementDto {
- private String content;
- private String contentIn;
- private String image;
- private String scoreRate;
-}
diff --git a/src/main/java/com/example/exam/exam/service/wpsword/WpsWordNameSpaces.java b/src/main/java/com/example/exam/exam/service/wpsword/WpsWordNameSpaces.java
deleted file mode 100644
index a0b7bbf..0000000
--- a/src/main/java/com/example/exam/exam/service/wpsword/WpsWordNameSpaces.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.example.exam.exam.service.wpsword;
-
-@SuppressWarnings("all")
-public class WpsWordNameSpaces {
-
- public static String getNameSpace(String xmlString) {
- // 2、创建最全的命名空间
-// Pattern pattern = Pattern.compile("xmlns:(\\w+)='([^']+)'");
-// Matcher matcher = pattern.matcher(xmlString);
-// Map namespaces = new HashMap<>();
-// while (matcher.find()) {
-// // 如 w, wp, a
-// String prefix = matcher.group(1);
-// // 如 http://schemas.openxmlformats.org/...
-// String uri = matcher.group(2);
-// namespaces.put(prefix, uri);
-// }
-// StringBuilder xpathBuilder = new StringBuilder();
-// namespaces.forEach((prefix, uri) ->
-// xpathBuilder.append("declare namespace ")
-// .append(prefix)
-// .append("='")
-// .append(uri)
-// .append("' ")
-// );
-// // 2-1、获取出来最全的命名空间
-// String allPathx = xpathBuilder.toString();
- return "declare namespace w='http://schemas.openxmlformats.org/wordprocessingml/2006/main' declare namespace r='http://schemas.openxmlformats.org/officeDocument/2006/relationships' declare namespace a='http://schemas.openxmlformats.org/drawingml/2006/main' declare namespace pic='http://schemas.openxmlformats.org/drawingml/2006/picture' declare namespace wp='http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing' declare namespace wp14='http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing' declare namespace w14='http://schemas.microsoft.com/office/word/2010/wordml' declare namespace w15='http://schemas.microsoft.com/office/word/2012/wordml' declare namespace w16='http://schemas.microsoft.com/office/word/2018/wordml' declare namespace w16cid='http://schemas.microsoft.com/office/word/2016/wordml/cid' declare namespace v='urn:schemas-microsoft-com:vml' declare namespace o='urn:schemas-microsoft-com:office:office' declare namespace m='http://schemas.openxmlformats.org/officeDocument/2006/math' declare namespace mc='http://schemas.openxmlformats.org/markup-compatibility/2006' declare namespace wpg='http://schemas.microsoft.com/office/word/2010/wordprocessingGroup' declare namespace wpi='http://schemas.microsoft.com/office/word/2010/wordprocessingInk' declare namespace wps='http://schemas.microsoft.com/office/word/2010/wordprocessingShape' declare namespace c='http://schemas.openxmlformats.org/drawingml/2006/chart' declare namespace cx='http://schemas.microsoft.com/office/drawing/2014/chart' declare namespace dgm='http://schemas.openxmlformats.org/drawingml/2006/diagram' declare namespace lc='http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas' declare namespace svg='http://schemas.microsoft.com/office/drawing/2016/SVG/main' declare namespace aink='http://schemas.microsoft.com/office/drawing/2016/ink' declare namespace am3d='http://schemas.microsoft.com/office/drawing/2017/model3D' declare namespace wne='http://schemas.microsoft.com/office/word/2006/wordml' ";
- }
-}
diff --git a/src/main/java/com/example/exam/exam/service/wpsword/WpsWordReqDto.java b/src/main/java/com/example/exam/exam/service/wpsword/WpsWordReqDto.java
deleted file mode 100644
index 1d4fcd6..0000000
--- a/src/main/java/com/example/exam/exam/service/wpsword/WpsWordReqDto.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.example.exam.exam.service.wpsword;
-
-import lombok.Data;
-
-/**
- * @author REN
- */
-@Data
-public class WpsWordReqDto {
-
-// @Schema(description = "主中文名称")
- private String name;
-
-// @Schema(description = "主英文名称")
- private String englishName;
-
-// @Schema(description = "文件路径")
- private String filePath;
-
-// @Schema(description = "内外参数(0:内参数;1:外参数)")
- private String type;
-
-// @Schema(description = "归属(0:段落;1:页眉页脚;2:图形)")
- private String belongTo;
-
-// @Schema(description = "参数类型(0:值;1:判断)")
- private String isboo;
-
-// @Schema(description = "子标签")
- private String function;
-
- private String unit;
-
- private String isExam;
-
-}
diff --git a/src/main/java/com/example/exam/exam/service/wpsword/WpsWordUtils.java b/src/main/java/com/example/exam/exam/service/wpsword/WpsWordUtils.java
deleted file mode 100644
index 2145cf2..0000000
--- a/src/main/java/com/example/exam/exam/service/wpsword/WpsWordUtils.java
+++ /dev/null
@@ -1,761 +0,0 @@
-package com.example.exam.exam.service.wpsword;
-import org.apache.commons.io.IOUtils;
-import org.apache.poi.openxml4j.opc.OPCPackage;
-import org.apache.poi.openxml4j.opc.PackagePart;
-import org.apache.poi.xwpf.usermodel.XWPFDocument;
-import org.apache.poi.xwpf.usermodel.XWPFFooter;
-import org.apache.poi.xwpf.usermodel.XWPFHeader;
-import org.apache.poi.xwpf.usermodel.XWPFParagraph;
-import org.apache.xmlbeans.XmlCursor;
-import org.apache.xmlbeans.XmlObject;
-
-import javax.xml.namespace.QName;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * @author REN
- */
-public class WpsWordUtils {
- public static String getStringRandom() {
- String characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
- Random random = new Random();
- StringBuilder sb = new StringBuilder();
-
- // 生成指定长度的随机字符字符串
- for (int i = 0; i < 10; i++) {
- int randomIndex = random.nextInt(characters.length());
- // 随机字符
- sb.append(characters.charAt(randomIndex));
- }
- return sb.toString();
- }
-
- public static List getWordInfo(List wpsWordReqDtos) throws Exception {
- String filePath = wpsWordReqDtos.get(0).getFilePath();
- // 创建返回数组
- List judgementList = new ArrayList<>();
- // 创建文件路径数组
- List