diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/biz/service/impl/HomeworkBizServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/biz/service/impl/HomeworkBizServiceImpl.java index 487796ba..c1e4ea8a 100644 --- a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/biz/service/impl/HomeworkBizServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/biz/service/impl/HomeworkBizServiceImpl.java @@ -11,6 +11,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import lombok.extern.slf4j.Slf4j; + +import java.util.ArrayList; import java.util.List; @@ -24,7 +26,11 @@ public class HomeworkBizServiceImpl extends ServiceImpl listByCourseId(String courseId) { List homeworkIds = entityLinkBizService.listTargetIds(EntityLinkConst.SourceType.COURSE, courseId, EntityLinkConst.TargetType.HOMEWORK); - return this.listByIds(homeworkIds); + if (homeworkIds.size() > 0) { + return this.listByIds(homeworkIds); + } else { + return new ArrayList<>(); + } } } diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/controller/QuestionController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/controller/QuestionController.java new file mode 100644 index 00000000..88cc0a21 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/controller/QuestionController.java @@ -0,0 +1,182 @@ +package org.jeecg.modules.gen.question.controller; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +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.gen.question.entity.Question; +import org.jeecg.modules.gen.question.service.IQuestionService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +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.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + /** + * @Description: 题目 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +@Tag(name="题目") +@RestController +@RequestMapping("/gen/question/question") +@Slf4j +public class QuestionController extends JeecgController { + @Autowired + private IQuestionService questionService; + + /** + * 分页列表查询 + * + * @param question + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "题目-分页列表查询") + @Operation(summary="题目-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(Question question, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + + + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(question, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = questionService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param question + * @return + */ + @AutoLog(value = "题目-添加") + @Operation(summary="题目-添加") + @RequiresPermissions("gen.question:question:add") + @PostMapping(value = "/add") + public Result add(@RequestBody Question question) { + questionService.save(question); + + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param question + * @return + */ + @AutoLog(value = "题目-编辑") + @Operation(summary="题目-编辑") + @RequiresPermissions("gen.question:question:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody Question question) { + questionService.updateById(question); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "题目-通过id删除") + @Operation(summary="题目-通过id删除") + @RequiresPermissions("gen.question:question:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + questionService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "题目-批量删除") + @Operation(summary="题目-批量删除") + @RequiresPermissions("gen.question:question:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.questionService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "题目-通过id查询") + @Operation(summary="题目-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + Question question = questionService.getById(id); + if(question==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(question); + } + + /** + * 导出excel + * + * @param request + * @param question + */ + @RequiresPermissions("gen.question:question:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, Question question) { + return super.exportXls(request, question, Question.class, "题目"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("gen.question:question:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, Question.class); + } + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/entity/Question.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/entity/Question.java new file mode 100644 index 00000000..3f692b79 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/entity/Question.java @@ -0,0 +1,82 @@ +package org.jeecg.modules.gen.question.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import org.jeecg.common.constant.ProvinceCityArea; +import org.jeecg.common.util.SpringContextUtils; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 题目 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +@Data +@TableName("question") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@Schema(description="题目") +public class Question implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @Schema(description = "主键") + private java.lang.String id; + /**父题目id*/ + @Excel(name = "父题目id", width = 15) + @Schema(description = "父题目id") + private java.lang.String parentId; + /**题目类型*/ + @Excel(name = "题目类型", width = 15, dicCode = "question_type") + @Dict(dicCode = "question_type") + @Schema(description = "题目类型") + private java.lang.Integer type; + /**题干*/ + @Excel(name = "题干", width = 15) + @Schema(description = "题干") + private java.lang.String content; + /**题目解析*/ + @Excel(name = "题目解析", width = 15) + @Schema(description = "题目解析") + private java.lang.String analysis; + /**难度*/ + @Excel(name = "难度", width = 15, dicCode = "question_difficulty") + @Dict(dicCode = "question_difficulty") + @Schema(description = "难度") + private java.lang.Integer difficulty; + /**分值*/ + @Excel(name = "分值", width = 15) + @Schema(description = "分值") + private java.lang.Integer score; + /**创建人*/ + @Schema(description = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @Schema(description = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @Schema(description = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @Schema(description = "更新日期") + private java.util.Date updateTime; +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/mapper/QuestionMapper.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/mapper/QuestionMapper.java new file mode 100644 index 00000000..c50793c1 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/mapper/QuestionMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.gen.question.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.gen.question.entity.Question; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 题目 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +public interface QuestionMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/mapper/xml/QuestionMapper.xml b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/mapper/xml/QuestionMapper.xml new file mode 100644 index 00000000..46b9e463 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/mapper/xml/QuestionMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/service/IQuestionService.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/service/IQuestionService.java new file mode 100644 index 00000000..585461d7 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/service/IQuestionService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.gen.question.service; + +import org.jeecg.modules.gen.question.entity.Question; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 题目 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +public interface IQuestionService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/service/impl/QuestionServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/service/impl/QuestionServiceImpl.java new file mode 100644 index 00000000..f8d15f49 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/question/service/impl/QuestionServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.gen.question.service.impl; + +import org.jeecg.modules.gen.question.entity.Question; +import org.jeecg.modules.gen.question.mapper.QuestionMapper; +import org.jeecg.modules.gen.question.service.IQuestionService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 题目 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +@Service +public class QuestionServiceImpl extends ServiceImpl implements IQuestionService { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/controller/QuestionAnswerController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/controller/QuestionAnswerController.java new file mode 100644 index 00000000..2433c4ef --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/controller/QuestionAnswerController.java @@ -0,0 +1,182 @@ +package org.jeecg.modules.gen.questionanswer.controller; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +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.gen.questionanswer.entity.QuestionAnswer; +import org.jeecg.modules.gen.questionanswer.service.IQuestionAnswerService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +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.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + /** + * @Description: 题目答案 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +@Tag(name="题目答案") +@RestController +@RequestMapping("/gen/questionanswer/questionAnswer") +@Slf4j +public class QuestionAnswerController extends JeecgController { + @Autowired + private IQuestionAnswerService questionAnswerService; + + /** + * 分页列表查询 + * + * @param questionAnswer + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "题目答案-分页列表查询") + @Operation(summary="题目答案-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(QuestionAnswer questionAnswer, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + + + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(questionAnswer, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = questionAnswerService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param questionAnswer + * @return + */ + @AutoLog(value = "题目答案-添加") + @Operation(summary="题目答案-添加") + @RequiresPermissions("gen.questionanswer:question_answer:add") + @PostMapping(value = "/add") + public Result add(@RequestBody QuestionAnswer questionAnswer) { + questionAnswerService.save(questionAnswer); + + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param questionAnswer + * @return + */ + @AutoLog(value = "题目答案-编辑") + @Operation(summary="题目答案-编辑") + @RequiresPermissions("gen.questionanswer:question_answer:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody QuestionAnswer questionAnswer) { + questionAnswerService.updateById(questionAnswer); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "题目答案-通过id删除") + @Operation(summary="题目答案-通过id删除") + @RequiresPermissions("gen.questionanswer:question_answer:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + questionAnswerService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "题目答案-批量删除") + @Operation(summary="题目答案-批量删除") + @RequiresPermissions("gen.questionanswer:question_answer:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.questionAnswerService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "题目答案-通过id查询") + @Operation(summary="题目答案-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + QuestionAnswer questionAnswer = questionAnswerService.getById(id); + if(questionAnswer==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(questionAnswer); + } + + /** + * 导出excel + * + * @param request + * @param questionAnswer + */ + @RequiresPermissions("gen.questionanswer:question_answer:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, QuestionAnswer questionAnswer) { + return super.exportXls(request, questionAnswer, QuestionAnswer.class, "题目答案"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("gen.questionanswer:question_answer:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, QuestionAnswer.class); + } + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/entity/QuestionAnswer.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/entity/QuestionAnswer.java new file mode 100644 index 00000000..ca1dd5a8 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/entity/QuestionAnswer.java @@ -0,0 +1,68 @@ +package org.jeecg.modules.gen.questionanswer.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import org.jeecg.common.constant.ProvinceCityArea; +import org.jeecg.common.util.SpringContextUtils; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 题目答案 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +@Data +@TableName("question_answer") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@Schema(description="题目答案") +public class QuestionAnswer implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @Schema(description = "主键") + private java.lang.String id; + /**题目id*/ + @Excel(name = "题目id", width = 15) + @Schema(description = "题目id") + private java.lang.String questionId; + /**答案内容*/ + @Excel(name = "答案内容", width = 15) + @Schema(description = "答案内容") + private java.lang.String answerText; + /**序号*/ + @Excel(name = "序号", width = 15) + @Schema(description = "序号") + private java.lang.Integer orderNo; + /**创建人*/ + @Schema(description = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @Schema(description = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @Schema(description = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @Schema(description = "更新日期") + private java.util.Date updateTime; +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/mapper/QuestionAnswerMapper.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/mapper/QuestionAnswerMapper.java new file mode 100644 index 00000000..e0448454 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/mapper/QuestionAnswerMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.gen.questionanswer.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.gen.questionanswer.entity.QuestionAnswer; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 题目答案 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +public interface QuestionAnswerMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/mapper/xml/QuestionAnswerMapper.xml b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/mapper/xml/QuestionAnswerMapper.xml new file mode 100644 index 00000000..84e8c75c --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/mapper/xml/QuestionAnswerMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/service/IQuestionAnswerService.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/service/IQuestionAnswerService.java new file mode 100644 index 00000000..1c84c08d --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/service/IQuestionAnswerService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.gen.questionanswer.service; + +import org.jeecg.modules.gen.questionanswer.entity.QuestionAnswer; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 题目答案 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +public interface IQuestionAnswerService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/service/impl/QuestionAnswerServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/service/impl/QuestionAnswerServiceImpl.java new file mode 100644 index 00000000..236c4465 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionanswer/service/impl/QuestionAnswerServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.gen.questionanswer.service.impl; + +import org.jeecg.modules.gen.questionanswer.entity.QuestionAnswer; +import org.jeecg.modules.gen.questionanswer.mapper.QuestionAnswerMapper; +import org.jeecg.modules.gen.questionanswer.service.IQuestionAnswerService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 题目答案 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +@Service +public class QuestionAnswerServiceImpl extends ServiceImpl implements IQuestionAnswerService { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/controller/QuestionOptionController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/controller/QuestionOptionController.java new file mode 100644 index 00000000..ca9eed42 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/controller/QuestionOptionController.java @@ -0,0 +1,182 @@ +package org.jeecg.modules.gen.questionoption.controller; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +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.gen.questionoption.entity.QuestionOption; +import org.jeecg.modules.gen.questionoption.service.IQuestionOptionService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +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.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + /** + * @Description: 题目选项 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +@Tag(name="题目选项") +@RestController +@RequestMapping("/gen/questionoption/questionOption") +@Slf4j +public class QuestionOptionController extends JeecgController { + @Autowired + private IQuestionOptionService questionOptionService; + + /** + * 分页列表查询 + * + * @param questionOption + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "题目选项-分页列表查询") + @Operation(summary="题目选项-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(QuestionOption questionOption, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + + + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(questionOption, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = questionOptionService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param questionOption + * @return + */ + @AutoLog(value = "题目选项-添加") + @Operation(summary="题目选项-添加") + @RequiresPermissions("gen.questionoption:question_option:add") + @PostMapping(value = "/add") + public Result add(@RequestBody QuestionOption questionOption) { + questionOptionService.save(questionOption); + + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param questionOption + * @return + */ + @AutoLog(value = "题目选项-编辑") + @Operation(summary="题目选项-编辑") + @RequiresPermissions("gen.questionoption:question_option:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody QuestionOption questionOption) { + questionOptionService.updateById(questionOption); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "题目选项-通过id删除") + @Operation(summary="题目选项-通过id删除") + @RequiresPermissions("gen.questionoption:question_option:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + questionOptionService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "题目选项-批量删除") + @Operation(summary="题目选项-批量删除") + @RequiresPermissions("gen.questionoption:question_option:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.questionOptionService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "题目选项-通过id查询") + @Operation(summary="题目选项-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + QuestionOption questionOption = questionOptionService.getById(id); + if(questionOption==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(questionOption); + } + + /** + * 导出excel + * + * @param request + * @param questionOption + */ + @RequiresPermissions("gen.questionoption:question_option:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, QuestionOption questionOption) { + return super.exportXls(request, questionOption, QuestionOption.class, "题目选项"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("gen.questionoption:question_option:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, QuestionOption.class); + } + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/entity/QuestionOption.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/entity/QuestionOption.java new file mode 100644 index 00000000..3c22231e --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/entity/QuestionOption.java @@ -0,0 +1,72 @@ +package org.jeecg.modules.gen.questionoption.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import org.jeecg.common.constant.ProvinceCityArea; +import org.jeecg.common.util.SpringContextUtils; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 题目选项 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +@Data +@TableName("question_option") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@Schema(description="题目选项") +public class QuestionOption implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @Schema(description = "主键") + private java.lang.String id; + /**题目id*/ + @Excel(name = "题目id", width = 15) + @Schema(description = "题目id") + private java.lang.String questionId; + /**选项内容*/ + @Excel(name = "选项内容", width = 15) + @Schema(description = "选项内容") + private java.lang.String content; + /**是否正确答案*/ + @Excel(name = "是否正确答案", width = 15) + @Schema(description = "是否正确答案") + private java.lang.Integer izCorrent; + /**序号*/ + @Excel(name = "序号", width = 15) + @Schema(description = "序号") + private java.lang.Integer orderNo; + /**创建人*/ + @Schema(description = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @Schema(description = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @Schema(description = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @Schema(description = "更新日期") + private java.util.Date updateTime; +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/mapper/QuestionOptionMapper.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/mapper/QuestionOptionMapper.java new file mode 100644 index 00000000..0b9d8827 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/mapper/QuestionOptionMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.gen.questionoption.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.gen.questionoption.entity.QuestionOption; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 题目选项 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +public interface QuestionOptionMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/mapper/xml/QuestionOptionMapper.xml b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/mapper/xml/QuestionOptionMapper.xml new file mode 100644 index 00000000..2a1c69a7 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/mapper/xml/QuestionOptionMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/service/IQuestionOptionService.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/service/IQuestionOptionService.java new file mode 100644 index 00000000..667f35bb --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/service/IQuestionOptionService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.gen.questionoption.service; + +import org.jeecg.modules.gen.questionoption.entity.QuestionOption; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 题目选项 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +public interface IQuestionOptionService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/service/impl/QuestionOptionServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/service/impl/QuestionOptionServiceImpl.java new file mode 100644 index 00000000..d3fc93df --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionoption/service/impl/QuestionOptionServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.gen.questionoption.service.impl; + +import org.jeecg.modules.gen.questionoption.entity.QuestionOption; +import org.jeecg.modules.gen.questionoption.mapper.QuestionOptionMapper; +import org.jeecg.modules.gen.questionoption.service.IQuestionOptionService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 题目选项 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +@Service +public class QuestionOptionServiceImpl extends ServiceImpl implements IQuestionOptionService { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/controller/QuestionRepoController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/controller/QuestionRepoController.java new file mode 100644 index 00000000..b85f2db2 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/controller/QuestionRepoController.java @@ -0,0 +1,182 @@ +package org.jeecg.modules.gen.questionrepo.controller; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +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.gen.questionrepo.entity.QuestionRepo; +import org.jeecg.modules.gen.questionrepo.service.IQuestionRepoService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +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.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + /** + * @Description: 题库题目 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +@Tag(name="题库题目") +@RestController +@RequestMapping("/gen/questionrepo/questionRepo") +@Slf4j +public class QuestionRepoController extends JeecgController { + @Autowired + private IQuestionRepoService questionRepoService; + + /** + * 分页列表查询 + * + * @param questionRepo + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "题库题目-分页列表查询") + @Operation(summary="题库题目-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(QuestionRepo questionRepo, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + + + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(questionRepo, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = questionRepoService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param questionRepo + * @return + */ + @AutoLog(value = "题库题目-添加") + @Operation(summary="题库题目-添加") + @RequiresPermissions("gen.questionrepo:question_repo:add") + @PostMapping(value = "/add") + public Result add(@RequestBody QuestionRepo questionRepo) { + questionRepoService.save(questionRepo); + + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param questionRepo + * @return + */ + @AutoLog(value = "题库题目-编辑") + @Operation(summary="题库题目-编辑") + @RequiresPermissions("gen.questionrepo:question_repo:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody QuestionRepo questionRepo) { + questionRepoService.updateById(questionRepo); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "题库题目-通过id删除") + @Operation(summary="题库题目-通过id删除") + @RequiresPermissions("gen.questionrepo:question_repo:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + questionRepoService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "题库题目-批量删除") + @Operation(summary="题库题目-批量删除") + @RequiresPermissions("gen.questionrepo:question_repo:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.questionRepoService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "题库题目-通过id查询") + @Operation(summary="题库题目-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + QuestionRepo questionRepo = questionRepoService.getById(id); + if(questionRepo==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(questionRepo); + } + + /** + * 导出excel + * + * @param request + * @param questionRepo + */ + @RequiresPermissions("gen.questionrepo:question_repo:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, QuestionRepo questionRepo) { + return super.exportXls(request, questionRepo, QuestionRepo.class, "题库题目"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("gen.questionrepo:question_repo:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, QuestionRepo.class); + } + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/entity/QuestionRepo.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/entity/QuestionRepo.java new file mode 100644 index 00000000..7ec0cc82 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/entity/QuestionRepo.java @@ -0,0 +1,64 @@ +package org.jeecg.modules.gen.questionrepo.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import org.jeecg.common.constant.ProvinceCityArea; +import org.jeecg.common.util.SpringContextUtils; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 题库题目 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +@Data +@TableName("question_repo") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@Schema(description="题库题目") +public class QuestionRepo implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @Schema(description = "主键") + private java.lang.String id; + /**题库id*/ + @Excel(name = "题库id", width = 15) + @Schema(description = "题库id") + private java.lang.String repoId; + /**题目id*/ + @Excel(name = "题目id", width = 15) + @Schema(description = "题目id") + private java.lang.String questionId; + /**创建人*/ + @Schema(description = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @Schema(description = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @Schema(description = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @Schema(description = "更新日期") + private java.util.Date updateTime; +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/mapper/QuestionRepoMapper.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/mapper/QuestionRepoMapper.java new file mode 100644 index 00000000..466bff47 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/mapper/QuestionRepoMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.gen.questionrepo.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.gen.questionrepo.entity.QuestionRepo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 题库题目 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +public interface QuestionRepoMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/mapper/xml/QuestionRepoMapper.xml b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/mapper/xml/QuestionRepoMapper.xml new file mode 100644 index 00000000..45fabdf1 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/mapper/xml/QuestionRepoMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/service/IQuestionRepoService.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/service/IQuestionRepoService.java new file mode 100644 index 00000000..91f49f67 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/service/IQuestionRepoService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.gen.questionrepo.service; + +import org.jeecg.modules.gen.questionrepo.entity.QuestionRepo; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 题库题目 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +public interface IQuestionRepoService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/service/impl/QuestionRepoServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/service/impl/QuestionRepoServiceImpl.java new file mode 100644 index 00000000..b5de21a0 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/questionrepo/service/impl/QuestionRepoServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.gen.questionrepo.service.impl; + +import org.jeecg.modules.gen.questionrepo.entity.QuestionRepo; +import org.jeecg.modules.gen.questionrepo.mapper.QuestionRepoMapper; +import org.jeecg.modules.gen.questionrepo.service.IQuestionRepoService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 题库题目 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +@Service +public class QuestionRepoServiceImpl extends ServiceImpl implements IQuestionRepoService { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/controller/RepoController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/controller/RepoController.java new file mode 100644 index 00000000..cdf89a45 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/controller/RepoController.java @@ -0,0 +1,182 @@ +package org.jeecg.modules.gen.repo.controller; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +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.gen.repo.entity.Repo; +import org.jeecg.modules.gen.repo.service.IRepoService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +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.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + /** + * @Description: 题库 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +@Tag(name="题库") +@RestController +@RequestMapping("/gen/repo/repo") +@Slf4j +public class RepoController extends JeecgController { + @Autowired + private IRepoService repoService; + + /** + * 分页列表查询 + * + * @param repo + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "题库-分页列表查询") + @Operation(summary="题库-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(Repo repo, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + + + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(repo, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = repoService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param repo + * @return + */ + @AutoLog(value = "题库-添加") + @Operation(summary="题库-添加") + @RequiresPermissions("gen.repo:repo:add") + @PostMapping(value = "/add") + public Result add(@RequestBody Repo repo) { + repoService.save(repo); + + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param repo + * @return + */ + @AutoLog(value = "题库-编辑") + @Operation(summary="题库-编辑") + @RequiresPermissions("gen.repo:repo:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody Repo repo) { + repoService.updateById(repo); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "题库-通过id删除") + @Operation(summary="题库-通过id删除") + @RequiresPermissions("gen.repo:repo:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + repoService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "题库-批量删除") + @Operation(summary="题库-批量删除") + @RequiresPermissions("gen.repo:repo:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.repoService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "题库-通过id查询") + @Operation(summary="题库-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + Repo repo = repoService.getById(id); + if(repo==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(repo); + } + + /** + * 导出excel + * + * @param request + * @param repo + */ + @RequiresPermissions("gen.repo:repo:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, Repo repo) { + return super.exportXls(request, repo, Repo.class, "题库"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("gen.repo:repo:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, Repo.class); + } + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/entity/Repo.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/entity/Repo.java new file mode 100644 index 00000000..7f149689 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/entity/Repo.java @@ -0,0 +1,68 @@ +package org.jeecg.modules.gen.repo.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import org.jeecg.common.constant.ProvinceCityArea; +import org.jeecg.common.util.SpringContextUtils; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 题库 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +@Data +@TableName("repo") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@Schema(description="题库") +public class Repo implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @Schema(description = "主键") + private java.lang.String id; + /**题库名称*/ + @Excel(name = "题库名称", width = 15) + @Schema(description = "题库名称") + private java.lang.String title; + /**题库备注*/ + @Excel(name = "题库备注", width = 15) + @Schema(description = "题库备注") + private java.lang.String remark; + /**题目数量*/ + @Excel(name = "题目数量", width = 15) + @Schema(description = "题目数量") + private java.lang.Integer questionCount; + /**创建人*/ + @Schema(description = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @Schema(description = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @Schema(description = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @Schema(description = "更新日期") + private java.util.Date updateTime; +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/mapper/RepoMapper.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/mapper/RepoMapper.java new file mode 100644 index 00000000..1b542226 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/mapper/RepoMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.gen.repo.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.gen.repo.entity.Repo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 题库 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +public interface RepoMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/mapper/xml/RepoMapper.xml b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/mapper/xml/RepoMapper.xml new file mode 100644 index 00000000..7130e373 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/mapper/xml/RepoMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/service/IRepoService.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/service/IRepoService.java new file mode 100644 index 00000000..6b596862 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/service/IRepoService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.gen.repo.service; + +import org.jeecg.modules.gen.repo.entity.Repo; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 题库 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +public interface IRepoService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/service/impl/RepoServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/service/impl/RepoServiceImpl.java new file mode 100644 index 00000000..3c75e0e7 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-learn/src/main/java/org/jeecg/modules/gen/repo/service/impl/RepoServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.gen.repo.service.impl; + +import org.jeecg.modules.gen.repo.entity.Repo; +import org.jeecg.modules.gen.repo.mapper.RepoMapper; +import org.jeecg.modules.gen.repo.service.IRepoService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 题库 + * @Author: jeecg-boot + * @Date: 2025-08-21 + * @Version: V1.0 + */ +@Service +public class RepoServiceImpl extends ServiceImpl implements IRepoService { + +} diff --git a/jeecgboot-vue3/src/views/gen/question/Question.api.ts b/jeecgboot-vue3/src/views/gen/question/Question.api.ts new file mode 100644 index 00000000..e17b77c7 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/question/Question.api.ts @@ -0,0 +1,64 @@ +import {defHttp} from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/gen/question/question/list', + save='/gen/question/question/add', + edit='/gen/question/question/edit', + deleteOne = '/gen/question/question/delete', + deleteBatch = '/gen/question/question/deleteBatch', + importExcel = '/gen/question/question/importExcel', + exportXls = '/gen/question/question/exportXls', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecgboot-vue3/src/views/gen/question/Question.data.ts b/jeecgboot-vue3/src/views/gen/question/Question.data.ts new file mode 100644 index 00000000..88a27ad2 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/question/Question.data.ts @@ -0,0 +1,106 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +import { getWeekMonthQuarterYear } from '/@/utils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '父题目id', + align:"center", + dataIndex: 'parentId' + }, + { + title: '题目类型', + align:"center", + dataIndex: 'type_dictText' + }, + { + title: '题干', + align:"center", + dataIndex: 'content', + }, + { + title: '题目解析', + align:"center", + dataIndex: 'analysis', + }, + { + title: '难度', + align:"center", + dataIndex: 'difficulty_dictText' + }, + { + title: '分值', + align:"center", + dataIndex: 'score' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '父题目id', + field: 'parentId', + component: 'Input', + }, + { + label: '题目类型', + field: 'type', + component: 'JDictSelectTag', + componentProps:{ + dictCode:"question_type" + }, + }, + { + label: '题干', + field: 'content', + component: 'JEditor', + }, + { + label: '题目解析', + field: 'analysis', + component: 'JEditor', + }, + { + label: '难度', + field: 'difficulty', + component: 'JDictSelectTag', + componentProps:{ + dictCode:"question_difficulty" + }, + }, + { + label: '分值', + field: 'score', + component: 'InputNumber', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + parentId: {title: '父题目id',order: 0,view: 'text', type: 'string',}, + type: {title: '题目类型',order: 1,view: 'number', type: 'number',dictCode: 'question_type',}, + content: {title: '题干',order: 2,view: 'umeditor', type: 'string',}, + analysis: {title: '题目解析',order: 3,view: 'umeditor', type: 'string',}, + difficulty: {title: '难度',order: 4,view: 'number', type: 'number',dictCode: 'question_difficulty',}, + score: {title: '分值',order: 5,view: 'number', type: 'number',}, +}; + +/** +* 流程表单调用这个方法获取formSchema +* @param param +*/ +export function getBpmFormSchema(_formData): FormSchema[]{ + // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema + return formSchema; +} \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/gen/question/QuestionList.vue b/jeecgboot-vue3/src/views/gen/question/QuestionList.vue new file mode 100644 index 00000000..42f99eb5 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/question/QuestionList.vue @@ -0,0 +1,214 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/gen/question/components/QuestionForm.vue b/jeecgboot-vue3/src/views/gen/question/components/QuestionForm.vue new file mode 100644 index 00000000..8ec12081 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/question/components/QuestionForm.vue @@ -0,0 +1,70 @@ + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/gen/question/components/QuestionModal.vue b/jeecgboot-vue3/src/views/gen/question/components/QuestionModal.vue new file mode 100644 index 00000000..824c3ace --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/question/components/QuestionModal.vue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/gen/questionanswer/QuestionAnswer.api.ts b/jeecgboot-vue3/src/views/gen/questionanswer/QuestionAnswer.api.ts new file mode 100644 index 00000000..d53dff40 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/questionanswer/QuestionAnswer.api.ts @@ -0,0 +1,64 @@ +import {defHttp} from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/gen/questionanswer/questionAnswer/list', + save='/gen/questionanswer/questionAnswer/add', + edit='/gen/questionanswer/questionAnswer/edit', + deleteOne = '/gen/questionanswer/questionAnswer/delete', + deleteBatch = '/gen/questionanswer/questionAnswer/deleteBatch', + importExcel = '/gen/questionanswer/questionAnswer/importExcel', + exportXls = '/gen/questionanswer/questionAnswer/exportXls', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecgboot-vue3/src/views/gen/questionanswer/QuestionAnswer.data.ts b/jeecgboot-vue3/src/views/gen/questionanswer/QuestionAnswer.data.ts new file mode 100644 index 00000000..a96a44c5 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/questionanswer/QuestionAnswer.data.ts @@ -0,0 +1,67 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +import { getWeekMonthQuarterYear } from '/@/utils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '题目id', + align:"center", + dataIndex: 'questionId' + }, + { + title: '答案内容', + align:"center", + dataIndex: 'answerText' + }, + { + title: '序号', + align:"center", + dataIndex: 'orderNo' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '题目id', + field: 'questionId', + component: 'Input', + }, + { + label: '答案内容', + field: 'answerText', + component: 'Input', + }, + { + label: '序号', + field: 'orderNo', + component: 'InputNumber', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + questionId: {title: '题目id',order: 0,view: 'text', type: 'string',}, + answerText: {title: '答案内容',order: 1,view: 'text', type: 'string',}, + orderNo: {title: '序号',order: 2,view: 'number', type: 'number',}, +}; + +/** +* 流程表单调用这个方法获取formSchema +* @param param +*/ +export function getBpmFormSchema(_formData): FormSchema[]{ + // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema + return formSchema; +} \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/gen/questionanswer/QuestionAnswerList.vue b/jeecgboot-vue3/src/views/gen/questionanswer/QuestionAnswerList.vue new file mode 100644 index 00000000..c503ddb5 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/questionanswer/QuestionAnswerList.vue @@ -0,0 +1,206 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/gen/questionanswer/components/QuestionAnswerForm.vue b/jeecgboot-vue3/src/views/gen/questionanswer/components/QuestionAnswerForm.vue new file mode 100644 index 00000000..284df930 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/questionanswer/components/QuestionAnswerForm.vue @@ -0,0 +1,70 @@ + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/gen/questionanswer/components/QuestionAnswerModal.vue b/jeecgboot-vue3/src/views/gen/questionanswer/components/QuestionAnswerModal.vue new file mode 100644 index 00000000..dbbd975d --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/questionanswer/components/QuestionAnswerModal.vue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/gen/questionoption/QuestionOption.api.ts b/jeecgboot-vue3/src/views/gen/questionoption/QuestionOption.api.ts new file mode 100644 index 00000000..15948647 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/questionoption/QuestionOption.api.ts @@ -0,0 +1,64 @@ +import {defHttp} from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/gen/questionoption/questionOption/list', + save='/gen/questionoption/questionOption/add', + edit='/gen/questionoption/questionOption/edit', + deleteOne = '/gen/questionoption/questionOption/delete', + deleteBatch = '/gen/questionoption/questionOption/deleteBatch', + importExcel = '/gen/questionoption/questionOption/importExcel', + exportXls = '/gen/questionoption/questionOption/exportXls', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecgboot-vue3/src/views/gen/questionoption/QuestionOption.data.ts b/jeecgboot-vue3/src/views/gen/questionoption/QuestionOption.data.ts new file mode 100644 index 00000000..1627a288 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/questionoption/QuestionOption.data.ts @@ -0,0 +1,78 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +import { getWeekMonthQuarterYear } from '/@/utils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '题目id', + align:"center", + dataIndex: 'questionId' + }, + { + title: '选项内容', + align:"center", + dataIndex: 'content' + }, + { + title: '是否正确答案', + align:"center", + dataIndex: 'izCorrent' + }, + { + title: '序号', + align:"center", + dataIndex: 'orderNo' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '题目id', + field: 'questionId', + component: 'Input', + }, + { + label: '选项内容', + field: 'content', + component: 'Input', + }, + { + label: '是否正确答案', + field: 'izCorrent', + component: 'InputNumber', + }, + { + label: '序号', + field: 'orderNo', + component: 'InputNumber', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + questionId: {title: '题目id',order: 0,view: 'text', type: 'string',}, + content: {title: '选项内容',order: 1,view: 'text', type: 'string',}, + izCorrent: {title: '是否正确答案',order: 2,view: 'number', type: 'number',}, + orderNo: {title: '序号',order: 3,view: 'number', type: 'number',}, +}; + +/** +* 流程表单调用这个方法获取formSchema +* @param param +*/ +export function getBpmFormSchema(_formData): FormSchema[]{ + // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema + return formSchema; +} \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/gen/questionoption/QuestionOptionList.vue b/jeecgboot-vue3/src/views/gen/questionoption/QuestionOptionList.vue new file mode 100644 index 00000000..3818a9e4 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/questionoption/QuestionOptionList.vue @@ -0,0 +1,206 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/gen/questionoption/components/QuestionOptionForm.vue b/jeecgboot-vue3/src/views/gen/questionoption/components/QuestionOptionForm.vue new file mode 100644 index 00000000..3d2de9b0 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/questionoption/components/QuestionOptionForm.vue @@ -0,0 +1,70 @@ + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/gen/questionoption/components/QuestionOptionModal.vue b/jeecgboot-vue3/src/views/gen/questionoption/components/QuestionOptionModal.vue new file mode 100644 index 00000000..ce9e1039 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/questionoption/components/QuestionOptionModal.vue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/gen/repo/Repo.api.ts b/jeecgboot-vue3/src/views/gen/repo/Repo.api.ts new file mode 100644 index 00000000..13d60100 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/repo/Repo.api.ts @@ -0,0 +1,64 @@ +import {defHttp} from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/gen/repo/repo/list', + save='/gen/repo/repo/add', + edit='/gen/repo/repo/edit', + deleteOne = '/gen/repo/repo/delete', + deleteBatch = '/gen/repo/repo/deleteBatch', + importExcel = '/gen/repo/repo/importExcel', + exportXls = '/gen/repo/repo/exportXls', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecgboot-vue3/src/views/gen/repo/Repo.data.ts b/jeecgboot-vue3/src/views/gen/repo/Repo.data.ts new file mode 100644 index 00000000..caa04b20 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/repo/Repo.data.ts @@ -0,0 +1,67 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +import { getWeekMonthQuarterYear } from '/@/utils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '题库名称', + align:"center", + dataIndex: 'title' + }, + { + title: '题库备注', + align:"center", + dataIndex: 'remark' + }, + { + title: '题目数量', + align:"center", + dataIndex: 'questionCount' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '题库名称', + field: 'title', + component: 'Input', + }, + { + label: '题库备注', + field: 'remark', + component: 'Input', + }, + { + label: '题目数量', + field: 'questionCount', + component: 'InputNumber', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + title: {title: '题库名称',order: 0,view: 'text', type: 'string',}, + remark: {title: '题库备注',order: 1,view: 'text', type: 'string',}, + questionCount: {title: '题目数量',order: 2,view: 'number', type: 'number',}, +}; + +/** +* 流程表单调用这个方法获取formSchema +* @param param +*/ +export function getBpmFormSchema(_formData): FormSchema[]{ + // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema + return formSchema; +} \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/gen/repo/RepoList.vue b/jeecgboot-vue3/src/views/gen/repo/RepoList.vue new file mode 100644 index 00000000..5eac03df --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/repo/RepoList.vue @@ -0,0 +1,206 @@ + + + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/gen/repo/components/RepoForm.vue b/jeecgboot-vue3/src/views/gen/repo/components/RepoForm.vue new file mode 100644 index 00000000..08143288 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/repo/components/RepoForm.vue @@ -0,0 +1,70 @@ + + + \ No newline at end of file diff --git a/jeecgboot-vue3/src/views/gen/repo/components/RepoModal.vue b/jeecgboot-vue3/src/views/gen/repo/components/RepoModal.vue new file mode 100644 index 00000000..dec4d331 --- /dev/null +++ b/jeecgboot-vue3/src/views/gen/repo/components/RepoModal.vue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file