瀏覽代碼

BUG修改

wangliang 2 年之前
父節點
當前提交
804d2e156d

+ 1 - 0
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamCourseController.java

@@ -56,6 +56,7 @@ public class TEExamCourseController {
             teExamCourseUpdateWrapper.lambda().set(TEExamCourse::getObjectiveShuffle, teExamCourse.getObjectiveShuffle())
             teExamCourseUpdateWrapper.lambda().set(TEExamCourse::getObjectiveShuffle, teExamCourse.getObjectiveShuffle())
                     .set(TEExamCourse::getOptionShuffle, teExamCourse.getOptionShuffle())
                     .set(TEExamCourse::getOptionShuffle, teExamCourse.getOptionShuffle())
                     .set(TEExamCourse::getUpdateId, tbUser.getId())
                     .set(TEExamCourse::getUpdateId, tbUser.getId())
+                    .set(TEExamCourse::getMobilePhotoUpload, teExamCourse.getMobilePhotoUpload())
                     .eq(TEExamCourse::getExamId, teExamCourse.getExamId()).eq(TEExamCourse::getCourseCode, teExamCourse.getCourseCode());
                     .eq(TEExamCourse::getExamId, teExamCourse.getExamId()).eq(TEExamCourse::getCourseCode, teExamCourse.getCourseCode());
             teExamCourseService.update(teExamCourseUpdateWrapper);
             teExamCourseService.update(teExamCourseUpdateWrapper);
         } catch (Exception e) {
         } catch (Exception e) {

+ 18 - 4
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamPaperController.java

@@ -5,10 +5,7 @@ import com.qmth.themis.business.cache.bean.ExamCacheBean;
 import com.qmth.themis.business.cache.bean.ExamPaperCacheBean;
 import com.qmth.themis.business.cache.bean.ExamPaperCacheBean;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.MqDto;
 import com.qmth.themis.business.dto.MqDto;
-import com.qmth.themis.business.entity.TBAttachment;
-import com.qmth.themis.business.entity.TBTaskHistory;
-import com.qmth.themis.business.entity.TBUser;
-import com.qmth.themis.business.entity.TEExamPaper;
+import com.qmth.themis.business.entity.*;
 import com.qmth.themis.business.enums.*;
 import com.qmth.themis.business.enums.*;
 import com.qmth.themis.business.service.*;
 import com.qmth.themis.business.service.*;
 import com.qmth.themis.business.util.MqUtil;
 import com.qmth.themis.business.util.MqUtil;
@@ -67,6 +64,9 @@ public class TEExamPaperController {
     @Resource
     @Resource
     TEExamCourseService examCourseService;
     TEExamCourseService examCourseService;
 
 
+    @Resource
+    TOeExamRecordService tOeExamRecordService;
+
     @ApiOperation(value = "考试试卷查询接口")
     @ApiOperation(value = "考试试卷查询接口")
     @RequestMapping(value = "/query", method = RequestMethod.POST)
     @RequestMapping(value = "/query", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考试科目信息", response = TEExamPaper.class)})
     @ApiResponses({@ApiResponse(code = 200, message = "考试科目信息", response = TEExamPaper.class)})
@@ -190,4 +190,18 @@ public class TEExamPaperController {
         }
         }
         return ResultUtil.ok(Collections.singletonMap(SystemConstant.TASK_ID, tbTaskHistory.getId()));
         return ResultUtil.ok(Collections.singletonMap(SystemConstant.TASK_ID, tbTaskHistory.getId()));
     }
     }
+
+    @ApiOperation(value = "试卷删除接口")
+    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = Result.class)})
+    @Transactional
+    public Result delete(@ApiParam(value = "试卷id", required = true) @RequestParam Long id) {
+        int count = tOeExamRecordService.count(new QueryWrapper<TOeExamRecord>().lambda().eq(TOeExamRecord::getPaperId, id));
+        if (count > 0) {
+            throw new BusinessException("该试卷已存在考试记录,无法删除");
+        }
+        teExamPaperService.removeById(id);
+        teExamPaperService.deleteExamPaperCacheBean(id);
+        return ResultUtil.ok(true);
+    }
 }
 }

+ 11 - 0
themis-business/src/main/java/com/qmth/themis/business/dto/response/TEExamCourseDto.java

@@ -57,6 +57,17 @@ public class TEExamCourseDto implements Serializable {
     @ApiModelProperty(name = "更新人")
     @ApiModelProperty(name = "更新人")
     private String updateName;//更新人
     private String updateName;//更新人
 
 
+    @ApiModelProperty(value = "是否允许使用移动端拍照答题,0:不开启,1:开启")
+    private Integer mobilePhotoUpload = 0;
+
+    public Integer getMobilePhotoUpload() {
+        return mobilePhotoUpload;
+    }
+
+    public void setMobilePhotoUpload(Integer mobilePhotoUpload) {
+        this.mobilePhotoUpload = mobilePhotoUpload;
+    }
+
     public Long getExamId() {
     public Long getExamId() {
         return examId;
         return examId;
     }
     }

+ 2 - 1
themis-business/src/main/resources/mapper/TEExamCourseMapper.xml

@@ -36,7 +36,8 @@
 		from
 		from
 		t_b_user t
 		t_b_user t
 		where
 		where
-		t.id = teec.update_id) as updateName
+		t.id = teec.update_id) as updateName,
+        teec.mobile_photo_upload as mobilePhotoUpload
 		from
 		from
 		t_e_exam_course teec
 		t_e_exam_course teec
 		left join t_e_exam tee on teec.exam_id = tee.id
 		left join t_e_exam tee on teec.exam_id = tee.id