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查询