From 4d775d23328e103da309ec0526d52ab6b799c808 Mon Sep 17 00:00:00 2001 From: huababa1 <2037205722@qq.com> Date: Mon, 13 Oct 2025 19:07:37 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E8=80=83=E8=AF=95=E8=BF=9B=E5=85=A5=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E4=B8=8D=E4=BB=8E=E7=BC=93=E5=AD=98=E8=8E=B7=E5=8F=96=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E5=AD=97=E6=AE=B5=E8=90=BD=E8=80=83?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/monitor/MonitorServiceImpl.java | 23 ++++++++++++------- .../wps_word/docx4j/paragraph/Convert.java | 16 ++++++++----- .../wps_word/docx4j/paragraph/Paragraphs.java | 2 +- .../wps_word/docx4j/section/SectionPage.java | 20 ++++++++-------- 4 files changed, 36 insertions(+), 25 deletions(-) diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorServiceImpl.java index 8b0facb9..dff129d8 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorServiceImpl.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorServiceImpl.java @@ -141,14 +141,20 @@ public class MonitorServiceImpl implements MonitorService { @Override public long getStuMonitor(StuMonitorPaperVo stuMonitorPaperVo) throws RuntimeException { String key = "userCache:" + stuMonitorPaperVo.getTaskId() + ":" + stuMonitorPaperVo.getStuId(); - MonitorDO info = JsonUtils.parseObject(stringRedisTemplate.opsForValue().get(key), MonitorDO.class); - if (info == null) { - info=monitorMapper.selectOne( - new QueryWrapper() - .eq("task_id", stuMonitorPaperVo.getTaskId()) - .eq("stu_id", stuMonitorPaperVo.getStuId()) - ); - } +// MonitorDO info = JsonUtils.parseObject(stringRedisTemplate.opsForValue().get(key), MonitorDO.class); +// if (info == null) { +// info=monitorMapper.selectOne( +// new QueryWrapper() +// .eq("task_id", stuMonitorPaperVo.getTaskId()) +// .eq("stu_id", stuMonitorPaperVo.getStuId()) +// ); +// } + MonitorDO info =monitorMapper.selectOne( + new QueryWrapper() + .eq("task_id", stuMonitorPaperVo.getTaskId()) + .eq("stu_id", stuMonitorPaperVo.getStuId()) + ); + //获取属性 判断 专业/课程点位 Long loginTenantId = SecurityFrameworkUtils.getLoginTenantId(); @@ -406,6 +412,7 @@ public class MonitorServiceImpl implements MonitorService { MonitorDO monitorDO = null; if (info != null) { monitorDO = monitorMapper.selectById(info.getMonitorId()); + System.out.println(monitorDO); info.setScore(String.valueOf(score)); if (StringUtils.isNotBlank(monitorDO.getScore())) { try { diff --git a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/utils/wps_word/docx4j/paragraph/Convert.java b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/utils/wps_word/docx4j/paragraph/Convert.java index 53d99cd3..2c7a7317 100644 --- a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/utils/wps_word/docx4j/paragraph/Convert.java +++ b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/utils/wps_word/docx4j/paragraph/Convert.java @@ -34,12 +34,16 @@ public class Convert { public static String convertOutlineLvl(String val) { switch (val) { - case "0": - return "标题1"; - case "1": - return "标题2"; - default: - return null; + case "0": return "一级"; + case "1": return "二级"; + case "2": return "三级"; + case "3": return "四级"; + case "4": return "五级"; + case "5": return "六级"; + case "6": return "七级"; + case "7": return "八级"; + case "8": return "九级"; + default: return "正文"; } } diff --git a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/utils/wps_word/docx4j/paragraph/Paragraphs.java b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/utils/wps_word/docx4j/paragraph/Paragraphs.java index f0273d75..b61b238e 100644 --- a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/utils/wps_word/docx4j/paragraph/Paragraphs.java +++ b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/utils/wps_word/docx4j/paragraph/Paragraphs.java @@ -53,7 +53,7 @@ public class Paragraphs { String styleId = pPr.getPStyle().getVal(); Style style = stylePart.getStyleById(styleId); if (style != null && style.getPPr() != null && style.getPPr().getJc() != null) { - return Convert.convertJc(style.getPPr().getOutlineLvl().getVal().toString()); + return Convert.convertOutlineLvl(style.getPPr().getOutlineLvl().getVal().toString()); } } return "正文"; diff --git a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/utils/wps_word/docx4j/section/SectionPage.java b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/utils/wps_word/docx4j/section/SectionPage.java index e8323fb7..8d7829a5 100644 --- a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/utils/wps_word/docx4j/section/SectionPage.java +++ b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/utils/wps_word/docx4j/section/SectionPage.java @@ -76,8 +76,8 @@ public class SectionPage { long topTwips = pgMar.getTop().longValue(); // twips double topPt = topTwips / 20.0; // 转换为磅 double topCm = topPt * 0.0352778; // 转换为厘米 -// return String.format("%.1f磅(%.2f厘米)", topPt, topCm); - return String.format("%.2f厘米", topCm); + return String.format("%.1f磅(%.2f厘米)", topPt, topCm); + // return String.format("%.2f厘米", topCm); } } @@ -95,8 +95,8 @@ public class SectionPage { long bottomTwips = pgMar.getBottom().longValue(); // twips double bottomPt = bottomTwips / 20.0; // 磅 double bottomCm = bottomPt * 0.0352778; // 厘米 -// return String.format("%.1f磅(%.2f厘米)", bottomPt, bottomCm); - return String.format("%.2f厘米", bottomCm); + return String.format("%.1f磅(%.2f厘米)", bottomPt, bottomCm); + // return String.format("%.2f厘米", bottomCm); } } return null; @@ -113,8 +113,8 @@ public class SectionPage { long leftTwips = pgMar.getLeft().longValue(); // twips double leftPt = leftTwips / 20.0; // 转换为磅 double leftCm = leftPt * 0.0352778; // 转换为厘米 -// return String.format("%.1f磅(%.2f厘米)", leftPt, leftCm); - return String.format("%.2f厘米", leftCm); + return String.format("%.1f磅(%.2f厘米)", leftPt, leftCm); + // return String.format("%.2f厘米", leftCm); } } return null; @@ -131,8 +131,8 @@ public class SectionPage { long rightTwips = pgMar.getRight().longValue(); // twips double rightPt = rightTwips / 20.0; // 转换为磅 double rightCm = rightPt * 0.0352778; // 转换为厘米 - return String.format("%.2f厘米", rightCm); -// return String.format("%.1f磅(%.2f厘米)", rightPt, rightCm); + // return String.format("%.2f厘米", rightCm); + return String.format("%.1f磅(%.2f厘米)", rightPt, rightCm); } } return null; @@ -149,8 +149,8 @@ public class SectionPage { long gutterTwips = pgMar.getGutter().longValue(); // twips double gutterPt = gutterTwips / 20.0; // 转换为磅 double gutterCm = gutterPt * 0.0352778; // 转换为厘米 -// return String.format("%.1f磅(%.2f厘米)", gutterPt, gutterCm); - return String.format("%.2f厘米", gutterCm); + return String.format("%.1f磅(%.2f厘米)", gutterPt, gutterCm); + // return String.format("%.2f厘米", gutterCm); } } return null;