【修改】 获取学生试卷分数,参数传递错误

This commit is contained in:
dlaren
2025-08-15 13:21:10 +08:00
parent 7deb304642
commit 81b9c40df0
5 changed files with 74 additions and 41 deletions

View File

@@ -18,7 +18,7 @@ public interface StuPaperScoreMapper extends BaseMapperX<StuPaperScoreDO> {
List<StuPaperScoreDO> findByStuIdAndPaperId(@Param("stuId") Long stuId, @Param("paperId") String paperId, @Param("temporaryId") String temporaryId);
List<StuScoreVo> getStuScore(@Param("stuId") Long stuId, @Param("paperId") String paperId);
List<StuScoreVo> getStuScore(@Param("stuId") Long stuId, @Param("paperId") String paperId, @Param("temporaryId") String temporaryId);
// 通过学生ID试卷ID 试题ID查询数据
StuPaperScoreDO findByStuIdAndPaperIdAndQuestionId(@Param("stuId") Long stuId, @Param("paperId") String paperId, @Param("quId") String questionId);

View File

@@ -19,7 +19,7 @@ public interface StuPaperScoreService {
void updateStuPaperScore(StuPaperScoreDO stuPaperScoreDO);
StuScoreVo getStuScore(Long stuId, String paperId);
StuScoreVo getStuScore(Long stuId, String paperId, String temporaryId);
StuPaperScoreDO getStuScoreByPaperIdAndQuid(Long stuId, String paperId, String quId);

View File

@@ -42,7 +42,7 @@ public class StuPaperScoreServiceImpl implements StuPaperScoreService {
}
@Override
public StuScoreVo getStuScore(Long stuId, String paperId) {
public StuScoreVo getStuScore(Long stuId, String paperId, String temporaryId) {
// 1、创建对象
StuScoreVo stuScoreVo = new StuScoreVo();
// 2、查询学生得分
@@ -52,7 +52,7 @@ public class StuPaperScoreServiceImpl implements StuPaperScoreService {
String nickName = "";
String taskId = "";
String picUrl = "";
List<StuScoreVo> stuScoreVos = stuPaperScoreMapper.getStuScore(stuId, paperId);
List<StuScoreVo> stuScoreVos = stuPaperScoreMapper.getStuScore(stuId, paperId, temporaryId);
for (StuScoreVo scoreVo : stuScoreVos) {
stuNumber = scoreVo.getStuNumber();
nickName = scoreVo.getNickName();

View File

@@ -9,23 +9,23 @@
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="findByStuIdAndPaperId" resultType="pc.exam.pp.module.exam.dal.dataobject.student.StuPaperScoreDO">
SELECT * FROM exam_stu_paper_score WHERE stu_id = #{stuId} AND paper_id = #{paperId} AND paper_id = #{temporaryId} order by sort ASC
SELECT * FROM exam_stu_paper_score WHERE stu_id = #{stuId} AND paper_id = #{paperId} AND temporary_id = #{temporaryId} order by sort ASC
</select>
<select id="getStuScore" resultType="pc.exam.pp.module.exam.dal.mysql.student.StuScoreVo">
SELECT
esps.stu_id AS stuId,
SELECT esps.stu_id AS stuId,
esps.paper_id AS paperId,
esps.score AS score,
esps.true_score AS trueScore,
su.username AS stuNumber,
su.nickname AS nickName,
su.avatar AS picUrl
FROM
exam_stu_paper_score AS esps
FROM exam_stu_paper_score AS esps
LEFT JOIN system_users AS su ON esps.stu_id = su.id
WHERE esps.stu_id = #{stuId} AND esps.paper_id = #{paperId}
WHERE esps.stu_id = #{stuId}
AND esps.paper_id = #{paperId}
AND esps.temporary_id = #{temporaryId}
</select>
<select id="findByStuIdAndPaperIdAndQuestionId" resultType="pc.exam.pp.module.exam.dal.dataobject.student.StuPaperScoreDO">
SELECT * FROM exam_stu_paper_score WHERE stu_id = #{stuId} AND paper_id = #{paperId} AND qu_id = #{quId}

View File

@@ -1,6 +1,9 @@
package pc.exam.pp.module.judgement.utils.wps_pptx.pptx4j;
import org.docx4j.dml.*;
import org.docx4j.openpackaging.packages.PresentationMLPackage;
import org.docx4j.openpackaging.parts.PresentationML.SlidePart;
import org.pptx4j.pml.CTSlideTiming;
import java.math.BigInteger;
import java.text.DecimalFormat;
@@ -8,7 +11,7 @@ import java.text.DecimalFormat;
public class Shape {
// 大小 - 高度
public static String getShapeSizeHeight(org.pptx4j.pml.Shape sp) {
public static String getShapeSizeHeight(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTTransform2D xfrm = sp.getSpPr().getXfrm();
// 获取位置和尺寸单位 EMU1英寸=914400 EMU1cm360000 EMU
CTPositiveSize2D ext = xfrm.getExt(); // 尺寸
@@ -16,7 +19,7 @@ public class Shape {
return String.valueOf(heightPt);
}
// 大小 - 宽度
public static String getShapeSizeWidthPt(org.pptx4j.pml.Shape sp) {
public static String getShapeSizeWidthPt(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTTransform2D xfrm = sp.getSpPr().getXfrm();
// 获取位置和尺寸单位 EMU1英寸=914400 EMU1cm360000 EMU
CTPositiveSize2D ext = xfrm.getExt(); // 尺寸
@@ -24,7 +27,7 @@ public class Shape {
return String.valueOf(widthPt);
}
// 大小 - 锁定纵横比
public static String getShapeSizeLockAspectRatio(org.pptx4j.pml.Shape sp) {
public static String getShapeSizeLockAspectRatio(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTTransform2D xfrm = sp.getSpPr().getXfrm();
// 获取位置和尺寸单位 EMU1英寸=914400 EMU1cm360000 EMU
CTPositiveSize2D ext = xfrm.getExt(); // 尺寸
@@ -50,7 +53,7 @@ public class Shape {
}
// 位置 水平位置
public static String getShapePositionLeft(org.pptx4j.pml.Shape sp) {
public static String getShapePositionLeft(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTTransform2D xfrm = sp.getSpPr().getXfrm();
if (xfrm != null) {
long x = xfrm.getOff().getX(); // 水平位置EMU
@@ -59,7 +62,7 @@ public class Shape {
return "";
}
// 位置 垂直位置
public static String getShapePositionTop(org.pptx4j.pml.Shape sp) {
public static String getShapePositionTop(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTTransform2D xfrm = sp.getSpPr().getXfrm();
if (xfrm != null) {
long y = xfrm.getOff().getY(); // 垂直位置EMU
@@ -69,13 +72,13 @@ public class Shape {
}
// 形状填充 填充方式
public static String getShapeFillType(org.pptx4j.pml.Shape sp) {
public static String getShapeFillType(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTShapeProperties spPr = sp.getSpPr();
return SlideUtils.getFillType(spPr);
}
// 形状填充 纯色填充-颜色
public static String getShapeFillSolidColor(org.pptx4j.pml.Shape sp) {
public static String getShapeFillSolidColor(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTShapeProperties spPr = sp.getSpPr();
if (spPr != null && spPr.getSolidFill() != null) {
return SlideUtils.getSolidFillColor(spPr.getSolidFill());
@@ -84,7 +87,7 @@ public class Shape {
}
// 形状填充 渐变填充-效果
public static String getShapeFillGradientType(org.pptx4j.pml.Shape sp) {
public static String getShapeFillGradientType(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTShapeProperties spPr = sp.getSpPr();
if (spPr != null && spPr.getGradFill() != null) {
@@ -95,7 +98,7 @@ public class Shape {
}
// 形状填充 图片填充-效果
public static String getShapeFillPictureType(org.pptx4j.pml.Shape sp){
public static String getShapeFillPictureType(org.pptx4j.pml.Shape sp, CTSlideTiming timing){
CTShapeProperties spPr = sp.getSpPr();
if (spPr != null && spPr.getBlipFill() != null) {
@@ -106,7 +109,7 @@ public class Shape {
}
// 形状填充 纹理填充-效果
public static String getShapeFillTextureType(org.pptx4j.pml.Shape sp) {
public static String getShapeFillTextureType(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTShapeProperties spPr = sp.getSpPr();
if (spPr != null && spPr.getPattFill() != null) {
return SlideUtils.printPatternFill(spPr.getPattFill());
@@ -115,7 +118,7 @@ public class Shape {
}
// 形状填充 图案填充-效果
public static String getShapeFillPatternType(org.pptx4j.pml.Shape sp) {
public static String getShapeFillPatternType(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTShapeProperties spPr = sp.getSpPr();
if (spPr != null && spPr.getPattFill() != null) {
return spPr.getPattFill().getPrst().value();
@@ -124,17 +127,17 @@ public class Shape {
}
// 形状填充 幻灯片背景填充-效果
public static String getShapeFillSlideBackgroundType(org.pptx4j.pml.Shape sp) {
public static String getShapeFillSlideBackgroundType(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
return "";
}
// 形状填充 填充透明度
public static String getShapeFillOpacity(org.pptx4j.pml.Shape sp) {
public static String getShapeFillOpacity(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
return "";
}
// 形状线条 绘制
public static String getShapeLineDraw(org.pptx4j.pml.Shape sp) {
public static String getShapeLineDraw(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTShapeProperties spPr = sp.getSpPr();
if (spPr != null && spPr.getLn() != null) {
@@ -166,7 +169,7 @@ public class Shape {
}
// 形状线条 线条颜色
public static String getShapeLineColor(org.pptx4j.pml.Shape sp) {
public static String getShapeLineColor(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTShapeProperties spPr = sp.getSpPr();
if (spPr != null && spPr.getLn() != null) {
@@ -181,7 +184,7 @@ public class Shape {
}
// 形状线条 线条宽度
public static String getShapeLineWidth(org.pptx4j.pml.Shape sp) {
public static String getShapeLineWidth(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTShapeProperties spPr = sp.getSpPr();
if (spPr != null && spPr.getLn() != null) {
@@ -194,13 +197,13 @@ public class Shape {
}
// 形状线条 透明度
public static String getShapeLineOpacity(org.pptx4j.pml.Shape sp) {
public static String getShapeLineOpacity(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
return "";
}
// 形状线条 复合类型
public static String getStrokeCompound(org.pptx4j.pml.Shape sp) {
public static String getStrokeCompound(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
if (sp == null || sp.getSpPr() == null) return "未定义";
CTShapeProperties spPr = sp.getSpPr();
CTLineProperties ln = spPr.getLn();
@@ -219,7 +222,7 @@ public class Shape {
}
// 形状线条 短划线类型
public static String getStrokeDash(org.pptx4j.pml.Shape sp) {
public static String getStrokeDash(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
if (sp == null || sp.getSpPr() == null) return "solid";
CTShapeProperties spPr = sp.getSpPr();
CTLineProperties ln = spPr.getLn();
@@ -248,7 +251,7 @@ public class Shape {
// 形状效果 阴影-绘制
public static String getShapeShadowDraw(org.pptx4j.pml.Shape sp) {
public static String getShapeShadowDraw(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTShapeProperties spPr = sp.getSpPr();
CTEffectList effList = spPr.getEffectLst();
if (effList == null) {
@@ -261,7 +264,7 @@ public class Shape {
}
// 形状效果 阴影-效果
public static String getShapeShadowEffect(org.pptx4j.pml.Shape sp) {
public static String getShapeShadowEffect(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
if (sp == null || sp.getSpPr() == null) {
return "无阴影";
}
@@ -282,7 +285,7 @@ public class Shape {
}
// 形状效果 倒影-绘制
public static String getShapeReflectionDraw(org.pptx4j.pml.Shape sp) {
public static String getShapeReflectionDraw(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTShapeProperties spPr = sp.getSpPr();
CTEffectList effList = spPr.getEffectLst();
if (effList == null) {
@@ -298,7 +301,7 @@ public class Shape {
}
// 形状效果 倒影-效果
public static String getShapeReflectionEffect(org.pptx4j.pml.Shape sp) {
public static String getShapeReflectionEffect(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTReflectionEffect r = SlideUtils.getReflection(sp);
if (r == null) return "无倒影";
@@ -324,12 +327,42 @@ public class Shape {
}
// 形状效果 发光
public static String getShapeGlow(org.pptx4j.pml.Shape sp) {
public static String getShapeGlow(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
if (sp == null || sp.getSpPr() == null) return null;
CTShapeProperties spPr = sp.getSpPr();
CTEffectList eff = spPr.getEffectLst();
return (eff != null) ? eff.getGlow().toString() : null;
}
// 形状效果 发光-效果
public static String getShapeGlowEffect(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
return "待开发";
}
// 形状效果 柔化边缘-绘制
public static String getShapeSoftEdgesDraw(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
CTSoftEdgesEffect se = getSoftEdge(sp);
return (se != null) ? "" : "";
}
/* —— 内部spPr/effectLst/softEdge —— */
private static CTSoftEdgesEffect getSoftEdge(org.pptx4j.pml.Shape shape) {
if (shape == null || shape.getSpPr() == null) return null;
CTShapeProperties spPr = shape.getSpPr();
CTEffectList eff = spPr.getEffectLst();
return (eff != null) ? eff.getSoftEdge() : null;
// 说明极少数文件把效果写在 effectDag若拿不到再补 effectDag 解析
}
// 动画 效果
public static String getAnimation(org.pptx4j.pml.Shape sp, CTSlideTiming timing) {
// 获取形状中的ID
if (sp == null) return "无动画";
long spId = sp.getNvSpPr().getCNvPr().getId();
// 获取动画效果
return "";
}
}