【修改】 原始方法进行修改(之后可能不会使用)

This commit is contained in:
MSI\letre
2025-07-07 16:04:04 +08:00
parent 1268f7eb57
commit c6de200a83
3 changed files with 18 additions and 7 deletions

View File

@@ -356,13 +356,7 @@ public class WpsExcelUtils {
wpsPptxJudgementDto.setScoreRate("1");
xlsxInfos.add(wpsPptxJudgementDto);
}
// TODO
if (index == "1") {
List<WpsPptxJudgementDto> randomItems = getRandomItems(xlsxInfos, 50);
return randomItems;
} else {
return xlsxInfos;
}
return xlsxInfos;
}
// 扁平化多维列表

View File

@@ -86,6 +86,9 @@ public class JudgementWpsPPT {
String value = element == null ? "" : "" ;
judgementList = setData(judgementList, chineseName + value, englishName + value);
} else {
if (element == null) {
return null;
}
String[] valuesArr = values.split("#");
String oneValue = "";
for (String yivalue : valuesArr) {
@@ -135,6 +138,9 @@ public class JudgementWpsPPT {
String value = element == null ? "" : "" ;
judgementList = setData(judgementList, chineseName + value, englishName + value);
} else {
if (element == null) {
return null;
}
String[] valuesArr = values.split("#");
String oneValue = "";
for (String yivalue : valuesArr) {

View File

@@ -804,6 +804,7 @@ public class WpsWordUtils {
if (wpTextXml.toNextSelection()) {
String secondIdWp = getStringRandom();
String text = wpTextXml.getTextValue();
text = shorten(text);
setWordInfo("段落" + wpIndex + ":" + text, "(//w:p)[" + wpIndex + "]", "w:pPr", filePath, secondIdWp, firstIdWp, wordInfoReqVos);
// 使用 。 判断句子
String[] texts = text.split("");
@@ -811,6 +812,7 @@ public class WpsWordUtils {
for (String s : texts) {
String thirdIdWp = getStringRandom();
textsIndex ++;
s = shorten(s);
setWordInfo("句子" + textsIndex + ":" + s, "(//w:p)[" + wpIndex + "]", "w:r", filePath, thirdIdWp, secondIdWp, wordInfoReqVos);
}
}
@@ -1265,4 +1267,13 @@ public class WpsWordUtils {
}
return fieldNames;
}
public static String shorten(String input) {
if (input == null) return null;
if (input.length() <= 14) {
return input;
}
String prefix = input.substring(0, 2);
String suffix = input.substring(input.length() - 2);
return prefix + "..." + suffix;
}
}