wangliang před 4 roky
rodič
revize
b4033e7c4e

+ 8 - 5
themis-backend/src/main/java/com/qmth/themis/backend/api/TBExamInvigilateUserController.java

@@ -16,7 +16,6 @@ import com.qmth.themis.business.service.MqDtoService;
 import com.qmth.themis.business.service.TBAttachmentService;
 import com.qmth.themis.business.service.TBExamInvigilateUserService;
 import com.qmth.themis.business.service.TBTaskHistoryService;
-import com.qmth.themis.business.util.JacksonUtil;
 import com.qmth.themis.business.util.ServletUtil;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
@@ -62,8 +61,8 @@ public class TBExamInvigilateUserController {
     @ApiOperation(value = "监考员查询接口")
     @RequestMapping(value = "/query", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "监考员信息", response = TBExamInvigilateUserDto.class)})
-    public Result query(@ApiParam(value = "考试批次id", required = true) @RequestParam Long examId,@ApiParam(value = "考场代码", required = false) @RequestParam(required = false) String roomCode, @ApiParam(value = "用户id", required = false) @RequestParam(required = false) Long userId, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
-        IPage<TBExamInvigilateUserDto> examInvigilateUserDtoIPage = tbExamInvigilateUserService.examInvigilateUserQuery(new Page<>(pageNumber, pageSize), examId,roomCode, userId);
+    public Result query(@ApiParam(value = "考试批次id", required = true) @RequestParam(required = false) Long examId, @ApiParam(value = "考场代码", required = false) @RequestParam(required = false) String roomCode, @ApiParam(value = "用户id", required = false) @RequestParam(required = false) Long userId, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        IPage<TBExamInvigilateUserDto> examInvigilateUserDtoIPage = tbExamInvigilateUserService.examInvigilateUserQuery(new Page<>(pageNumber, pageSize), examId, roomCode, userId);
         BasePage basePage = new BasePage(examInvigilateUserDtoIPage.getRecords(), examInvigilateUserDtoIPage.getCurrent(), examInvigilateUserDtoIPage.getSize(), examInvigilateUserDtoIPage.getTotal());
         return ResultUtil.ok(basePage);
     }
@@ -126,10 +125,13 @@ public class TBExamInvigilateUserController {
     @RequestMapping(value = "/import", method = RequestMethod.POST)
     @Transactional
     @ApiResponses({@ApiResponse(code = 200, message = "{\"taskId\":0}", response = Result.class)})
-    public Result importData(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file) {
+    public Result importData(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file, @ApiParam(value = "考试批次id", required = true) @RequestParam Long examId) {
         if (Objects.isNull(file) || Objects.equals(file, "")) {
             throw new BusinessException(ExceptionResultEnum.ATTACHMENT_IS_NULL);
         }
+        if (Objects.isNull(examId) || Objects.equals(examId, "")) {
+            throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
+        }
         Map<String, Object> mapParameter = systemConfig.getOssEnv(UploadFileEnum.file.getId());
         TBAttachment tbAttachment = null;
         TBTaskHistory tbTaskHistory = null;
@@ -141,10 +143,11 @@ public class TBExamInvigilateUserController {
                 throw new BusinessException(ExceptionResultEnum.ATTACHMENT_ERROR);
             } else {
                 //往任务表里插一条数据
-                tbTaskHistory = new TBTaskHistory(TaskTypeEnum.IMPORT_INVIGILATE_USER, tbAttachment.getId(), TaskStatusEnum.INIT, SystemConstant.IMPORT_INIT, 0d, tbAttachment.getName(), tbAttachment.getRemark(), tbUser.getId());
+                tbTaskHistory = new TBTaskHistory(TaskTypeEnum.IMPORT_INVIGILATE_USER, examId, TaskStatusEnum.INIT, SystemConstant.IMPORT_INIT, 0d, tbAttachment.getName(), tbAttachment.getRemark(), tbUser.getId());
                 taskHistoryService.save(tbTaskHistory);
                 transMap.put("tbTaskHistory", tbTaskHistory);
             }
+            transMap.put("examId", examId);
             transMap.put("createId", tbUser.getId());
             transMap.put("orgId", tbUser.getOrgId());
             transMap.put("remark", tbAttachment.getRemark());

+ 1 - 1
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamPaperController.java

@@ -127,7 +127,7 @@ public class TEExamPaperController {
                 throw new BusinessException(ExceptionResultEnum.ATTACHMENT_ERROR);
             } else {
                 //往任务表里插一条数据
-                tbTaskHistory = new TBTaskHistory(TaskTypeEnum.IMPORT_EXAM_PAPER, tbAttachment.getId(), TaskStatusEnum.INIT, SystemConstant.IMPORT_INIT, 0d, tbAttachment.getName(), tbAttachment.getRemark(), tbUser.getId());
+                tbTaskHistory = new TBTaskHistory(TaskTypeEnum.IMPORT_EXAM_PAPER, examId, TaskStatusEnum.INIT, SystemConstant.IMPORT_INIT, 0d, tbAttachment.getName(), tbAttachment.getRemark(), tbUser.getId());
                 taskHistoryService.save(tbTaskHistory);
                 transMap.put("tbTaskHistory", tbTaskHistory);
             }

+ 1 - 1
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamStudentController.java

@@ -186,7 +186,7 @@ public class TEExamStudentController {
                 throw new BusinessException(ExceptionResultEnum.ATTACHMENT_ERROR);
             } else {
                 //往任务表里插一条数据
-                tbTaskHistory = new TBTaskHistory(TaskTypeEnum.IMPORT_EXAM_STUDENT, tbAttachment.getId(), TaskStatusEnum.INIT, SystemConstant.IMPORT_INIT, 0d, tbAttachment.getName(), tbAttachment.getRemark(), tbUser.getId());
+                tbTaskHistory = new TBTaskHistory(TaskTypeEnum.IMPORT_EXAM_STUDENT, examId, TaskStatusEnum.INIT, SystemConstant.IMPORT_INIT, 0d, tbAttachment.getName(), tbAttachment.getRemark(), tbUser.getId());
                 taskHistoryService.save(tbTaskHistory);
                 transMap.put("tbTaskHistory", tbTaskHistory);
             }

+ 3 - 2
themis-business/src/main/java/com/qmth/themis/business/entity/TEExam.java

@@ -1,5 +1,6 @@
 package com.qmth.themis.business.entity;
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.qmth.themis.business.base.BaseEntity;
 import com.qmth.themis.business.dto.request.TEExamDto;
@@ -46,7 +47,7 @@ public class TEExam extends BaseEntity {
     private Date endTime;
 
     @ApiModelProperty(value = "考试口令")
-    @TableField(value = "short_code")
+    @TableField(value = "short_code", updateStrategy = FieldStrategy.IGNORED)
     private String shortCode;
 
     @ApiModelProperty(value = "提前多长时间开始候考(分钟)")
@@ -162,7 +163,7 @@ public class TEExam extends BaseEntity {
     private ObjectiveScorePolicyEnum objectiveScorePolicy;
 
     @ApiModelProperty(value = "开启监控的视频源")
-    @TableField(value = "monitor_video_source")
+    @TableField(value = "monitor_video_source", updateStrategy = FieldStrategy.IGNORED)
     private String monitorVideoSource;
 
     @ApiModelProperty(value = "是否开始监控转录,0:开启,1:不开启")

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

@@ -17,7 +17,7 @@
             tbth.finish_time as finishTime,
             tbth.create_id as createId,
             tbth.import_file_name as importFileName,
-            (select tba.name from t_b_attachment tba where tba.id = tbth.entity_id) as entityName,
+            (select tee.name from t_e_exam tee where tba.id = tbth.entity_id) as entityName,
             (
             select
                 tbu.name