xiaofei 9 mesi fa
parent
commit
c430ebfbb5
17 ha cambiato i file con 74 aggiunte e 35 eliminazioni
  1. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamTaskMapper.java
  2. 2 3
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskService.java
  3. 7 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamServiceImpl.java
  4. 5 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java
  5. 3 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamCardServiceImpl.java
  6. 10 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java
  7. 2 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskDetailServiceImpl.java
  8. 5 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  9. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/ImportLogicServiceImpl.java
  10. 3 2
      distributed-print-business/src/main/resources/mapper/ConditionMapper.xml
  11. 11 2
      distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml
  12. 2 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamDetailController.java
  13. 3 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintPlanController.java
  14. 3 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskController.java
  15. 8 8
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkQuestionServiceImpl.java
  16. 3 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkServiceImpl.java
  17. 4 4
      teachcloud-mark/src/main/resources/mapper/ScanOmrTaskMapper.xml

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamTaskMapper.java

@@ -31,7 +31,7 @@ public interface ExamTaskMapper extends BaseMapper<ExamTask> {
 
     IPage<ExamTaskDto> listPage(Page<ExamTaskDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("enable") Boolean enable, @Param("status") String status, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("userName") String userName, @Param("dpr") DataPermissionRule dpr);
 
-    List<BlurryUserDto> listUser(@Param("schoolId") Long schoolId, @Param("param") String param, @Param("orgIds") Set<Long> orgIds);
+    List<BlurryUserDto> listUser(@Param("schoolId") Long schoolId, @Param("courseId") Long courseId, @Param("param") String param, @Param("orgIds") Set<Long> orgIds);
 
     IPage<ExamTaskDto> listTaskApply(Page<ExamTaskDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("auditStatus") String auditStatus, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("userId") Long userId, @Param("userName") String userName);
 
@@ -97,7 +97,7 @@ public interface ExamTaskMapper extends BaseMapper<ExamTask> {
      */
     public WorkResult getFlowInfo(@Param("flowId") Long flowId, @Param("taskId") Long taskId);
 
-    IPage<MakeupExamTaskDto> listMakeupExamTask(@Param("page") Page<MakeupExamTaskDto> page, @Param("printPlanId") Long printPlanId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("collegeId") Long collegeId, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("userName") String userName);
+    IPage<MakeupExamTaskDto> listMakeupExamTask(@Param("page") Page<MakeupExamTaskDto> page, @Param("printPlanId") Long printPlanId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("collegeId") Long collegeId, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("userName") String userName, @Param("campusName") String campusName, @Param("className") String className);
 
     /**
      * 命题任务统计查询

+ 2 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskService.java

@@ -10,7 +10,6 @@ import com.qmth.distributed.print.business.bean.params.ExamTaskSubmitPram;
 import com.qmth.distributed.print.business.bean.params.MakeupExamTaskTotalParam;
 import com.qmth.distributed.print.business.bean.result.WorkResult;
 import com.qmth.distributed.print.business.bean.result.examTaskStudent.ExamTaskStudentObjectResult;
-import com.qmth.distributed.print.business.bean.result.statistics.ScanCalculateResult;
 import com.qmth.distributed.print.business.bean.result.statistics.ScanCountResult;
 import com.qmth.distributed.print.business.bean.result.statistics.PrintCountResult;
 import com.qmth.distributed.print.business.entity.ExamDetail;
@@ -43,7 +42,7 @@ public interface ExamTaskService extends IService<ExamTask> {
 
     IPage<ExamTaskDto> list(Long semesterId, Long examId, Boolean enable, String status, Long courseId, String paperNumber, Long startTime, Long endTime, String userName, Integer pageNumber, Integer pageSize);
 
-    List<BlurryUserDto> listUser(String param);
+    List<BlurryUserDto> listUser(Long courseId, String param);
 
     ExamTask assignUser(ExamTask examTask);
 
@@ -181,7 +180,7 @@ public interface ExamTaskService extends IService<ExamTask> {
 
     ExamTask getByExamIdAndCourseIdAndPaperNumber(Long examId, Long courseId, String paperNumber);
 
-    IPage<MakeupExamTaskDto> listMakeupExamTask(Long printPlanId, Long semesterId, Long examId, Long collegeId, Long courseId, String paperNumber, String userName, Integer pageNumber, Integer pageSize);
+    IPage<MakeupExamTaskDto> listMakeupExamTask(Long printPlanId, Long semesterId, Long examId, Long collegeId, Long courseId, String paperNumber, String userName, String campusName, String className, Integer pageNumber, Integer pageSize);
 
     void saveMakeupTask(MakeupExamTaskTotalParam makeupExamTaskTotalParam);
 

+ 7 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamServiceImpl.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.distributed.print.business.entity.ExamPrintPlan;
 import com.qmth.distributed.print.business.entity.ExamTask;
+import com.qmth.distributed.print.business.entity.TeachCourse;
 import com.qmth.distributed.print.business.mapper.BasicExamMapper;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.util.CodeUtils;
@@ -40,7 +41,8 @@ public class BasicExamServiceImpl extends ServiceImpl<BasicExamMapper, BasicExam
     ExamPrintPlanService examPrintPlanService;
     @Resource
     BasicRoleDataPermissionService basicRoleDataPermissionService;
-
+    @Resource
+    private TeachCourseService teachCourseService;
     @Resource
     BasicPrintConfigService basicPrintConfigService;
     @Resource
@@ -106,6 +108,10 @@ public class BasicExamServiceImpl extends ServiceImpl<BasicExamMapper, BasicExam
         if (countExamPrint > 0) {
             throw ExceptionResultEnum.ERROR.exception("考试[" + basicExam.getName() + "]已创建印刷计划,不允许删除");
         }
+        int countTeachCourse = teachCourseService.count(new QueryWrapper<TeachCourse>().lambda().eq(TeachCourse::getExamId, id));
+        if (countTeachCourse > 0) {
+            throw ExceptionResultEnum.ERROR.exception("考试[" + basicExam.getName() + "]已有老师新增课程,不允许删除");
+        }
         // 删除设置印品
         basicPrintConfigService.removeByExamId(id);
         return this.removeById(id);

+ 5 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java

@@ -302,8 +302,11 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
 
         // 试卷编号绑定其它课程
         if (StringUtils.isNotBlank(basicExamStudent.getPaperNumber())) {
-            if (StringUtils.isBlank(basicExamStudent.getExamPlace())) {
-                throw ExceptionResultEnum.ERROR.exception("校区(考点)必填");
+            BasicExamRule basicExamRule = basicExamRuleService.getBySchoolId(schoolId);
+            Optional<EnumResult> optional = basicExamRule.getRequiredFieldList().stream().filter(m -> RequiredFieldsEnum.EXAM_PLACE.name().equals(m.getCode()) && m.getEnable()).findFirst();
+            // 试卷编号不为空时,校区(考点)必填
+            if (optional.isPresent() && optional.get().getEnable() && StringUtils.isBlank(basicExamStudent.getExamPlace())) {
+                throw ExceptionResultEnum.ERROR.exception(RequiredFieldsEnum.EXAM_PLACE.getName() + "必填");
             }
             if (this.count(new QueryWrapper<BasicExamStudent>().lambda()
                     .eq(BasicExamStudent::getExamId, basicExamStudent.getExamId()).eq(BasicExamStudent::getPaperNumber, basicExamStudent.getPaperNumber())

+ 3 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamCardServiceImpl.java

@@ -396,6 +396,9 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
     @Override
     public void convertImage(Long id) {
         ExamCard examCard = this.getById(id);
+        if (!ExamCardStatusEnum.SUBMIT.equals(examCard.getStatus())) {
+            throw ExceptionResultEnum.ERROR.exception("提交状态题卡才能生成图片");
+        }
         createJpgImage(examCard);
         if (examCard.getJpgAttachment().length() > 0) {
             UpdateWrapper<ExamCard> updateWrapper = new UpdateWrapper<>();

+ 10 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java

@@ -1076,7 +1076,16 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
     @Transactional
     @Override
     public List<Long> saveImportExamStudent(ExamPrintPlan examPrintPlan, List<BasicExamStudent> basicExamStudentList, Long createId) {
-        Map<String, List<BasicExamStudent>> examDetailMap = basicExamStudentList.stream().collect(Collectors.groupingBy(m -> m.getExamPlace().concat(m.getExamRoom()).concat(m.getExamStartTime().toString()).concat(m.getExamEndTime().toString())));
+        // 校区(考点)为非必填项
+        BasicExamRule basicExamRule = basicExamRuleService.getBySchoolId(examPrintPlan.getSchoolId());
+        Optional<EnumResult> optional = basicExamRule.getRequiredFieldList().stream().filter(m -> RequiredFieldsEnum.EXAM_PLACE.name().equals(m.getCode()) && m.getEnable()).findFirst();
+        Map<String, List<BasicExamStudent>> examDetailMap;
+        if(optional.isPresent()){
+            examDetailMap = basicExamStudentList.stream().collect(Collectors.groupingBy(m -> m.getExamPlace().concat(m.getExamRoom()).concat(m.getExamStartTime().toString()).concat(m.getExamEndTime().toString())));
+        } else {
+            examDetailMap = basicExamStudentList.stream().collect(Collectors.groupingBy(m -> m.getExamRoom().concat(m.getExamStartTime().toString()).concat(m.getExamEndTime().toString())));
+        }
+
         List<ExamDetail> examDetailList = new ArrayList<>();
         List<ExamDetailCourse> examDetailCourseList = new ArrayList<>();
         List<ExamStudent> examStudentList = new ArrayList<>();

+ 2 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskDetailServiceImpl.java

@@ -28,6 +28,7 @@ import com.qmth.teachcloud.mark.service.ScanPaperService;
 import org.activiti.engine.TaskService;
 import org.activiti.engine.task.Task;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -704,7 +705,7 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
         // 更新曝光卷型、未曝光卷型
         ExamTaskDetail examTaskDetail = this.getByExamIdAndCourseIdAndPaperNumber(examId, null, paperNumber);
         // 考生使用卷型
-        List<String> studentPaperTypes = Arrays.asList(exposePaperType.split(","));
+        List<String> studentPaperTypes = StringUtils.isBlank(exposePaperType) ? Arrays.asList(ArrayUtils.EMPTY_STRING_ARRAY) : Arrays.asList(exposePaperType.split(","));
         List<String> paperTypeList = Objects.isNull(examTaskDetail.getPaperType()) ? new ArrayList<>() : Arrays.asList(examTaskDetail.getPaperType().split(","));
         List<String> exposedPaperTypeList = Objects.isNull(examTaskDetail.getExposedPaperType()) ? new ArrayList<>() : Arrays.asList(examTaskDetail.getExposedPaperType().split(","));
 

+ 5 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java

@@ -183,10 +183,10 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
     }
 
     @Override
-    public List<BlurryUserDto> listUser(String param) {
+    public List<BlurryUserDto> listUser(Long courseId, String param) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
-        return this.baseMapper.listUser(schoolId, SystemConstant.translateSpecificSign(param), orgIds);
+        return this.baseMapper.listUser(schoolId, courseId, SystemConstant.translateSpecificSign(param), orgIds);
     }
 
     @Transactional
@@ -1306,6 +1306,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                     examDetailCourse.setExamDetailId(examDetail.getId());
                     examDetailCourse.setCourseId(examTask.getCourseId());
                     examDetailCourse.setPaperNumber(paperNumber);
+                    examDetailCourse.setCoursePaperId(String.valueOf(examTask.getId()));
                     examDetailCourse.setClazzName(examDetailParams.getClassName());
                     examDetailCourse.setTotalSubjects(examDetailParams.getTotalSubjects());
                     examDetailCourse.setCreateId(sysUser.getId());
@@ -1662,7 +1663,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
     }
 
     @Override
-    public IPage<MakeupExamTaskDto> listMakeupExamTask(Long printPlanId, Long semesterId, Long examId, Long collegeId, Long courseId, String paperNumber, String userName, Integer pageNumber, Integer pageSize) {
+    public IPage<MakeupExamTaskDto> listMakeupExamTask(Long printPlanId, Long semesterId, Long examId, Long collegeId, Long courseId, String paperNumber, String userName, String campusName, String className, Integer pageNumber, Integer pageSize) {
         if (semesterId == null) {
             throw ExceptionResultEnum.ERROR.exception("请选择学期");
         }
@@ -1670,7 +1671,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             throw ExceptionResultEnum.ERROR.exception("请选择考试");
         }
         Page<MakeupExamTaskDto> page = new Page<>(pageNumber, pageSize);
-        return this.baseMapper.listMakeupExamTask(page, printPlanId, semesterId, examId, collegeId, courseId, paperNumber, userName);
+        return this.baseMapper.listMakeupExamTask(page, printPlanId, semesterId, examId, collegeId, courseId, paperNumber, userName, campusName, className);
     }
 
     @Override

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/ImportLogicServiceImpl.java

@@ -784,7 +784,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
                             try {
                                 Field declaredField = aClass.getDeclaredField(enumResult.getCode());
                                 declaredField.setAccessible(true);
-                                declaredField.set(basicExamStudentImport, StringUtils.deleteWhitespace(entry.getValue()));
+                                declaredField.set(basicExamStudentImport, RequiredFieldsEnum.TEACHER_NAME.getCode().equals(enumResult.getCode()) ? entry.getValue().trim() : StringUtils.deleteWhitespace(entry.getValue()));
                             } catch (NoSuchFieldException e) {
                                 throw ExceptionResultEnum.ERROR.exception("未获取到表头为[" + entry.getKey() + "]的属性值");
                             } catch (IllegalAccessException e) {

+ 3 - 2
distributed-print-business/src/main/resources/mapper/ConditionMapper.xml

@@ -114,8 +114,9 @@
     </select>
     <select id="listCourseForAudit" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
         SELECT
-            bc.code code,
-            bc.name name
+            bc.id,
+            bc.code,
+            bc.name
         FROM
             basic_course bc
         <where>

+ 11 - 2
distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml

@@ -165,14 +165,17 @@
         sys_user b ON a.user_id = b.id
         <where>
             b.enable = true
-            <if test="schoolId != null and schoolId != ''">
+            <if test="schoolId != null">
                 and b.school_id = #{schoolId}
             </if>
+            <if test="courseId != null">
+                and a.course_id = #{courseId}
+            </if>
             <if test="param != null and param != ''">
                 and b.real_name like concat('%', #{param}, '%')
             </if>
             <if test="orgIds != null and orgIds != '' and orgIds.size > 0">
-                AND a.org_id IN
+                AND b.org_id IN
                 <foreach collection="orgIds" item="item" index="index" open="(" separator="," close=")">
                     #{item}
                 </foreach>
@@ -1258,6 +1261,12 @@
         <if test="userName != null and userName !=''">
             AND (su.login_name = #{userName} or su.real_name = #{userName})
         </if>
+        <if test="campusName != null and campusName != ''">
+            AND c.exam_place like concat('%', #{campusName}, '%')
+        </if>
+        <if test="className != null and className != ''">
+            AND c.clazz_name like concat('%', #{className}, '%')
+        </if>
         <if test="collegeId != null">
             AND EXISTS( SELECT
             1

+ 2 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamDetailController.java

@@ -121,7 +121,8 @@ public class ExamDetailController {
                                      @ApiParam(value = "考试日期-终止") @RequestParam(required = false) Long endDate) {
 
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-        DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission();
+        SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
+        DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId, requestUser.getId(), "/api/admin/exam/print/data_list");
         if (Objects.isNull(printPlanIdList)) {
             printPlanIdList = new ArrayList<>();
         }

+ 3 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintPlanController.java

@@ -247,9 +247,11 @@ public class ExamPrintPlanController {
                                  @ApiParam(value = "课程ID") @RequestParam(value = "courseId", required = false) Long courseId,
                                  @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                                  @ApiParam(value = "命题老师") @RequestParam(value = "userName", required = false) String userName,
+                                 @ApiParam(value = "校区") @RequestParam(value = "campusName", required = false) String campusName,
+                                 @ApiParam(value = "班级") @RequestParam(value = "className", required = false) String className,
                                  @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                  @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        IPage<MakeupExamTaskDto> list = examTaskService.listMakeupExamTask(printPlanId, semesterId, examId, collegeId, courseId, paperNumber, userName, pageNumber, pageSize);
+        IPage<MakeupExamTaskDto> list = examTaskService.listMakeupExamTask(printPlanId, semesterId, examId, collegeId, courseId, paperNumber, userName, campusName, className, pageNumber, pageSize);
         return ResultUtil.ok(list);
     }
 

+ 3 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskController.java

@@ -83,8 +83,9 @@ public class ExamTaskController {
      */
     @ApiOperation(value = "命题老师模糊查询")
     @RequestMapping(value = "/user_query", method = RequestMethod.POST)
-    public Result userQuery(@RequestParam(value = "param", required = false) String param) {
-        return ResultUtil.ok(examTaskService.listUser(param));
+    public Result userQuery(@RequestParam(value = "courseId", required = false) Long courseId,
+                            @RequestParam(value = "param", required = false) String param) {
+        return ResultUtil.ok(examTaskService.listUser(courseId, param));
     }
 
     /**

+ 8 - 8
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkQuestionServiceImpl.java

@@ -92,7 +92,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
         }
 
         // 校验题号不能重复
-        Map<String, Long> longMap = questions.stream().collect(Collectors.groupingBy(m -> String.valueOf(m.getMainNumber()) + m.getSubNumber(), Collectors.counting()));
+        Map<String, Long> longMap = questions.stream().collect(Collectors.groupingBy(m -> m.getMainNumber() + SystemConstant.HYPHEN + m.getSubNumber(), Collectors.counting()));
         long count = longMap.entrySet().stream().filter(m -> m.getValue().intValue() > 1).count();
         if (count > 0) {
             throw ExceptionResultEnum.ERROR.exception("大题号-小题号有重复数据");
@@ -136,7 +136,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
                                 throw ExceptionResultEnum.ERROR.exception("大题号" + markQuestion.getMainNumber() + "小题号" + markQuestion.getSubNumber() + "已分组,不能修改小题满分");
                             }
                             // 主观题改客观题
-                            if(!markQuestion.getObjective() && question.getObjective()){
+                            if (!markQuestion.getObjective() && question.getObjective()) {
                                 throw ExceptionResultEnum.ERROR.exception("大题号" + markQuestion.getMainNumber() + "小题号" + markQuestion.getSubNumber() + "已分组,不能修改为客观题题型");
                             }
                         }
@@ -147,7 +147,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
                             throw ExceptionResultEnum.ERROR.exception("间隔分必须大于0");
                         }
                         // 客观题变主观题
-                        if(markQuestion.getObjective() && !question.getObjective()){
+                        if (markQuestion.getObjective() && !question.getObjective()) {
                             // 清除判分策略
                             markQuestion.setObjectivePolicy(null);
                             markQuestion.setObjectivePolicyScore(null);
@@ -155,9 +155,9 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
                             markQuestion.setOptionCount(0);
                         }
                         // 客观题
-                        if(question.getObjective()){
+                        if (question.getObjective()) {
                             markQuestion.setOptionCount(question.getOptionCount());
-                            if(!markQuestion.getQuestionType().equals(question.getQuestionType())){
+                            if (!markQuestion.getQuestionType().equals(question.getQuestionType())) {
                                 // 清除判分策略
                                 markQuestion.setObjectivePolicy(null);
                                 markQuestion.setObjectivePolicyScore(null);
@@ -226,12 +226,12 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
         // 主观题结构有变动
         List<MarkQuestion> subjectiveQuestions = questions.stream().filter(m -> m.getObjective()).collect(Collectors.toList());
         List<MarkQuestion> subjectiveMarkQuestionList = markQuestionList.stream().filter(m -> m.getObjective()).collect(Collectors.toList());
-        if(!CollectionUtils.isEqualCollection(subjectiveQuestions, subjectiveMarkQuestionList)){
+        if (!CollectionUtils.isEqualCollection(subjectiveQuestions, subjectiveMarkQuestionList)) {
             // 未分组的题目
             long unGroupQuestionCount = this.countByExamIdAndPaperNumberAndObjectiveAndGroupNumberIsNull(examId, paperNumber, false);
             long groupCount = CollectionUtils.size(markGroupService.listGroupByExamIdAndPaperNumber(examId, paperNumber));
             // 考生主观题重新统分
-            markService.checkStudentSubjectiveScore(examId, markPaper.getCoursePaperId(),groupCount, unGroupQuestionCount);
+            markService.checkStudentSubjectiveScore(examId, markPaper.getCoursePaperId(), groupCount, unGroupQuestionCount);
         }
 
         // 更新分组状态
@@ -453,7 +453,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
 
     @Override
     public List<MarkQuestion> listByExamIdAndPaperNumberAndPaperIndexAndPageIndex(Long examId, String paperNumber,
-                                                                                  Integer paperIndex, Integer pageIndex,boolean isObjective) {
+                                                                                  Integer paperIndex, Integer pageIndex, boolean isObjective) {
         QueryWrapper<MarkQuestion> queryWrapper = new QueryWrapper<>();
         queryWrapper.lambda().eq(MarkQuestion::getExamId, examId)
                 .eq(MarkQuestion::getPaperNumber, paperNumber)

+ 3 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkServiceImpl.java

@@ -1065,6 +1065,9 @@ public class MarkServiceImpl implements MarkService {
         }
         MarkUserGroup markUserGroup = markUserGroupService.getByExamIdAndPaperNumberAndGroupNumberAndUserId(examId,
                 paperNumber, groupNumber, userId);
+        if(markUserGroup == null){
+            throw ExceptionResultEnum.ERROR.exception("评卷任务被重置,请点击右上角返回按钮,重新在评卷入口菜单点击评卷");
+        }
         Task task = null;
         List<MarkTask> list;
         int pageNumber = 1;

+ 4 - 4
teachcloud-mark/src/main/resources/mapper/ScanOmrTaskMapper.xml

@@ -39,9 +39,9 @@
 			s.student_code
 		from mark_student s
 			inner join basic_exam_student bes on s.basic_student_id = bes.id
-			INNER join sys_user su on s.create_id = su.id
+			LEFT JOIN basic_course bc on s.course_id = bc.id
 			<if test="dpr != null and dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-				AND su.org_id IN
+				AND bc.teaching_room_id IN
 				<foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
 					#{item}
 				</foreach>
@@ -82,9 +82,9 @@
 		select
 			count(1)
 		from mark_student s
-		INNER JOIN sys_user su on s.create_id = su.id
+		LEFT JOIN basic_course bc on s.course_id = bc.id
 			<if test="dpr != null and dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-				AND su.org_id IN
+				AND bc.teaching_room_id IN
 				<foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
 					#{item}
 				</foreach>