【修改】 更新word和pptx考点新增和判分标准
This commit is contained in:
@@ -12,6 +12,7 @@ import pc.exam.pp.module.judgement.controller.admin.Wps.dto.WpsWordReqDto;
|
||||
import pc.exam.pp.module.judgement.service.wps_excel.JudgementWpsExcelService;
|
||||
import pc.exam.pp.module.judgement.service.wps_pptx.JudgementWpsPptxService;
|
||||
import pc.exam.pp.module.judgement.service.wps_word.JudgementWpsWordService;
|
||||
import pc.exam.pp.module.judgement.utils.wps_excel.vo.ExcelInfoReqVo;
|
||||
import pc.exam.pp.module.judgement.utils.wps_excel.vo.XlsxVO;
|
||||
import pc.exam.pp.module.judgement.utils.wps_excel.vo.xlsx_all.XlsxAllDataReqVo;
|
||||
import pc.exam.pp.module.judgement.utils.wps_excel.vo.xlsx_drawing.XlsxInfoVo;
|
||||
@@ -76,13 +77,15 @@ public class WpsController {
|
||||
public CommonResult<List<PptxInfoReqVo>> runWpsPptx(String path) throws Exception {
|
||||
return CommonResult.success(judgementWpsPptxService.programmingWpsPptx(path));
|
||||
}
|
||||
// /**
|
||||
// * wps xlsx
|
||||
// * @return 判分
|
||||
// */
|
||||
// @GetMapping("/run_wps_xlsx")
|
||||
// public CommonResult<List<XlsxInfoVo>> run_wps_xlsx(String path) throws Exception {
|
||||
// return CommonResult.success(judgementWpsExcelService.programmingWpsExcel(path));
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* wps xlsx
|
||||
* @return 判分
|
||||
*/
|
||||
@GetMapping("/runWpsXlsx")
|
||||
public CommonResult<List<ExcelInfoReqVo>> runWpsXlsx(String path) throws Exception {
|
||||
return CommonResult.success(judgementWpsExcelService.programmingWpsExcel(path));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,4 +32,8 @@ public class WpsWordReqDto {
|
||||
@Schema(description = "子标签")
|
||||
private String function;
|
||||
|
||||
private String unit;
|
||||
|
||||
private String isExam;
|
||||
|
||||
}
|
||||
|
||||
@@ -21,4 +21,6 @@ public class PptxListReqVO {
|
||||
private String nodeFunction;
|
||||
private Integer isboo;
|
||||
private Integer titleType;
|
||||
private String unit;
|
||||
private String page;
|
||||
}
|
||||
|
||||
@@ -39,4 +39,6 @@ public class PptxRespVO {
|
||||
private Integer belongTo;
|
||||
private Integer isboo;
|
||||
private Integer titleType;
|
||||
private String unit;
|
||||
private String page;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ public class PptxSaveReqVO {
|
||||
private Integer belongTo;
|
||||
private Integer isboo;
|
||||
private Integer titleType;
|
||||
private String unit;
|
||||
private String page;
|
||||
|
||||
@Schema(description = "父节点 ID", example = "1024")
|
||||
private Long parentId;
|
||||
|
||||
@@ -26,4 +26,6 @@ public class PptxSimpleRespVO {
|
||||
private Integer belongTo;
|
||||
private Integer isboo;
|
||||
private Integer titleType;
|
||||
private String unit;
|
||||
private String page;
|
||||
}
|
||||
|
||||
@@ -21,4 +21,6 @@ public class WordListReqVO {
|
||||
private Integer isboo;
|
||||
private Integer belongTo;
|
||||
private Integer titleType;
|
||||
private String unit;
|
||||
private String page;
|
||||
}
|
||||
|
||||
@@ -39,4 +39,6 @@ public class WordRespVO {
|
||||
private Integer belongTo;
|
||||
private Integer isboo;
|
||||
private Integer titleType;
|
||||
private String unit;
|
||||
private String page;
|
||||
}
|
||||
|
||||
@@ -43,5 +43,7 @@ public class WordSaveReqVO {
|
||||
private Integer status;
|
||||
private Integer isboo;
|
||||
private Integer titleType;
|
||||
private String unit;
|
||||
private String page;
|
||||
|
||||
}
|
||||
|
||||
@@ -26,4 +26,6 @@ public class WordSimpleRespVO {
|
||||
private Integer belongTo;
|
||||
private Integer isboo;
|
||||
private Integer titleType;
|
||||
private String unit;
|
||||
private String page;
|
||||
}
|
||||
|
||||
@@ -57,11 +57,11 @@ public class AutoToolsController {
|
||||
public CommonResult<BigDecimal> get(StuPaperReqVo stuPaperReqVo) throws Exception {
|
||||
return autoToolsService.judgementScore(stuPaperReqVo.getStuId(),stuPaperReqVo.getPaperId());
|
||||
}
|
||||
// @GetMapping("/getTest")
|
||||
// public double gets(StuPaperReqVo stuPaperReqVo) throws Exception {
|
||||
// ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(stuPaperReqVo.getPaperId());
|
||||
// return judgementWpsWordService.judgementWpsWord(15.0, "D:\\", "D:\\stu\\wps_word\\9f7d8f5d7c68cc2bfd03a23c19045efe7ba13a4bebeb833abece146908bcd0c6.docx", examQuestion);
|
||||
// }
|
||||
@GetMapping("/getTest")
|
||||
public double gets(StuPaperReqVo stuPaperReqVo) throws Exception {
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(stuPaperReqVo.getPaperId());
|
||||
return judgementWpsWordService.judgementWpsWord(15.0, "D:\\", "D:\\stu\\wps_word\\1\\47effcb38c696564bef41e3927ff1f5535e068b580c6726f13296ae3230f4271.docx", examQuestion);
|
||||
}
|
||||
// @GetMapping("/getTests")
|
||||
// public double getss(StuPaperReqVo stuPaperReqVo) throws Exception {
|
||||
// ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(stuPaperReqVo.getPaperId());
|
||||
@@ -72,11 +72,11 @@ public class AutoToolsController {
|
||||
// ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(stuPaperReqVo.getPaperId());
|
||||
// return judgementWpsExcelService.judgementWpsXlsx(15.0, "D:\\", "D:\\文档.xlsx", examQuestion);
|
||||
// }
|
||||
@GetMapping("/getTest")
|
||||
public double gets(StuPaperReqVo stuPaperReqVo) throws Exception {
|
||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(stuPaperReqVo.getPaperId());
|
||||
return judgementService.ProgrammingC(15.0, "D:\\", "C语言编程题.c", examQuestion);
|
||||
}
|
||||
// @GetMapping("/getTest")
|
||||
// public double gets(StuPaperReqVo stuPaperReqVo) throws Exception {
|
||||
// ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(stuPaperReqVo.getPaperId());
|
||||
// return judgementService.ProgrammingC(15.0, "D:\\", "C语言编程题.c", examQuestion);
|
||||
// }
|
||||
@GetMapping("/getStuScoreInfo")
|
||||
@Operation(summary = "通过学生ID、试卷ID获取")
|
||||
public CommonResult<StuPaperScoreInfoVo> getStuScore(StuPaperReqVo stuPaperReqVo){
|
||||
|
||||
@@ -63,6 +63,8 @@ public class WpsPptxLinkDO extends TenantBaseDO {
|
||||
private String belongTo;
|
||||
private Integer isboo;
|
||||
private Integer titleType;
|
||||
private String unit;
|
||||
private String page;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
|
||||
@@ -63,6 +63,8 @@ public class WpsWordLinkDO extends TenantBaseDO {
|
||||
private Integer belongTo;
|
||||
private Integer isboo;
|
||||
private Integer titleType;
|
||||
private String unit;
|
||||
private String page;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<WpsWordLinkDO> children = new ArrayList<>();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package pc.exam.pp.module.judgement.dal.mysql.wpspptx;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import pc.exam.pp.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import pc.exam.pp.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
@@ -25,7 +26,9 @@ public interface WpsPptxLinkMapper extends BaseMapperX<WpsPptxLinkDO> {
|
||||
return selectOne(WpsPptxLinkDO::getParentId, parentId, WpsPptxLinkDO::getName, name);
|
||||
}
|
||||
default WpsPptxLinkDO selectByNodeFunction(String nodeFunction) {
|
||||
return selectOne(WpsPptxLinkDO::getNodeFunction, nodeFunction);
|
||||
LambdaQueryWrapper<WpsPptxLinkDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.like(WpsPptxLinkDO::getNodeFunction, nodeFunction);
|
||||
return selectOne(wrapper);
|
||||
}
|
||||
|
||||
default List<WpsPptxLinkDO> selectInfoList(Long id) {
|
||||
|
||||
@@ -64,13 +64,13 @@ public class JudgementWpsPptxServiceImpl implements JudgementWpsPptxService {
|
||||
// 1、获取文件临时下载路径
|
||||
ConfigDO config = configService.getConfigByKey("file_down_wps_pptx_path");
|
||||
AdminUserDO user = userService.getUser(getLoginUserId());
|
||||
Path paths = Paths.get(config.getValue() + "\\" + user.getId());
|
||||
if (Files.exists(paths)) {
|
||||
pathName = config.getValue() + "\\" + user.getId() + "\\" + strPaht[strPaht.length - 1];
|
||||
} else {
|
||||
// Path paths = Paths.get(config.getValue() + "\\" + user.getId());
|
||||
// if (Files.exists(paths)) {
|
||||
// pathName = config.getValue() + "\\" + user.getId() + "\\" + strPaht[strPaht.length - 1];
|
||||
// } else {
|
||||
// 2、下载文件并返回文件完整路径
|
||||
pathName = autoToolsService.downloadStudentFile(path, config.getValue() + "\\" + user.getId());
|
||||
}
|
||||
// }
|
||||
// 4、pptx文件读取并返回考点及说明信息
|
||||
// List<PptxVO> margins = WpsPptxUtils.wpsPptx(pathName, paragraphList);
|
||||
List<PptxInfoReqVo> pptxInfoList = WpsPptxUtils.wpsPptxInfo(pathName);
|
||||
|
||||
@@ -52,13 +52,13 @@ public class JudgementWpsWordServiceImpl implements JudgementWpsWordService {
|
||||
// 1、获取文件临时下载路径
|
||||
ConfigDO config = configService.getConfigByKey("file_down_wps_word_path");
|
||||
AdminUserDO user = userService.getUser(getLoginUserId());
|
||||
Path paths = Paths.get(config.getValue() + "\\" + user.getId());
|
||||
if (Files.exists(paths)) {
|
||||
pathName = config.getValue() + "\\" + user.getId() + "\\" + strPaht[strPaht.length - 1];
|
||||
} else {
|
||||
// Path paths = Paths.get(config.getValue() + "\\" + user.getId());
|
||||
// if (Files.exists(paths)) {
|
||||
// pathName = config.getValue() + "\\" + user.getId() + "\\" + strPaht[strPaht.length - 1];
|
||||
// } else {
|
||||
// 2、下载文件并返回文件完整路径
|
||||
pathName = autoToolsService.downloadStudentFile(path, config.getValue() + "\\" + user.getId());
|
||||
}
|
||||
// }
|
||||
// 4、docx文件读取并返回考点及说明信息
|
||||
List<WordInfoReqVo> margins = WpsWordUtils.wpWord(pathName);
|
||||
// 5、已经读取完得考点删除源文件
|
||||
@@ -101,14 +101,16 @@ public class JudgementWpsWordServiceImpl implements JudgementWpsWordService {
|
||||
// 只取三层结构
|
||||
List<WpsWordReqDto> wordReqDto = new ArrayList<>();
|
||||
WpsWordReqDto wpsWordReqDto = new WpsWordReqDto();
|
||||
wpsWordReqDto.setName(chineseName[0]);
|
||||
wpsWordReqDto.setEnglishName(wordInfos[0]);
|
||||
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);
|
||||
List<WpsWordJudgementDto> judgementDtos = WpsWordUtils.getWordInfo(wordReqDto);
|
||||
boolean flag = false;
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package pc.exam.pp.module.judgement.utils;
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -7,10 +7,15 @@ import org.apache.xmlbeans.XmlException;
|
||||
import org.apache.xmlbeans.XmlObject;
|
||||
import pc.exam.pp.module.judgement.controller.admin.Wps.dto.WpsPptxJudgementDto;
|
||||
import pc.exam.pp.module.judgement.controller.admin.Wps.dto.WpsWordJudgementDto;
|
||||
import pc.exam.pp.module.judgement.controller.admin.Wps.dto.WpsWordReqDto;
|
||||
import pc.exam.pp.module.judgement.dal.dataobject.wpspptx.WpsPptxLinkDO;
|
||||
import pc.exam.pp.module.judgement.utils.TwipConverter;
|
||||
import pc.exam.pp.module.judgement.utils.tree.TreeUtils;
|
||||
import pc.exam.pp.module.judgement.utils.wps_excel.vo.XlsxCharVO;
|
||||
import pc.exam.pp.module.judgement.utils.wps_pptx.vo.*;
|
||||
import pc.exam.pp.module.judgement.utils.wps_word.ColorNameFinder;
|
||||
import pc.exam.pp.module.judgement.utils.wps_word.PageSizeDetector;
|
||||
import pc.exam.pp.module.judgement.utils.wps_word.ShadowDirectionUtils;
|
||||
import pc.exam.pp.module.judgement.utils.wps_word.vo.WordInfoReqVo;
|
||||
import pc.exam.pp.module.judgement.utils.zipfile.ZipXmlUtils;
|
||||
|
||||
@@ -79,11 +84,109 @@ public class WpsPptxUtils {
|
||||
PptxSlidesVo pptxSlidesVo = result.get();
|
||||
XmlCursor slideCursor = pptxSlidesVo.getXmlCursor();
|
||||
String namespace = WpsPptxNameSpaces.getNameSpace(slideCursor.xmlText());
|
||||
// 查询
|
||||
System.out.println(slideCursor.xmlText());
|
||||
slideCursor.selectPath(namespace + pptxInfoPointsVo.getFunction().replace("-", ""));
|
||||
|
||||
if (slideCursor.toNextSelection()) {
|
||||
if (pptxInfoPointsVo.getName().contains("动画")) {
|
||||
String[] functions = pptxInfoPointsVo.getFunction().split("#");
|
||||
XmlCursor dongCursor = slideCursor;
|
||||
XmlCursor cTnCursor = slideCursor;
|
||||
dongCursor.selectPath(namespace + functions[0]);
|
||||
if (dongCursor.toNextSelection()) {
|
||||
String number = dongCursor.getTextValue();
|
||||
cTnCursor.selectPath(namespace + "//p:cTn[@id='"+number+"']");
|
||||
if (cTnCursor.toNextSelection()) {
|
||||
System.out.println(cTnCursor.xmlText());
|
||||
if (pptxInfoPointsVo.getName().contains("效果")) {
|
||||
cTnCursor.selectPath(namespace + "//p:animEffect");
|
||||
if (cTnCursor.toNextSelection()) {
|
||||
String value = "";
|
||||
String transition = cTnCursor.getAttributeText(new QName("transition"));
|
||||
String filter = cTnCursor.getAttributeText(new QName("filter"));
|
||||
WpsPptxJudgementDto judgementDto = new WpsPptxJudgementDto();
|
||||
if (transition.contains("in")) {
|
||||
value += "进入效果";
|
||||
}
|
||||
if (filter.contains("strips")) {
|
||||
value += "->阶梯状";
|
||||
}
|
||||
judgementDto.setContentIn(getStringName(pptxInfoPointsVo.getEnglishName()) + pptxInfoPointsVo.getName() + value);
|
||||
judgementDto.setContent(pptxInfoPointsVo.getEnglishName()+"?"+pptxInfoPointsVo.getFunction()+"?"+ value);
|
||||
judgementDto.setImage(pptxInfoPointsVo.getType()+"-"+pptxInfoPointsVo.getBelongTo()+"-"+pptxInfoPointsVo.getIsboo()+"-"+pptxInfoPointsVo.getUnit());
|
||||
judgementDto.setScoreRate("1");
|
||||
judgementList.add(judgementDto);
|
||||
}
|
||||
}
|
||||
if (pptxInfoPointsVo.getName().contains("方向")) {
|
||||
cTnCursor.selectPath(namespace + "//p:animEffect");
|
||||
if (cTnCursor.toNextSelection()) {
|
||||
String value = "";
|
||||
String filter = cTnCursor.getAttributeText(new QName("filter"));
|
||||
WpsPptxJudgementDto judgementDto = new WpsPptxJudgementDto();
|
||||
if (filter.contains("downRight")) {
|
||||
value += "右下";
|
||||
}
|
||||
judgementDto.setContentIn(getStringName(pptxInfoPointsVo.getEnglishName()) + pptxInfoPointsVo.getName() + value);
|
||||
judgementDto.setContent(pptxInfoPointsVo.getEnglishName()+"?"+pptxInfoPointsVo.getFunction()+"?"+ value);
|
||||
judgementDto.setImage(pptxInfoPointsVo.getType()+"-"+pptxInfoPointsVo.getBelongTo()+"-"+pptxInfoPointsVo.getIsboo()+"-"+pptxInfoPointsVo.getUnit());
|
||||
judgementDto.setScoreRate("1");
|
||||
judgementList.add(judgementDto);
|
||||
}
|
||||
}
|
||||
if (pptxInfoPointsVo.getName().contains("触发方式")) {
|
||||
cTnCursor.selectPath(namespace + "//p:stCondLst/p:cond");
|
||||
if (cTnCursor.toNextSelection()) {
|
||||
String value = "";
|
||||
String evt = cTnCursor.getAttributeText(new QName("evt"));
|
||||
if (evt == null) {
|
||||
value = "上一动画之后";
|
||||
} else if (evt.contains("onClick")) {
|
||||
value = "点击触发";
|
||||
} else if (evt.contains("onBegin")) {
|
||||
value = "与上一动画同时触发";
|
||||
} else if (evt.contains("onEnd")) {
|
||||
value = "上一个动画播放完再触发";
|
||||
}
|
||||
WpsPptxJudgementDto judgementDto = new WpsPptxJudgementDto();
|
||||
judgementDto.setContentIn(getStringName(pptxInfoPointsVo.getEnglishName()) + pptxInfoPointsVo.getName() + value);
|
||||
judgementDto.setContent(pptxInfoPointsVo.getEnglishName()+"?"+pptxInfoPointsVo.getFunction()+"?"+ value);
|
||||
judgementDto.setImage(pptxInfoPointsVo.getType()+"-"+pptxInfoPointsVo.getBelongTo()+"-"+pptxInfoPointsVo.getIsboo()+"-"+pptxInfoPointsVo.getUnit());
|
||||
judgementDto.setScoreRate("1");
|
||||
judgementList.add(judgementDto);
|
||||
}
|
||||
}
|
||||
if (pptxInfoPointsVo.getName().contains("持续时间")) {
|
||||
cTnCursor.selectPath(namespace + "//p:animEffect/p:cBhvr/p:cTn");
|
||||
if (cTnCursor.toNextSelection()) {
|
||||
String value = "";
|
||||
String dur = cTnCursor.getAttributeText(new QName("dur"));
|
||||
if (dur == null) {
|
||||
value = "0秒";
|
||||
} else {
|
||||
value = Integer.parseInt(dur) / 1000 + "秒";
|
||||
}
|
||||
WpsPptxJudgementDto judgementDto = new WpsPptxJudgementDto();
|
||||
judgementDto.setContentIn(getStringName(pptxInfoPointsVo.getEnglishName()) + pptxInfoPointsVo.getName() + value);
|
||||
judgementDto.setContent(pptxInfoPointsVo.getEnglishName()+"?"+pptxInfoPointsVo.getFunction()+"?"+ value);
|
||||
judgementDto.setImage(pptxInfoPointsVo.getType()+"-"+pptxInfoPointsVo.getBelongTo()+"-"+pptxInfoPointsVo.getIsboo()+"-"+pptxInfoPointsVo.getUnit());
|
||||
judgementDto.setScoreRate("1");
|
||||
judgementList.add(judgementDto);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (pptxInfoPointsVo.getUnit().contains("Filling_method")) {
|
||||
// 查询
|
||||
slideCursor.selectPath(namespace + pptxInfoPointsVo.getFunction().replace("-", ""));
|
||||
// 判断填充方式的
|
||||
if (slideCursor.toNextSelection()) {
|
||||
String value = slideCursor.xmlText();
|
||||
value = getValueType(pptxInfoPointsVo, value);
|
||||
WpsPptxJudgementDto judgementDto = new WpsPptxJudgementDto();
|
||||
judgementDto.setContentIn(getStringName(pptxInfoPointsVo.getEnglishName()) + pptxInfoPointsVo.getName() + value);
|
||||
judgementDto.setContent(pptxInfoPointsVo.getEnglishName()+"?"+pptxInfoPointsVo.getFunction()+"?"+ value);
|
||||
judgementDto.setImage(pptxInfoPointsVo.getType()+"-"+pptxInfoPointsVo.getBelongTo()+"-"+pptxInfoPointsVo.getIsboo()+"-"+pptxInfoPointsVo.getUnit());
|
||||
judgementDto.setScoreRate("1");
|
||||
judgementList.add(judgementDto);
|
||||
}
|
||||
} else if (slideCursor.toNextSelection()) {
|
||||
WpsPptxJudgementDto judgementDto = new WpsPptxJudgementDto();
|
||||
// 判断是值还是类型
|
||||
if ("1".equals(pptxInfoPointsVo.getIsboo())) {
|
||||
@@ -91,11 +194,12 @@ public class WpsPptxUtils {
|
||||
judgementDto.setContent(pptxInfoPointsVo.getEnglishName()+"?"+pptxInfoPointsVo.getFunction()+"?"+"true");
|
||||
} else {
|
||||
String value = slideCursor.getTextValue();
|
||||
value = getValueType(pptxInfoPointsVo, value);
|
||||
judgementDto.setContentIn(getStringName(pptxInfoPointsVo.getEnglishName()) + pptxInfoPointsVo.getName()+value);
|
||||
judgementDto.setContent(pptxInfoPointsVo.getEnglishName()+"?"+pptxInfoPointsVo.getFunction()+"?"+value);
|
||||
|
||||
}
|
||||
judgementDto.setImage(pptxInfoPointsVo.getType()+"-"+pptxInfoPointsVo.getBelongTo()+"-"+pptxInfoPointsVo.getIsboo());
|
||||
judgementDto.setImage(pptxInfoPointsVo.getType()+"-"+pptxInfoPointsVo.getBelongTo()+"-"+pptxInfoPointsVo.getIsboo()+"-"+pptxInfoPointsVo.getUnit());
|
||||
judgementDto.setScoreRate("1");
|
||||
judgementList.add(judgementDto);
|
||||
} else {
|
||||
@@ -103,12 +207,65 @@ public class WpsPptxUtils {
|
||||
WpsPptxJudgementDto judgementDto = new WpsPptxJudgementDto();
|
||||
judgementDto.setContentIn(getStringName(pptxInfoPointsVo.getEnglishName()) + pptxInfoPointsVo.getName()+"false");
|
||||
judgementDto.setContent(pptxInfoPointsVo.getEnglishName()+"?"+pptxInfoPointsVo.getFunction()+"?"+"false");
|
||||
judgementDto.setImage(pptxInfoPointsVo.getType()+"-"+pptxInfoPointsVo.getBelongTo()+"-"+pptxInfoPointsVo.getIsboo());
|
||||
judgementDto.setImage(pptxInfoPointsVo.getType()+"-"+pptxInfoPointsVo.getBelongTo()+"-"+pptxInfoPointsVo.getIsboo()+"-"+pptxInfoPointsVo.getUnit());
|
||||
judgementDto.setScoreRate("1");
|
||||
judgementList.add(judgementDto);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("1".equals(pptxInfoPointsVo.getBelongTo())) {
|
||||
Optional<PptxSlidesVo> result = pptxSlidesVos.stream().filter(pptxSlidesVo -> pptxSlidesVo.getSlideName().contains(pptxInfoPointsVo.getEnglishName())).findFirst();
|
||||
PptxSlidesVo pptxSlidesVo = result.get();
|
||||
XmlCursor slideCursor = pptxSlidesVo.getXmlCursor();
|
||||
String namespace = WpsPptxNameSpaces.getNameSpace(slideCursor.xmlText());
|
||||
// 查询
|
||||
if (pptxInfoPointsVo.getUnit().contains("Filling_method")) {
|
||||
// 判断填充方式的
|
||||
slideCursor.selectPath(namespace + pptxInfoPointsVo.getFunction().replace("-", ""));
|
||||
if (slideCursor.toNextSelection()) {
|
||||
String value = slideCursor.xmlText();
|
||||
value = getValueType(pptxInfoPointsVo, value);
|
||||
WpsPptxJudgementDto judgementDto = new WpsPptxJudgementDto();
|
||||
judgementDto.setContentIn(getStringName(pptxInfoPointsVo.getEnglishName()) + pptxInfoPointsVo.getName() + value);
|
||||
judgementDto.setContent(pptxInfoPointsVo.getEnglishName()+"?"+pptxInfoPointsVo.getFunction()+"?"+ value);
|
||||
judgementDto.setImage(pptxInfoPointsVo.getType()+"-"+pptxInfoPointsVo.getBelongTo()+"-"+pptxInfoPointsVo.getIsboo()+"-"+pptxInfoPointsVo.getUnit());
|
||||
judgementDto.setScoreRate("1");
|
||||
judgementList.add(judgementDto);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("2".equals(pptxInfoPointsVo.getBelongTo())) {
|
||||
XmlCursor presentationcursor = null;
|
||||
String namespace = "";
|
||||
Enumeration<? extends ZipEntry> entriess = zipFile.entries();
|
||||
while (entriess.hasMoreElements()) {
|
||||
ZipEntry entry = entriess.nextElement();
|
||||
String entryName = entry.getName();
|
||||
if (entryName.startsWith("ppt/presentation") && entryName.endsWith(".xml")) {
|
||||
String xmlContent = ZipXmlUtils.readZipEntry(zipFile, entryName);
|
||||
XmlObject xmlObject = XmlObject.Factory.parse(xmlContent);
|
||||
presentationcursor = xmlObject.newCursor();
|
||||
namespace = WpsPptxNameSpaces.getNameSpace(presentationcursor.xmlText());
|
||||
}
|
||||
}
|
||||
|
||||
if ("1".equals(pptxInfoPointsVo.getType())) {
|
||||
// 如果是外参数
|
||||
if (pptxInfoPointsVo.getName().contains("幻灯片大小")) {
|
||||
System.out.println(presentationcursor.xmlText());
|
||||
presentationcursor.selectPath(namespace + "//p:presentation/p:sldSz");
|
||||
if (presentationcursor.toNextSelection()) {
|
||||
String value = PageSizeDetector.detectPaperPPTSize(presentationcursor.xmlText());
|
||||
WpsPptxJudgementDto judgementDto = new WpsPptxJudgementDto();
|
||||
judgementDto.setContentIn(getStringName(pptxInfoPointsVo.getEnglishName()) + pptxInfoPointsVo.getName() + value);
|
||||
judgementDto.setContent(pptxInfoPointsVo.getEnglishName()+"?"+pptxInfoPointsVo.getFunction()+"?"+ value);
|
||||
judgementDto.setImage(pptxInfoPointsVo.getType()+"-"+pptxInfoPointsVo.getBelongTo()+"-"+pptxInfoPointsVo.getIsboo()+"-"+pptxInfoPointsVo.getUnit());
|
||||
judgementDto.setScoreRate("1");
|
||||
judgementList.add(judgementDto);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (XmlException e) {
|
||||
@@ -116,6 +273,70 @@ public class WpsPptxUtils {
|
||||
}
|
||||
return judgementList;
|
||||
}
|
||||
public static String getValueType(PptxInfoPointsVo pptxInfoPointsVo, String value) {
|
||||
String values = value;
|
||||
if (pptxInfoPointsVo.getUnit().contains("twiptopt")) {
|
||||
values = TwipConverter.formatDouble(TwipConverter.toPoints(Integer.parseInt(value))) + "磅";
|
||||
}
|
||||
if (pptxInfoPointsVo.getUnit().contains("emustopt")) {
|
||||
values = TwipConverter.formatDouble(TwipConverter.toEmus(Integer.parseInt(value))) + "磅";
|
||||
}
|
||||
if (pptxInfoPointsVo.getUnit().contains("color")) {
|
||||
values = ColorNameFinder.getColorName(value);
|
||||
}
|
||||
if (pptxInfoPointsVo.getUnit().contains("direction")) {
|
||||
// 方向英文转换
|
||||
if ("landscape".equals(value)) {
|
||||
values = "横向";
|
||||
} else if ("portrait".equals(value)) {
|
||||
values = "纵向";
|
||||
} else if ("up".equals(value)) {
|
||||
values = "上对齐";
|
||||
} else if ("down".equals(value)) {
|
||||
values = "下对齐";
|
||||
}
|
||||
}
|
||||
if (value.contains("center")) {
|
||||
values = "居中对齐";
|
||||
}
|
||||
if (pptxInfoPointsVo.getUnit().contains("textdirection")) {
|
||||
// 方向英文转换
|
||||
if ("left".equals(value)) {
|
||||
values = "左对齐";
|
||||
} else if ("center".equals(value)) {
|
||||
values = "居中对齐";
|
||||
} else if ("right".equals(value)) {
|
||||
values = "右对齐";
|
||||
} else if ("both".equals(value)) {
|
||||
values = "两端对齐";
|
||||
}
|
||||
}
|
||||
if (pptxInfoPointsVo.getUnit().contains("halfpt")) {
|
||||
values = String.valueOf (Integer.parseInt(value) / 2);
|
||||
}
|
||||
if (pptxInfoPointsVo.getUnit().contains("baipt")) {
|
||||
values = String.valueOf (Integer.parseInt(value) / 100);
|
||||
}
|
||||
if (pptxInfoPointsVo.getUnit().contains("milli")) {
|
||||
values = String.valueOf (Integer.parseInt(value) / 1000);
|
||||
}
|
||||
if (pptxInfoPointsVo.getUnit().contains("shadowdirection")) {
|
||||
ShadowDirectionUtils.ShadowDirection direction = ShadowDirectionUtils.getShadowDirection(Long.valueOf(value));
|
||||
values = direction.getLabel();
|
||||
}
|
||||
if (pptxInfoPointsVo.getUnit().contains("Filling_method")) {
|
||||
if (value.contains("solidFill")) {
|
||||
values = "纯色填充";
|
||||
} else if (value.contains("gradFill")) {
|
||||
values = "渐变填充";
|
||||
} else if (value.contains("pattFill")) {
|
||||
values = "图案填充";
|
||||
} else if (value.contains("blipFill")) {
|
||||
values = "图片填充";
|
||||
}
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
public static String getStringName(String name) {
|
||||
// 提取字母部分
|
||||
@@ -152,21 +373,35 @@ public class WpsPptxUtils {
|
||||
// 第三层
|
||||
String thirdId = getStringRandom();
|
||||
int indexCnvPr = 1;
|
||||
setPptxInfo("幻灯片设置", "slide"+indexCnvPr, "(//p:sp)-["+indexCnvPr+"]", filePath, thirdId, secondId, pptxInfoReqVos);
|
||||
setPptxInfo("幻灯片设置", "slide"+index, "(//p:bg)["+indexCnvPr+"]", filePath, thirdId, secondId, pptxInfoReqVos);
|
||||
XmlCursor spCursor = slides.getXmlObject().newCursor();
|
||||
spCursor.selectPath("declare namespace p='http://schemas.openxmlformats.org/presentationml/2006/main' .//p:sp");
|
||||
while (spCursor.toNextSelection()) {
|
||||
XmlCursor cNvPrXml = spCursor.newCursor();
|
||||
cNvPrXml.selectPath("declare namespace p='http://schemas.openxmlformats.org/presentationml/2006/main' .//p:cNvPr/@name");
|
||||
if (cNvPrXml.toNextSelection()) {
|
||||
System.out.println(cNvPrXml.xmlText());
|
||||
String name = cNvPrXml.getTextValue();
|
||||
String fourId = getStringRandom();
|
||||
setPptxInfo("形状"+indexCnvPr+"->"+name, "slide"+indexCnvPr, "(//p:sp)["+indexCnvPr+"]", filePath, fourId, secondId, pptxInfoReqVos);
|
||||
setPptxInfo("形状"+indexCnvPr+"->"+name, "slide"+index, "(//p:sp)["+indexCnvPr+"]", filePath, fourId, secondId, pptxInfoReqVos);
|
||||
indexCnvPr += 1;
|
||||
}
|
||||
}
|
||||
XmlCursor picCursor = slides.getXmlObject().newCursor();
|
||||
System.out.println(picCursor.xmlText());
|
||||
picCursor.selectPath("declare namespace p='http://schemas.openxmlformats.org/presentationml/2006/main' .//p:pic");
|
||||
int indexCnvPrPic = 1;
|
||||
while (picCursor.toNextSelection()) {
|
||||
String fourId = getStringRandom();
|
||||
setPptxInfo("图像"+indexCnvPrPic+"->图像", "slide"+index, "(//p:pic)["+indexCnvPrPic+"]", filePath, fourId, secondId, pptxInfoReqVos);
|
||||
indexCnvPrPic += 1;
|
||||
}
|
||||
}
|
||||
// 设置
|
||||
String firstIds = getStringRandom();
|
||||
setPptxInfo("设置", "p:presentation", "p:presentation", filePath, firstIds, "0", pptxInfoReqVos);
|
||||
String secondIds = getStringRandom();
|
||||
setPptxInfo("幻灯片设置", "p:presentation", "p:presentation", filePath, secondIds, firstIds, pptxInfoReqVos);
|
||||
|
||||
// 母版
|
||||
// String dFirstId = getStringRandom();
|
||||
// setPptxInfo("母版", "p:sld", "p:sld", filePath, dFirstId, "0", pptxInfoReqVos);
|
||||
|
||||
@@ -19,4 +19,6 @@ public class PptxInfoPointsVo {
|
||||
|
||||
private String type;
|
||||
|
||||
private String unit;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package pc.exam.pp.module.judgement.utils.wps_word;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ColorNameFinder {
|
||||
// 颜色代码到名称的映射
|
||||
private static final Map<String, String> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package pc.exam.pp.module.judgement.utils.wps_word;
|
||||
|
||||
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 * 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);
|
||||
}
|
||||
|
||||
// 判断两个 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 = "<w:pgSz w:w=\"16838\" w:h=\"11906\" w:orient=\"landscape\"/>";
|
||||
System.out.println(detectPaperSize(xml));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package pc.exam.pp.module.judgement.utils.wps_word;
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import pc.exam.pp.module.judgement.controller.admin.Wps.dto.WpsWordChineseFuncti
|
||||
import pc.exam.pp.module.judgement.controller.admin.Wps.dto.WpsWordJudgementDto;
|
||||
import pc.exam.pp.module.judgement.controller.admin.Wps.dto.WpsWordReqDto;
|
||||
import pc.exam.pp.module.judgement.dal.dataobject.wpsword.WpsWordLinkDO;
|
||||
import pc.exam.pp.module.judgement.utils.TwipConverter;
|
||||
import pc.exam.pp.module.judgement.utils.wps_word.vo.*;
|
||||
import pc.exam.pp.module.judgement.utils.zipfile.ZipXmlUtils;
|
||||
|
||||
@@ -73,43 +74,114 @@ public class WpsWordUtils {
|
||||
// 开始查询标签
|
||||
// 1、段落
|
||||
if ("0".equals(wpsWordReqDto.getBelongTo())) {
|
||||
|
||||
String function = wpsWordReqDto.getFunction();
|
||||
// StringBuilder functionAll = new StringBuilder();
|
||||
String chineseName = wpsWordReqDto.getName();
|
||||
// for (WpsWordChineseFunctionDto functions : wpsWordReqDto.getFunction()) {
|
||||
// function.append(functions.getFunction());
|
||||
// functionAll.append("-").append(functions.getFunction());
|
||||
// chineseName.append(functions.getChineseName()).append("-");
|
||||
// }
|
||||
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
// 1-1、创建新的数据组
|
||||
XmlCursor wpCursor = cursor.newCursor();
|
||||
wpCursor.selectPath(nameSpace + function);
|
||||
if (wpCursor.toNextSelection()) {
|
||||
if ("1".equals(wpsWordReqDto.getIsboo())) {
|
||||
judgement.setContentIn(chineseName + "true");
|
||||
judgement.setContent(function + "-/true");
|
||||
|
||||
} else {
|
||||
String value = wpCursor.getTextValue();
|
||||
judgement.setContentIn(chineseName + value);
|
||||
judgement.setContent(function + "-/" + value);
|
||||
if (wpsWordReqDto.getFunction().contains("w:cols")) {
|
||||
XmlCursor wColsCursor = cursor.newCursor();
|
||||
XmlCursor wColsCursors = null;
|
||||
// 如果是分栏需要单独进行查询
|
||||
// 需要查找查询第几个段落
|
||||
String number = wpsWordReqDto.getFunction().split("]")[0];
|
||||
number = number.split("\\[")[1];
|
||||
boolean flag = true;
|
||||
int numbers = Integer.parseInt(number);
|
||||
while (flag) {
|
||||
numbers += 1;
|
||||
// 向下查询是否存在样式段落
|
||||
String nameSpaces = nameSpace + "(//w:p)["+numbers+"]";
|
||||
wColsCursor.selectPath(nameSpaces);
|
||||
if (wColsCursor.toNextSelection()) {
|
||||
if (wColsCursor.xmlText().contains("w:cols")) {
|
||||
System.out.println(wColsCursor.xmlText());
|
||||
wColsCursors = wColsCursor.newCursor();
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
judgement.setScoreRate("1");
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo());
|
||||
// 查询指定值,返回固定的文本
|
||||
judgementList.add(judgement);
|
||||
} else {
|
||||
// 参数类型(0:值;1:判断)
|
||||
if ("1".equals(wpsWordReqDto.getIsboo())) {
|
||||
judgement.setContentIn(chineseName + "false");
|
||||
judgement.setContent(function + "-/false");
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo());
|
||||
String nameSpaceCols = nameSpace + "." + wpsWordReqDto.getFunction().split("]")[1];
|
||||
System.out.println(wColsCursors.xmlText());
|
||||
wColsCursors.selectPath(nameSpaceCols);
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
if (wColsCursors.toNextSelection()) {
|
||||
String value = wColsCursors.getTextValue();
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value);
|
||||
judgement.setScoreRate("1");
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
// 查询指定值,返回固定的文本
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
} else {
|
||||
String function = wpsWordReqDto.getFunction();
|
||||
String chineseName = wpsWordReqDto.getName();
|
||||
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
// 1-1、创建新的数据组
|
||||
XmlCursor wpCursor = cursor.newCursor();
|
||||
wpCursor.selectPath(nameSpace + function);
|
||||
if (wpCursor.toNextSelection()) {
|
||||
if ("1".equals(wpsWordReqDto.getIsboo())) {
|
||||
judgement.setContentIn(chineseName + "是");
|
||||
judgement.setContent(function + "-/true");
|
||||
} else {
|
||||
String value = wpCursor.getTextValue();
|
||||
value = getValueType(wpsWordReqDto, value);
|
||||
judgement.setContentIn(chineseName + value);
|
||||
judgement.setContent(function + "-/" + value);
|
||||
}
|
||||
judgement.setScoreRate("1");
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
// 查询指定值,返回固定的文本
|
||||
judgementList.add(judgement);
|
||||
} else {
|
||||
// 获取是否在对应的styles.xml里面
|
||||
wpCursor.selectPath(nameSpace + wpsWordReqDto.getEnglishName() + "/w:pPr/w:pStyle/@w:val");
|
||||
if (wpCursor.toNextSelection()) {
|
||||
String value = wpCursor.getTextValue();
|
||||
Enumeration<? extends ZipEntry> entriesStyle = zipFile.entries();
|
||||
while (entriesStyle.hasMoreElements()) {
|
||||
ZipEntry entry = entriesStyle.nextElement();
|
||||
String entryName = entry.getName();
|
||||
if (entryName.startsWith("word/styles") && entryName.endsWith(".xml")) {
|
||||
String xmlContent = ZipXmlUtils.readZipEntry(zipFile, entryName);
|
||||
XmlObject xmlObject = XmlObject.Factory.parse(xmlContent);
|
||||
XmlCursor cursorStyle = xmlObject.newCursor();
|
||||
String nameSpaceStyle = WpsWordNameSpaces.getNameSpace(cursorStyle.xmlText());
|
||||
cursorStyle.selectPath(nameSpaceStyle + ".//w:style[@w:styleId='"+value+"']");
|
||||
if (cursorStyle.toNextSelection()) {
|
||||
String functions = wpsWordReqDto.getFunction().replace("/w:r/", "");
|
||||
if (functions.charAt(0) == '/') {
|
||||
functions = ".//" + functions.split("]")[1];
|
||||
} else {
|
||||
functions = "./" + functions.split("]")[1];
|
||||
}
|
||||
|
||||
cursorStyle.selectPath(nameSpaceStyle + functions);
|
||||
if (cursorStyle.toNextSelection()) {
|
||||
|
||||
if ("1".equals(wpsWordReqDto.getIsboo())) {
|
||||
judgement.setContentIn(chineseName + "是");
|
||||
judgement.setContent(function + "-/true");
|
||||
} else {
|
||||
String valueStyle = cursorStyle.getTextValue();
|
||||
valueStyle = getValueType(wpsWordReqDto, valueStyle);
|
||||
judgement.setContentIn(chineseName + valueStyle);
|
||||
judgement.setContent(function + "-/" + valueStyle);
|
||||
}
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ("1".equals(wpsWordReqDto.getIsboo())) {
|
||||
judgement.setContentIn(chineseName + "否");
|
||||
judgement.setContent(function + "-/false");
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
List<XWPFHeader> headers = document.getHeaderList();
|
||||
@@ -147,15 +219,128 @@ public class WpsWordUtils {
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
List<XWPFParagraph> headerpar = header.getParagraphs();
|
||||
XmlCursor headerXml = headerpar.get(0).getCTP().newCursor();
|
||||
headerXml.selectPath(nameSpace + "./" + wpsWordReqDto.getFunction().split("#")[1]);
|
||||
if (headerXml.toNextSelection()) {
|
||||
String value = headerXml.getTextValue();
|
||||
judgement.setContentIn(wpsWordReqDto.getName()+ "-" + chineseType + "-"+value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value + "-"+ headerVo.getType());
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
if (wpsWordReqDto.getFunction().contains("w:page")) {
|
||||
if (headerXml.xmlText().contains("PAGE")) {
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + chineseType + " 是");
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + "false" + "-"+ headerVo.getType());
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
} else {
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + chineseType + " 否");
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + "false" + "-"+ headerVo.getType());
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
} else if (wpsWordReqDto.getName().contains("水印")) {
|
||||
if (wpsWordReqDto.getName().contains("水印类型")) {
|
||||
if (headerXml.xmlText().contains("v:shape") && headerXml.xmlText().contains("v:textpath")) {
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + chineseType + " 文字水印");
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + "文字水印" + "-"+ headerVo.getType());
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
if (wpsWordReqDto.getName().contains("文本")) {
|
||||
headerXml.selectPath(nameSpace + "//v:shape/v:textpath/@string");
|
||||
if (headerXml.toNextSelection()) {
|
||||
String value = headerXml.getTextValue();
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + chineseType + "-" + value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value + "-"+ headerVo.getType());
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
if (wpsWordReqDto.getName().contains("字体")) {
|
||||
headerXml.selectPath(nameSpace + "//v:shape/v:textpath/@style");
|
||||
if (headerXml.toNextSelection()) {
|
||||
String value = headerXml.getTextValue();
|
||||
Pattern pattern = Pattern.compile("font-family:([^;]+)");
|
||||
Matcher matcher = pattern.matcher(value);
|
||||
if (matcher.find()) {
|
||||
String fontFamily = matcher.group(1).trim();
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + chineseType + "-" +fontFamily);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + fontFamily + "-"+ headerVo.getType());
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (wpsWordReqDto.getName().contains("字号")) {
|
||||
headerXml.selectPath(nameSpace + "//v:shape/v:textpath/@style");
|
||||
if (headerXml.toNextSelection()) {
|
||||
String value = headerXml.getTextValue();
|
||||
Pattern pattern = Pattern.compile("font-size:([^;]+)");
|
||||
Matcher matcher = pattern.matcher(value);
|
||||
if (matcher.find()) {
|
||||
String fontFamily = matcher.group(1).trim();
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + chineseType + "-" +fontFamily);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + fontFamily + "-"+ headerVo.getType());
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (wpsWordReqDto.getName().contains("颜色")) {
|
||||
headerXml.selectPath(nameSpace + "//v:shape/@fillcolor");
|
||||
if (headerXml.toNextSelection()) {
|
||||
String value = headerXml.getTextValue();
|
||||
value = getValueType(wpsWordReqDto, value);
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + chineseType + "-" +value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value + "-"+ headerVo.getType());
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
if (wpsWordReqDto.getName().contains("透明度")) {
|
||||
headerXml.selectPath(nameSpace + "//v:shape/v:fill/@opacity");
|
||||
if (headerXml.toNextSelection()) {
|
||||
String value = headerXml.getTextValue();
|
||||
while (value.length() < 8) {
|
||||
value = "0" + value;
|
||||
}
|
||||
long bits = Long.parseLong(value, 16);
|
||||
float opacityFloat = Float.intBitsToFloat((int) bits);
|
||||
// 转为百分比(例如 0.3 -> 30%)
|
||||
float opacityPercent = opacityFloat * 100;
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + chineseType + "-" +opacityPercent);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + opacityPercent + "-"+ headerVo.getType());
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
if (wpsWordReqDto.getName().contains("版式")) {
|
||||
headerXml.selectPath(nameSpace + "//v:shape/@style");
|
||||
if (headerXml.toNextSelection()) {
|
||||
String value = headerXml.getTextValue();
|
||||
value = detectWatermarkLayout(value);
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + chineseType + "-" +value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value + "-"+ headerVo.getType());
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
headerXml.selectPath(nameSpace + "./" + wpsWordReqDto.getFunction().split("#")[1]);
|
||||
if (headerXml.toNextSelection()) {
|
||||
String value = headerXml.getTextValue();
|
||||
value = getValueType(wpsWordReqDto, value);
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + chineseType + "-" +value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value + "-"+ headerVo.getType());
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -165,17 +350,35 @@ public class WpsWordUtils {
|
||||
// 2-1、针对不同的进行排查
|
||||
String chineseType = Objects.equals(headerVo.getType(), "default") ? "奇数页" : Objects.equals(headerVo.getType(), "even") ? "偶数页" : "";
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
List<XWPFParagraph> foorerpar = footer.getParagraphs();
|
||||
XmlCursor headerXml = foorerpar.get(0).getCTP().newCursor();
|
||||
headerXml.selectPath(nameSpace + "./" + wpsWordReqDto.getFunction().split("#")[1]);
|
||||
if (headerXml.toNextSelection()) {
|
||||
String value = headerXml.getTextValue();
|
||||
judgement.setContentIn(wpsWordReqDto.getName()+ "-" + chineseType + "-"+value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value + "-"+ headerVo.getType());
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
List<XWPFParagraph> footerpar = footer.getParagraphs();
|
||||
XmlCursor footerXml = footerpar.get(0).getCTP().newCursor();
|
||||
if (wpsWordReqDto.getFunction().contains("w:page")) {
|
||||
if (footerXml.xmlText().contains("PAGE")) {
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + chineseType + " 是");
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + "true" + "-"+ headerVo.getType());
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
} else {
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + chineseType + " 否");
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + "false" + "-"+ headerVo.getType());
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
} else {
|
||||
footerXml.selectPath(nameSpace + "./" + wpsWordReqDto.getFunction().split("#")[1]);
|
||||
if (footerXml.toNextSelection()) {
|
||||
String value = footerXml.getTextValue();
|
||||
value = getValueType(wpsWordReqDto, value);
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + chineseType + "-"+value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value + "-"+ headerVo.getType());
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -185,47 +388,220 @@ public class WpsWordUtils {
|
||||
} else {
|
||||
// 需要查询主页面的方法
|
||||
XmlCursor sectPrXsml = docXml.newCursor();
|
||||
sectPrXsml.selectPath(nameSpace + wpsWordReqDto.getFunction());
|
||||
if (sectPrXsml.toNextSelection()) {
|
||||
String value = sectPrXsml.getTextValue();
|
||||
if (wpsWordReqDto.getUnit().contains("twipstolines")) {
|
||||
String[] docGrid = wpsWordReqDto.getFunction().split("#");
|
||||
XmlCursor docGridXsml = sectPrXsml;
|
||||
docGridXsml.selectPath(nameSpace + docGrid[0]);
|
||||
String docGridValues = "";
|
||||
String topValues = "";
|
||||
String bottomValues = "";
|
||||
String allValues = "";
|
||||
if (docGridXsml.toNextSelection()) {
|
||||
docGridValues = docGridXsml.getTextValue();
|
||||
}
|
||||
XmlCursor pgMgXsml = sectPrXsml;
|
||||
pgMgXsml.selectPath(nameSpace + wpsWordReqDto.getEnglishName() + docGrid[1]);
|
||||
if (pgMgXsml.toNextSelection()) {
|
||||
topValues = pgMgXsml.getAttributeText(new QName("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "top"));
|
||||
bottomValues = pgMgXsml.getAttributeText(new QName("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "bottom"));
|
||||
}
|
||||
XmlCursor allXsml = sectPrXsml;
|
||||
pgMgXsml.selectPath(nameSpace + wpsWordReqDto.getEnglishName() + docGrid[2]);
|
||||
if (allXsml.toNextSelection()) {
|
||||
allValues = allXsml.getAttributeText(new QName("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "h"));
|
||||
}
|
||||
Integer values = Integer.parseInt(allValues) - Integer.parseInt(bottomValues)
|
||||
- Integer.parseInt(topValues);
|
||||
Integer docGridValuesInt = values / Integer.parseInt(docGridValues);
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + "-" + value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value);
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo());
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + docGridValuesInt);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + docGridValuesInt);
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
} else if (wpsWordReqDto.getUnit().contains("paper_shape")) {
|
||||
sectPrXsml.selectPath(nameSpace + wpsWordReqDto.getFunction());
|
||||
// 纸型
|
||||
if (sectPrXsml.toNextSelection()) {
|
||||
String text = sectPrXsml.xmlText();
|
||||
String value = PageSizeDetector.detectPaperSize(text);
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value);
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
} else{
|
||||
sectPrXsml.selectPath(nameSpace + wpsWordReqDto.getFunction());
|
||||
if (sectPrXsml.toNextSelection()) {
|
||||
String value = sectPrXsml.getTextValue();
|
||||
value = getValueType(wpsWordReqDto, value);
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value);
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 3、图形
|
||||
if ("2".equals(wpsWordReqDto.getBelongTo())) {
|
||||
String function = wpsWordReqDto.getFunction();
|
||||
// StringBuilder functionAll = new StringBuilder();
|
||||
String chineseName = wpsWordReqDto.getName();
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
// 1-1、创建新的数据组
|
||||
XmlCursor wpCursor = cursor.newCursor();
|
||||
wpCursor.selectPath(nameSpace + function);
|
||||
if (wpCursor.toNextSelection()) {
|
||||
if ("1".equals(wpsWordReqDto.getIsboo())) {
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + "-" + "true");
|
||||
judgement.setContent(function + "-/" + "true");
|
||||
|
||||
} else {
|
||||
String value = wpCursor.getTextValue();
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + "-" + value);
|
||||
judgement.setContent(function + "-/" + value);
|
||||
if (wpsWordReqDto.getName().contains("环绕方式")) {
|
||||
XmlCursor wpCursor = cursor.newCursor();
|
||||
wpCursor.selectPath(nameSpace + wpsWordReqDto.getFunction()); {
|
||||
if (wpCursor.toNextSelection()) {
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
String text = wpCursor.xmlText();
|
||||
String value = getDrawingType(text);
|
||||
value = getValueType(wpsWordReqDto, value);
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + value.split("#")[1]);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value.split("#")[0]);
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
// 查询指定值,返回固定的文本
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
} else if (wpsWordReqDto.getName().contains("形状填充") && wpsWordReqDto.getName().contains("填充方式")) {
|
||||
XmlCursor wpCursor = cursor.newCursor();
|
||||
wpCursor.selectPath(nameSpace + wpsWordReqDto.getFunction());
|
||||
if (wpCursor.toNextSelection()) {
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
String text = wpCursor.xmlText();
|
||||
String value = getValueType(wpsWordReqDto, text);
|
||||
value = getValueType(wpsWordReqDto, value);
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value);
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo());
|
||||
judgement.setScoreRate("1");
|
||||
// 查询指定值,返回固定的文本
|
||||
judgementList.add(judgement);
|
||||
} else {
|
||||
// 参数类型(0:值;1:判断)
|
||||
if ("1".equals(wpsWordReqDto.getIsboo())) {
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + "-" + "false");
|
||||
judgement.setContent(function + "-/" + "false");
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo());
|
||||
String function = "";
|
||||
if (wpsWordReqDto.getIsExam().equals("0")) {
|
||||
String[] functionList = wpsWordReqDto.getFunction().split("#");
|
||||
if (wpsWordReqDto.getName().contains("图片")) {
|
||||
function = functionList[0];
|
||||
} else {
|
||||
function = wpsWordReqDto.getEnglishName() + functionList[1];
|
||||
}
|
||||
} else {
|
||||
function = wpsWordReqDto.getFunction();
|
||||
}
|
||||
String chineseName = wpsWordReqDto.getName();
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
// 1-1、创建新的数据组
|
||||
XmlCursor wpCursor = cursor.newCursor();
|
||||
wpCursor.selectPath(nameSpace + function);
|
||||
if (wpCursor.toNextSelection()) {
|
||||
if ("1".equals(wpsWordReqDto.getIsboo())) {
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + "是");
|
||||
judgement.setContent(function + "-/" + "true");
|
||||
|
||||
} else {
|
||||
String value = wpCursor.getTextValue();
|
||||
value = getValueType(wpsWordReqDto, value);
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + value);
|
||||
judgement.setContent(function + "-/" + value);
|
||||
}
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
// 查询指定值,返回固定的文本
|
||||
judgementList.add(judgement);
|
||||
} else {
|
||||
// 参数类型(0:值;1:判断)
|
||||
if ("1".equals(wpsWordReqDto.getIsboo())) {
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + "false");
|
||||
judgement.setContent(function + "-/" + "false");
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// 4、尾注
|
||||
if ("3".equals(wpsWordReqDto.getBelongTo())) {
|
||||
if ("0".equals(wpsWordReqDto.getType())) {
|
||||
if (wpsWordReqDto.getName().contains("插入尾注")) {
|
||||
// 判断是否存在
|
||||
XmlCursor wpCursor = cursor.newCursor();
|
||||
wpCursor.selectPath(nameSpace + "//w:endnoteReference/@w:id");
|
||||
if (wpCursor.toNextSelection()) {
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + " 是");
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + "true");
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Enumeration<? extends ZipEntry> entriess = zipFile.entries();
|
||||
while (entriess.hasMoreElements()) {
|
||||
ZipEntry entry = entriess.nextElement();
|
||||
String entryName = entry.getName();
|
||||
if (entryName.startsWith("word/endnotes") && entryName.endsWith(".xml")) {
|
||||
String xmlContent = ZipXmlUtils.readZipEntry(zipFile, entryName);
|
||||
XmlObject xmlObject = XmlObject.Factory.parse(xmlContent);
|
||||
XmlCursor cursorEnd = xmlObject.newCursor();
|
||||
String namespace = WpsWordNameSpaces.getNameSpace(cursorEnd.xmlText());
|
||||
if (wpsWordReqDto.getName().contains("内容")) {
|
||||
System.out.println(cursorEnd.xmlText());
|
||||
String value = cursorEnd.getTextValue();
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value);
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 表格属性
|
||||
if ("4".equals(wpsWordReqDto.getBelongTo())) {
|
||||
XmlCursor tblCursor = cursor.newCursor();
|
||||
tblCursor.selectPath(nameSpace + wpsWordReqDto.getFunction());
|
||||
if (tblCursor.toNextSelection()) {
|
||||
String value = tblCursor.getTextValue();
|
||||
value = getValueType(wpsWordReqDto, value);
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value);
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
}
|
||||
// 5、域
|
||||
if ("5".equals(wpsWordReqDto.getBelongTo())) {
|
||||
XmlCursor yuCursor = cursor.newCursor();
|
||||
yuCursor.selectPath(nameSpace + wpsWordReqDto.getFunction().replace("/chao",""));
|
||||
if (yuCursor.toNextSelection()) {
|
||||
if (wpsWordReqDto.getName().contains("域代码")) {
|
||||
String value = yuCursor.getTextValue();
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value);
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
if (wpsWordReqDto.getName().contains("域类型")) {
|
||||
String value = yuCursor.getTextValue();
|
||||
if (value.contains("HYPERLINK")) {
|
||||
value = "连接和引用->打开并跳到指定文件";
|
||||
}
|
||||
WpsWordJudgementDto judgement = new WpsWordJudgementDto();
|
||||
judgement.setContentIn(wpsWordReqDto.getName() + value);
|
||||
judgement.setContent(wpsWordReqDto.getFunction() + "-/" + value);
|
||||
judgement.setImage(wpsWordReqDto.getType()+"-"+wpsWordReqDto.getBelongTo()+"-"+wpsWordReqDto.getIsboo()+"-"+wpsWordReqDto.getUnit());
|
||||
judgement.setScoreRate("1");
|
||||
judgementList.add(judgement);
|
||||
}
|
||||
@@ -236,6 +612,144 @@ public class WpsWordUtils {
|
||||
|
||||
return judgementList;
|
||||
}
|
||||
public static String getValueType(WpsWordReqDto wpsWordReqDto, String value) {
|
||||
String values = value;
|
||||
if (wpsWordReqDto.getUnit().contains("Filling_method")) {
|
||||
if (value.contains("solidFill")) {
|
||||
values = "纯色填充";
|
||||
} else if (value.contains("gradFill")) {
|
||||
values = "渐变填充";
|
||||
} else if (value.contains("pattFill")) {
|
||||
values = "图案填充";
|
||||
} else if (value.contains("blipFill")) {
|
||||
values = "图片填充";
|
||||
}
|
||||
}
|
||||
if (wpsWordReqDto.getUnit().contains("twiptopt")) {
|
||||
values = TwipConverter.formatDouble(TwipConverter.toPoints(Integer.parseInt(value))) + "磅";
|
||||
}
|
||||
if (wpsWordReqDto.getUnit().contains("emustopt")) {
|
||||
values = TwipConverter.formatDouble(TwipConverter.toEmus(Integer.parseInt(value))) + "磅";
|
||||
}
|
||||
if (wpsWordReqDto.getUnit().contains("color")) {
|
||||
values = ColorNameFinder.getColorName(value);
|
||||
}
|
||||
if (wpsWordReqDto.getUnit().contains("underline")) {
|
||||
if ("double".equals(value)) {
|
||||
values = "双下划线";
|
||||
} else if ("single".equals(value)) {
|
||||
values = "单下划线";
|
||||
} else if ("none".equals(value)) {
|
||||
values = "无下划线";
|
||||
} else if ("dotted".equals(value)) {
|
||||
values = "点划线";
|
||||
} else if ("dottedHeavy".equals(value)) {
|
||||
values = "粗点划线";
|
||||
} else if ("dash".equals(value)) {
|
||||
values = "虚线";
|
||||
} else if ("dashedHeavy".equals(value)) {
|
||||
values = "粗虚线";
|
||||
} else if ("dashLong".equals(value)) {
|
||||
values = "长虚线";
|
||||
}
|
||||
}
|
||||
if (wpsWordReqDto.getUnit().contains("direction")) {
|
||||
// 方向英文转换
|
||||
if ("landscape".equals(value)) {
|
||||
values = "横向";
|
||||
} else if ("portrait".equals(value)) {
|
||||
values = "纵向";
|
||||
} else if ("up".equals(value)) {
|
||||
values = "上对齐";
|
||||
} else if ("down".equals(value)) {
|
||||
values = "下对齐";
|
||||
}
|
||||
}
|
||||
if (value.contains("center")) {
|
||||
values = "居中对齐";
|
||||
}
|
||||
if (wpsWordReqDto.getUnit().contains("textdirection")) {
|
||||
// 方向英文转换
|
||||
if ("left".equals(value)) {
|
||||
values = "左对齐";
|
||||
} else if ("center".equals(value)) {
|
||||
values = "居中对齐";
|
||||
} else if ("right".equals(value)) {
|
||||
values = "右对齐";
|
||||
} else if ("both".equals(value)) {
|
||||
values = "两端对齐";
|
||||
}
|
||||
}
|
||||
if (wpsWordReqDto.getUnit().contains("halfpt")) {
|
||||
values = String.valueOf (Integer.parseInt(value) / 2);
|
||||
}
|
||||
if (wpsWordReqDto.getUnit().contains("shadowdirection")) {
|
||||
ShadowDirectionUtils.ShadowDirection direction = ShadowDirectionUtils.getShadowDirection(Long.valueOf(value));
|
||||
values = direction.getLabel();
|
||||
}
|
||||
if (wpsWordReqDto.getUnit().contains("ershifenzhiyi")) {
|
||||
values = String.valueOf (Integer.parseInt(value) / 20);
|
||||
}
|
||||
if (wpsWordReqDto.getUnit().contains("duanluojianju")) {
|
||||
if (Integer.parseInt(value) == 240) {
|
||||
values = "1.5 倍行距";
|
||||
} else if (Integer.parseInt(value) == 360) {
|
||||
values = "2 倍行距";
|
||||
} else if (Integer.parseInt(value) == 480) {
|
||||
values = "3 倍行距";
|
||||
}
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
public static String detectWatermarkLayout(String style) {
|
||||
if (style == null || !style.contains("rotation:")) {
|
||||
return "水平";
|
||||
}
|
||||
|
||||
try {
|
||||
// 提取 rotation 的值
|
||||
String[] parts = style.split(";");
|
||||
for (String part : parts) {
|
||||
part = part.trim();
|
||||
if (part.startsWith("rotation:")) {
|
||||
String rotationStr = part.replace("rotation:", "").replace("f", "").trim();
|
||||
int rotationValue = Integer.parseInt(rotationStr);
|
||||
|
||||
// 转换为角度(1度 = 65536)
|
||||
int degrees = rotationValue / 65536;
|
||||
|
||||
// 判断角度
|
||||
if (Math.abs(degrees) == 45) {
|
||||
return "倾斜";
|
||||
} else {
|
||||
return "水平";
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return "解析出错:" + e.getMessage();
|
||||
}
|
||||
|
||||
return "未知格式";
|
||||
}
|
||||
|
||||
public static String getDrawingType(String text) {
|
||||
String value ="";
|
||||
if (text.contains("wp:wrapSquare")) {
|
||||
value = "wp:wrapSquare" + "#" + "四周型环绕";
|
||||
} else if (text.contains("wp:wrapTight")) {
|
||||
value = "wp:wrapTight" + "#" + "紧密型环绕";
|
||||
} else if (text.contains("wp:wrapThrough")) {
|
||||
value = "wp:wrapThrough" + "#" + "穿越型环绕";
|
||||
} else if (text.contains("wp:wrapTopAndBottom")) {
|
||||
value = "wp:wrapTopAndBottom" + "#" + "上下型环绕";
|
||||
} else if (text.contains("wp:wrapNone")) {
|
||||
value = "wp:wrapNone" + "#" + "无环绕";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
public static void setWordInfo(String chineseName, String englishName, String selectName, String filePath, String id, String parentId, List<WordInfoReqVo> wordInfoReqVos) throws Exception {
|
||||
WordInfoReqVo wordInfos = new WordInfoReqVo();
|
||||
wordInfos.setName(chineseName);
|
||||
@@ -266,7 +780,6 @@ public class WpsWordUtils {
|
||||
wpIndex ++;
|
||||
// 段落属性
|
||||
if (!wpCursor.xmlText().contains("w:sectPr")) {
|
||||
|
||||
// 获取文本
|
||||
XmlCursor wpTextXml = wpCursor.newCursor();
|
||||
wpTextXml.selectPath(namespace + ".//w:r/w:t");
|
||||
@@ -314,10 +827,52 @@ public class WpsWordUtils {
|
||||
setWordInfo("图形" + wDrawingIndex + ":" + wDrawingXml.getTextValue(), "(//w:drawing)[" + wDrawingIndex + "]", "w:drawing", filePath, secondIdDrawing, firstIdDrawing, wordInfoReqVos);
|
||||
}
|
||||
}
|
||||
// 4、尾注
|
||||
XmlCursor endnoteReferenceCursor = docXml.newCursor();
|
||||
String endnoteReferencePath = namespace + "//w:endnoteReference";
|
||||
endnoteReferenceCursor.selectPath(endnoteReferencePath);
|
||||
int endnoteReferenceIndex = 0;
|
||||
String firstIdEndnoteReference = getStringRandom();
|
||||
while (endnoteReferenceCursor.toNextSelection()) {
|
||||
if (endnoteReferenceIndex == 0) {
|
||||
setWordInfo("引用", "w:endnoteReference", "w:endnoteReference", filePath, firstIdEndnoteReference, "", wordInfoReqVos);
|
||||
}
|
||||
endnoteReferenceIndex ++;
|
||||
String secondIdEndnoteReference = getStringRandom();
|
||||
setWordInfo("尾注", "(//w:endnoteReference)[" + endnoteReferenceIndex + "]", "w:endnoteReference", filePath, secondIdEndnoteReference, firstIdEndnoteReference, wordInfoReqVos);
|
||||
}
|
||||
// 5、表格
|
||||
XmlCursor tblCursor = docXml.newCursor();
|
||||
String tblCursorPath = namespace + "//w:tbl";
|
||||
endnoteReferenceCursor.selectPath(tblCursorPath);
|
||||
int tblIndex = 0;
|
||||
String firstIdTbl = getStringRandom();
|
||||
while (endnoteReferenceCursor.toNextSelection()) {
|
||||
if (tblIndex == 0) {
|
||||
setWordInfo("表格", "w:endnoteReference", "w:endnoteReference", filePath, firstIdTbl, "", wordInfoReqVos);
|
||||
}
|
||||
tblIndex ++;
|
||||
String secondIdTbl = getStringRandom();
|
||||
setWordInfo("表格:"+tblIndex, "(//w:tbl)[" + tblIndex + "]", "w:tbl", filePath, secondIdTbl, firstIdTbl, wordInfoReqVos);
|
||||
}
|
||||
// 5、域
|
||||
XmlCursor yuCursor = docXml.newCursor();
|
||||
String yuCursorPath = namespace + "//w:instrText";
|
||||
endnoteReferenceCursor.selectPath(yuCursorPath);
|
||||
int yuIndex = 0;
|
||||
String firstIdyu = getStringRandom();
|
||||
while (endnoteReferenceCursor.toNextSelection()) {
|
||||
if (yuIndex == 0) {
|
||||
setWordInfo("域", "w:instrText", "w:instrText", filePath, firstIdyu, "", wordInfoReqVos);
|
||||
}
|
||||
yuIndex ++;
|
||||
String secondIdyu = getStringRandom();
|
||||
setWordInfo("域:"+yuIndex, "(//w:instrText)[" + yuIndex + "]", "w:instrText", filePath, secondIdyu, firstIdyu, wordInfoReqVos);
|
||||
}
|
||||
return wordInfoReqVos;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 获取文档段落W:P标签得数量,判断出一个有多少段
|
||||
* @param filePath 文件路径
|
||||
* @return List<WordVO>
|
||||
|
||||
Reference in New Issue
Block a user