From 28e611df48eff21e69927e9a947578bfbcf1d323 Mon Sep 17 00:00:00 2001 From: "DESKTOP-932OMT8\\REN" Date: Fri, 13 Jun 2025 16:26:27 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=20wps=20?= =?UTF-8?q?=E5=88=A4=E5=88=86=E6=96=87=E4=BB=B6=E5=90=8D=E7=A7=B0=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auto_tools/AutoToolsServiceImpl.java | 172 +++++++++--------- 1 file changed, 88 insertions(+), 84 deletions(-) diff --git a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/service/auto_tools/AutoToolsServiceImpl.java b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/service/auto_tools/AutoToolsServiceImpl.java index 192df458..057315df 100644 --- a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/service/auto_tools/AutoToolsServiceImpl.java +++ b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/service/auto_tools/AutoToolsServiceImpl.java @@ -415,94 +415,98 @@ public class AutoToolsServiceImpl implements AutoToolsService{ } // wps 类型存在多级文文件夹,需要个性化设置 if ("文字".equals(one_file.getName().split("\\.")[0])) { - String judgementStrWord = ""; - SourceAndText wordpojo = judgementWpsWordService.judgementWpsWord(Double.parseDouble(quScore), one_file.getPath(), file_one.getPath(), examQuestion, judgementStrWord); - double wps_word_score = wordpojo.getScore(); - String judgementStr = "

-----------------------------------------------------------

"; - judgementStr += "

试题编号" + examQuestion.getQuNum() + "

"; - judgementStr += wordpojo.getText(); - // 通过学号+试卷ID+试题ID进行查询 - StuPaperInfoDO stuPaperInfoDO = stuPaperInfoService.findByStuIDAndPaperIdAndExamId(stuId, paperId, examQuestion.getQuId()); - if (stuPaperInfoDO != null) { - stuPaperInfoDO.setContent(judgementStr); - stuPaperInfoDO.setSort(stuPaperScoreDO.getSort()); - stuPaperInfoService.updateStuPaperInfo(stuPaperInfoDO); - } else { - stuPaperInfoDO = new StuPaperInfoDO(); - stuPaperInfoDO.setStuId(stuId); - stuPaperInfoDO.setPaperId(paperId); - stuPaperInfoDO.setQuId(examQuestion.getQuId()); - stuPaperInfoDO.setContent(judgementStr); - stuPaperInfoDO.setSort(stuPaperScoreDO.getSort()); - stuPaperInfoService.insertStuPaperInfo(stuPaperInfoDO); + if (file_one.getPath().contains("文档")) { + String judgementStrWord = ""; + SourceAndText wordpojo = judgementWpsWordService.judgementWpsWord(Double.parseDouble(quScore), one_file.getPath(), file_one.getPath(), examQuestion, judgementStrWord); + double wps_word_score = wordpojo.getScore(); + String judgementStr = "

-----------------------------------------------------------

"; + judgementStr += "

试题编号" + examQuestion.getQuNum() + "

"; + judgementStr += wordpojo.getText(); + // 通过学号+试卷ID+试题ID进行查询 + StuPaperInfoDO stuPaperInfoDO = stuPaperInfoService.findByStuIDAndPaperIdAndExamId(stuId, paperId, examQuestion.getQuId()); + if (stuPaperInfoDO != null) { + stuPaperInfoDO.setContent(judgementStr); + stuPaperInfoDO.setSort(stuPaperScoreDO.getSort()); + stuPaperInfoService.updateStuPaperInfo(stuPaperInfoDO); + } else { + stuPaperInfoDO = new StuPaperInfoDO(); + stuPaperInfoDO.setStuId(stuId); + stuPaperInfoDO.setPaperId(paperId); + stuPaperInfoDO.setQuId(examQuestion.getQuId()); + stuPaperInfoDO.setContent(judgementStr); + stuPaperInfoDO.setSort(stuPaperScoreDO.getSort()); + stuPaperInfoService.insertStuPaperInfo(stuPaperInfoDO); + } + score += wps_word_score; + stuPaperScoreDO.setScore(new BigDecimal(wps_word_score)); + // 原始正确分数 + stuPaperScoreDO.setTrueScore(new BigDecimal(quScore)); + // 判断题是否正确 + if (wps_word_score == Double.parseDouble(quScore)) { + stuPaperScoreDO.setIsTrue(0); + } else if (wps_word_score == 0) { + stuPaperScoreDO.setIsTrue(1); + } else { + stuPaperScoreDO.setIsTrue(2); + } + stuPaperScoreDO.setSubjectName(examQuestion.getSubjectName()); + if (isNull) { + // 如果之前没做过,则插入该题的分数 + stuPaperScoreService.insertStuPaperScore(stuPaperScoreDO); + } else { + // 如果之前做过,则更新该题的分数 + stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO); + } + System.out.println(wps_word_score+"wps_word得分"); + break; } - score += wps_word_score; - stuPaperScoreDO.setScore(new BigDecimal(wps_word_score)); - // 原始正确分数 - stuPaperScoreDO.setTrueScore(new BigDecimal(quScore)); - // 判断题是否正确 - if (wps_word_score == Double.parseDouble(quScore)) { - stuPaperScoreDO.setIsTrue(0); - } else if (wps_word_score == 0) { - stuPaperScoreDO.setIsTrue(1); - } else { - stuPaperScoreDO.setIsTrue(2); - } - stuPaperScoreDO.setSubjectName(examQuestion.getSubjectName()); - if (isNull) { - // 如果之前没做过,则插入该题的分数 - stuPaperScoreService.insertStuPaperScore(stuPaperScoreDO); - } else { - // 如果之前做过,则更新该题的分数 - stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO); - } - System.out.println(wps_word_score+"wps_word得分"); - break; } if ("演示".equals(one_file.getName().split("\\.")[0])) { - String judgementStrPptx = ""; - SourceAndText pptxpojo = judgementWpsPptxService.judgementWpsPptx(Double.parseDouble(quScore), one_file.getPath(), file_one.getPath(), examQuestion, judgementStrPptx); - double wps_pptx_score = pptxpojo.getScore(); - String judgementStr = "

-----------------------------------------------------------

"; - judgementStr += "

试题编号" + examQuestion.getQuNum() + "

"; - judgementStr += pptxpojo.getText(); - // 通过学号+试卷ID+试题ID进行查询 - StuPaperInfoDO stuPaperInfoDO = stuPaperInfoService.findByStuIDAndPaperIdAndExamId(stuId, paperId, examQuestion.getQuId()); - if (stuPaperInfoDO != null) { - stuPaperInfoDO.setContent(judgementStr); - stuPaperInfoDO.setSort(stuPaperScoreDO.getSort()); - stuPaperInfoService.updateStuPaperInfo(stuPaperInfoDO); - } else { - stuPaperInfoDO = new StuPaperInfoDO(); - stuPaperInfoDO.setStuId(stuId); - stuPaperInfoDO.setPaperId(paperId); - stuPaperInfoDO.setQuId(examQuestion.getQuId()); - stuPaperInfoDO.setContent(judgementStr); - stuPaperInfoDO.setSort(stuPaperScoreDO.getSort()); - stuPaperInfoService.insertStuPaperInfo(stuPaperInfoDO); + if (file_one.getPath().contains("文档")) { + String judgementStrPptx = ""; + SourceAndText pptxpojo = judgementWpsPptxService.judgementWpsPptx(Double.parseDouble(quScore), one_file.getPath(), file_one.getPath(), examQuestion, judgementStrPptx); + double wps_pptx_score = pptxpojo.getScore(); + String judgementStr = "

-----------------------------------------------------------

"; + judgementStr += "

试题编号" + examQuestion.getQuNum() + "

"; + judgementStr += pptxpojo.getText(); + // 通过学号+试卷ID+试题ID进行查询 + StuPaperInfoDO stuPaperInfoDO = stuPaperInfoService.findByStuIDAndPaperIdAndExamId(stuId, paperId, examQuestion.getQuId()); + if (stuPaperInfoDO != null) { + stuPaperInfoDO.setContent(judgementStr); + stuPaperInfoDO.setSort(stuPaperScoreDO.getSort()); + stuPaperInfoService.updateStuPaperInfo(stuPaperInfoDO); + } else { + stuPaperInfoDO = new StuPaperInfoDO(); + stuPaperInfoDO.setStuId(stuId); + stuPaperInfoDO.setPaperId(paperId); + stuPaperInfoDO.setQuId(examQuestion.getQuId()); + stuPaperInfoDO.setContent(judgementStr); + stuPaperInfoDO.setSort(stuPaperScoreDO.getSort()); + stuPaperInfoService.insertStuPaperInfo(stuPaperInfoDO); + } + score += wps_pptx_score; + stuPaperScoreDO.setScore(new BigDecimal(wps_pptx_score)); + // 原始正确分数 + stuPaperScoreDO.setTrueScore(new BigDecimal(quScore)); + // 判断题是否正确 + if (wps_pptx_score == Double.parseDouble(quScore)) { + stuPaperScoreDO.setIsTrue(0); + } else if (wps_pptx_score == 0) { + stuPaperScoreDO.setIsTrue(1); + } else { + stuPaperScoreDO.setIsTrue(2); + } + stuPaperScoreDO.setSubjectName(examQuestion.getSubjectName()); + if (isNull) { + // 如果之前没做过,则插入该题的分数 + stuPaperScoreService.insertStuPaperScore(stuPaperScoreDO); + } else { + // 如果之前做过,则更新该题的分数 + stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO); + } + System.out.println(wps_pptx_score+"wps_ppt得分"); + break; } - score += wps_pptx_score; - stuPaperScoreDO.setScore(new BigDecimal(wps_pptx_score)); - // 原始正确分数 - stuPaperScoreDO.setTrueScore(new BigDecimal(quScore)); - // 判断题是否正确 - if (wps_pptx_score == Double.parseDouble(quScore)) { - stuPaperScoreDO.setIsTrue(0); - } else if (wps_pptx_score == 0) { - stuPaperScoreDO.setIsTrue(1); - } else { - stuPaperScoreDO.setIsTrue(2); - } - stuPaperScoreDO.setSubjectName(examQuestion.getSubjectName()); - if (isNull) { - // 如果之前没做过,则插入该题的分数 - stuPaperScoreService.insertStuPaperScore(stuPaperScoreDO); - } else { - // 如果之前做过,则更新该题的分数 - stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO); - } - System.out.println(wps_pptx_score+"wps_ppt得分"); - break; } // if ("表格".equals(one_file.getName().split("\\.")[0])) { // double wps_excel_score = judgementWpsExcelService.judgementWpsXlsx(Double.parseDouble(quScore), one_file.getPath(), file_one.getPath(), examQuestion);