From 7505a27317608c87da8b544ffbd5a05222b47812 Mon Sep 17 00:00:00 2001 From: Lqc Date: Mon, 22 Sep 2025 18:18:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E7=BB=83=E4=B9=A0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AiolExamRecordController.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolExamRecordController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolExamRecordController.java index ce9e39e8..bc52da9d 100644 --- a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolExamRecordController.java +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolExamRecordController.java @@ -14,7 +14,9 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryRuleEnum; import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.aiol.entity.AiolExamAnswer; import org.jeecg.modules.aiol.entity.AiolExamRecord; +import org.jeecg.modules.aiol.service.IAiolExamAnswerService; import org.jeecg.modules.aiol.service.IAiolExamRecordService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -29,6 +31,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams; import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.jeecg.common.system.base.controller.JeecgController; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; @@ -51,6 +54,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; public class AiolExamRecordController extends JeecgController { @Autowired private IAiolExamRecordService aiolExamRecordService; + @Autowired + private IAiolExamAnswerService aiolExamAnswerService; /** * 分页列表查询 @@ -101,7 +106,7 @@ public class AiolExamRecordController extends JeecgController edit(@RequestBody AiolExamRecord aiolExamRecord) { aiolExamRecordService.updateById(aiolExamRecord); return Result.OK("编辑成功!"); @@ -136,6 +141,18 @@ public class AiolExamRecordController extends JeecgController rePractice(@RequestParam String userId,@RequestParam String examId) { + aiolExamRecordService.remove(new QueryWrapper().eq("user_id", userId).eq("exam_id", examId)); + aiolExamAnswerService.remove(new QueryWrapper().eq("user_id", userId).eq("exam_id", examId)); + return Result.OK("请返回重新练习一次吧!"); + } /** * 通过id查询