From d9c60a21db51cdb5312a3d905c35c5ce208a3457 Mon Sep 17 00:00:00 2001 From: Lqc Date: Fri, 5 Sep 2025 20:12:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A2=98=E7=9B=AE=E6=97=B6?= =?UTF-8?q?=E6=9C=89=E9=A2=98=E5=BA=93id=E6=96=B0=E5=A2=9E=E5=88=B0?= =?UTF-8?q?=E9=A2=98=E5=BA=93=EF=BC=8C=E6=B2=A1=E6=9C=89=E9=A2=98=E5=BA=93?= =?UTF-8?q?id=E5=8F=AA=E5=AD=98=E5=85=A5=E9=A2=98=E7=9B=AE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aiol/controller/AiolQuestionController.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolQuestionController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolQuestionController.java index 912e6420..e549de26 100644 --- a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolQuestionController.java +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolQuestionController.java @@ -15,6 +15,8 @@ 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.AiolQuestion; +import org.jeecg.modules.aiol.entity.AiolQuestionRepo; +import org.jeecg.modules.aiol.service.IAiolQuestionRepoService; import org.jeecg.modules.aiol.service.IAiolQuestionService; 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 AiolQuestionController extends JeecgController { @Autowired private IAiolQuestionService aiolQuestionService; + @Autowired + private AiolQuestionRepoController aiolQuestionRepoController; /** * 分页列表查询 @@ -86,9 +91,16 @@ public class AiolQuestionController extends JeecgController add(@RequestBody AiolQuestion aiolQuestion) { + @Transactional + public Result add(@RequestBody AiolQuestion aiolQuestion,@RequestParam String repoId) { aiolQuestionService.save(aiolQuestion); - + //题库题目添加 + if(repoId!=null&& !repoId.isEmpty()){ + AiolQuestionRepo aiolQuestionRepo = new AiolQuestionRepo(); + aiolQuestionRepo.setRepoId(repoId); + aiolQuestionRepo.setQuestionId(aiolQuestion.getId()); + aiolQuestionRepoController.add(aiolQuestionRepo); + } return Result.OK("添加成功!"); }