Browse Source

Merge remote-tracking branch 'origin/dev' into dev

change 3 years ago
parent
commit
b97942774b

+ 54 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/bank/ExamController.java

@@ -0,0 +1,54 @@
+package com.zhongzheng.controller.bank;
+
+import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.modules.bank.bo.*;
+import com.zhongzheng.modules.bank.domain.QuestionBusiness;
+import com.zhongzheng.modules.bank.service.IExamQuestionService;
+import com.zhongzheng.modules.bank.service.IExamService;
+import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
+import com.zhongzheng.modules.bank.vo.ExamQuestionVo;
+import com.zhongzheng.modules.bank.vo.ExamVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 试卷Controller
+ *
+ * @author hjl
+ * @date 2021-10-22
+ */
+@Api(value = "试卷控制器", tags = {"试卷管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/bank/exam")
+public class ExamController extends BaseController {
+
+    private final IExamService iExamService;
+
+    private final IQuestionBusinessService iQuestionBusinessService;
+
+    private final IExamQuestionService iExamQuestionService;
+
+
+
+    /**
+     * 获取试卷详细信息
+     */
+    @ApiOperation("获取试卷详细信息")
+    @PreAuthorize("@ss.hasPermi('system:exam:query')")
+    @GetMapping("/{examId}")
+    public AjaxResult<ExamVo> getInfo(@PathVariable("examId" ) Long examId) {
+        return AjaxResult.success(iExamService.queryById(examId));
+    }
+
+}

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamAddBo.java

@@ -73,6 +73,6 @@ public class ExamAddBo {
     @ApiModelProperty("排序")
     private Integer sort;
     /** 做卷类型  1测试 2考试 */
-    @ApiModelProperty("做卷类型  1测试 2考试")
+    @ApiModelProperty("做卷类型  1练习 2考试")
     private Integer doType;
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamEditBo.java

@@ -92,7 +92,7 @@ public class ExamEditBo {
     private Integer sort;
 
     /** 做卷类型  1测试 2考试 */
-    @ApiModelProperty("做卷类型  1测试 2考试")
+    @ApiModelProperty("做卷类型  1练习 2考试")
     private Integer doType;
 
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionServiceImpl.java

@@ -151,7 +151,7 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
 
     private boolean checkNameUnique(CourseSection entity) {
         CourseSection info = getOne(new LambdaQueryWrapper<CourseSection>()
-                .eq(CourseSection::getPrefixName,entity.getPrefixName()).eq(CourseSection::getName,entity.getName()).last("limit 1"));
+                .eq(CourseSection::getPrefixName,entity.getPrefixName()).eq(CourseSection::getName,entity.getName()).ne(CourseSection::getStatus,-1).last("limit 1"));
         if (Validator.isNotNull(info)) {
             if(Validator.isNotEmpty(entity.getSectionId())){
                 if(entity.getSectionId() != info.getSectionId()){