【修改】 原始方法进行修改(之后可能不会使用)
This commit is contained in:
@@ -356,14 +356,8 @@ public class WpsExcelUtils {
|
|||||||
wpsPptxJudgementDto.setScoreRate("1");
|
wpsPptxJudgementDto.setScoreRate("1");
|
||||||
xlsxInfos.add(wpsPptxJudgementDto);
|
xlsxInfos.add(wpsPptxJudgementDto);
|
||||||
}
|
}
|
||||||
// TODO
|
|
||||||
if (index == "1") {
|
|
||||||
List<WpsPptxJudgementDto> randomItems = getRandomItems(xlsxInfos, 50);
|
|
||||||
return randomItems;
|
|
||||||
} else {
|
|
||||||
return xlsxInfos;
|
return xlsxInfos;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 扁平化多维列表
|
// 扁平化多维列表
|
||||||
public static <T> List<T> getRandomItems(List<T> list, int count) {
|
public static <T> List<T> getRandomItems(List<T> list, int count) {
|
||||||
|
@@ -86,6 +86,9 @@ public class JudgementWpsPPT {
|
|||||||
String value = element == null ? "否" : "是" ;
|
String value = element == null ? "否" : "是" ;
|
||||||
judgementList = setData(judgementList, chineseName + value, englishName + value);
|
judgementList = setData(judgementList, chineseName + value, englishName + value);
|
||||||
} else {
|
} else {
|
||||||
|
if (element == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
String[] valuesArr = values.split("#");
|
String[] valuesArr = values.split("#");
|
||||||
String oneValue = "";
|
String oneValue = "";
|
||||||
for (String yivalue : valuesArr) {
|
for (String yivalue : valuesArr) {
|
||||||
@@ -135,6 +138,9 @@ public class JudgementWpsPPT {
|
|||||||
String value = element == null ? "否" : "是" ;
|
String value = element == null ? "否" : "是" ;
|
||||||
judgementList = setData(judgementList, chineseName + value, englishName + value);
|
judgementList = setData(judgementList, chineseName + value, englishName + value);
|
||||||
} else {
|
} else {
|
||||||
|
if (element == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
String[] valuesArr = values.split("#");
|
String[] valuesArr = values.split("#");
|
||||||
String oneValue = "";
|
String oneValue = "";
|
||||||
for (String yivalue : valuesArr) {
|
for (String yivalue : valuesArr) {
|
||||||
|
@@ -804,6 +804,7 @@ public class WpsWordUtils {
|
|||||||
if (wpTextXml.toNextSelection()) {
|
if (wpTextXml.toNextSelection()) {
|
||||||
String secondIdWp = getStringRandom();
|
String secondIdWp = getStringRandom();
|
||||||
String text = wpTextXml.getTextValue();
|
String text = wpTextXml.getTextValue();
|
||||||
|
text = shorten(text);
|
||||||
setWordInfo("段落" + wpIndex + ":" + text, "(//w:p)[" + wpIndex + "]", "w:pPr", filePath, secondIdWp, firstIdWp, wordInfoReqVos);
|
setWordInfo("段落" + wpIndex + ":" + text, "(//w:p)[" + wpIndex + "]", "w:pPr", filePath, secondIdWp, firstIdWp, wordInfoReqVos);
|
||||||
// 使用 。 判断句子
|
// 使用 。 判断句子
|
||||||
String[] texts = text.split("。");
|
String[] texts = text.split("。");
|
||||||
@@ -811,6 +812,7 @@ public class WpsWordUtils {
|
|||||||
for (String s : texts) {
|
for (String s : texts) {
|
||||||
String thirdIdWp = getStringRandom();
|
String thirdIdWp = getStringRandom();
|
||||||
textsIndex ++;
|
textsIndex ++;
|
||||||
|
s = shorten(s);
|
||||||
setWordInfo("句子" + textsIndex + ":" + s, "(//w:p)[" + wpIndex + "]", "w:r", filePath, thirdIdWp, secondIdWp, wordInfoReqVos);
|
setWordInfo("句子" + textsIndex + ":" + s, "(//w:p)[" + wpIndex + "]", "w:r", filePath, thirdIdWp, secondIdWp, wordInfoReqVos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1265,4 +1267,13 @@ public class WpsWordUtils {
|
|||||||
}
|
}
|
||||||
return fieldNames;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user