Răsfoiți Sursa

3.3.1 update

xiaofei 1 an în urmă
părinte
comite
740905e12e

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

@@ -221,7 +221,7 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
 
         //印刷计划名称唯一性
         QueryWrapper<ExamPrintPlan> printPlanQueryWrapper = new QueryWrapper<>();
-        printPlanQueryWrapper.lambda().eq(ExamPrintPlan::getSchoolId, schoolId).eq(ExamPrintPlan::getName, examPrintPlan.getName());
+        printPlanQueryWrapper.lambda().eq(ExamPrintPlan::getExamId, examPrintPlan.getExamId()).eq(ExamPrintPlan::getName, examPrintPlan.getName());
         ExamPrintPlan printPlan = this.getOne(printPlanQueryWrapper);
         if (id == null || id == 0) {
             // 没有印刷计划id -> 新增印刷计划

+ 12 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java

@@ -1125,7 +1125,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             if (StringUtils.isNotBlank(paperAttachmentIds)) {
                 List<PaperInfoVo> paperInfoVoList = ExamTaskUtil.parsePaperAttachmentPath(paperAttachmentIds);
                 for (PaperInfoVo paperInfoVo : paperInfoVoList) {
-                    if(StringUtils.isBlank(paperInfoVo.getCardId())){
+                    if (StringUtils.isBlank(paperInfoVo.getCardId())) {
                         continue;
                     }
                     Long cardId = Long.valueOf(paperInfoVo.getCardId());
@@ -2128,8 +2128,18 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
     @Override
     public List<ExamDetail> matchBasicExamStudent(BasicExam basicExam, ExamTask examTask, ExamTaskDetail examTaskDetail, SysUser sysUser) {
         List<BasicExamStudent> basicExamStudentList = basicExamStudentService.listByExamIdAndPaperNumber(examTask.getExamId(), examTask.getPaperNumber());
+        if (CollectionUtils.isEmpty(basicExamStudentList)) {
+            return null;
+        }
         // 创建印刷计划
-        ExamPrintPlan examPrintPlan = new ExamPrintPlan();
+        QueryWrapper<ExamPrintPlan> printPlanQueryWrapper = new QueryWrapper<>();
+        printPlanQueryWrapper.lambda().eq(ExamPrintPlan::getExamId, basicExam.getId()).eq(ExamPrintPlan::getName, examTask.getCourseName() + examTask.getPaperNumber());
+        ExamPrintPlan examPrintPlan = examPrintPlanService.getOne(printPlanQueryWrapper);
+        if (examPrintPlan != null) {
+            return null;
+        }
+
+        examPrintPlan = new ExamPrintPlan();
         examPrintPlan.insertInfo(sysUser.getId());
         examPrintPlan.setSchoolId(sysUser.getSchoolId());
         examPrintPlan.setExamId(examTask.getExamId());

+ 10 - 8
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java

@@ -1277,14 +1277,16 @@ public class PrintCommonServiceImpl implements PrintCommonService {
                 if (ExamModelEnum.MODEL1.equals(basicExam.getExamModel()) || ExamModelEnum.MODEL4.equals(basicExam.getExamModel())) {
                     // 自动关联考生表中数据,并生成考场信息
                     List<ExamDetail> examDetailList1 = examTaskService.matchBasicExamStudent(basicExam, examTask, examTaskDetail, user);
-                    for (ExamDetail examDetail : examDetailList1) {
-                        // 更新考场状态为初始新建状态
-                        examDetailService.updateStatusById(examDetail.getId(), ExamDetailStatusEnum.NEW);
-
-                        // 所有考场都撤回,印刷任务状态改为就绪
-                        examPrintPlanService.updateStatusById(examDetail.getPrintPlanId(), PrintPlanStatusEnum.READY);
-                        TbTaskDetailResult tbTaskDetailResult = examDetailCourseService.getByExamDetailId(examDetail.getId());
-                        tbTaskPdfService.saveTask(tbTaskDetailResult, examDetail.getPrintPlanId(), user, examDetail.getId());
+                    if (CollectionUtils.isNotEmpty(examDetailList1)) {
+                        for (ExamDetail examDetail : examDetailList1) {
+                            // 更新考场状态为初始新建状态
+                            examDetailService.updateStatusById(examDetail.getId(), ExamDetailStatusEnum.NEW);
+
+                            // 所有考场都撤回,印刷任务状态改为就绪
+                            examPrintPlanService.updateStatusById(examDetail.getPrintPlanId(), PrintPlanStatusEnum.READY);
+                            TbTaskDetailResult tbTaskDetailResult = examDetailCourseService.getByExamDetailId(examDetail.getId());
+                            tbTaskPdfService.saveTask(tbTaskDetailResult, examDetail.getPrintPlanId(), user, examDetail.getId());
+                        }
                     }
                 }
             }

+ 3 - 11
distributed-print/src/main/java/com/qmth/distributed/print/api/BasicStudentController.java

@@ -3,20 +3,14 @@ package com.qmth.distributed.print.api;
 
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.distributed.print.business.bean.result.EditResult;
-import com.qmth.distributed.print.business.service.PrintCommonService;
-import com.qmth.distributed.print.business.templete.execute.AsyncStudentDataImportService;
 import com.qmth.teachcloud.common.annotation.OperationLogDetail;
 import com.qmth.teachcloud.common.bean.params.BasicStudentParams;
 import com.qmth.teachcloud.common.contant.SystemConstant;
-import com.qmth.teachcloud.common.entity.SysUser;
-import com.qmth.teachcloud.common.entity.TBTask;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
-import com.qmth.teachcloud.common.enums.TaskTypeEnum;
 import com.qmth.teachcloud.common.enums.log.CustomizedOperationTypeEnum;
 import com.qmth.teachcloud.common.service.BasicStudentService;
 import com.qmth.teachcloud.common.util.Result;
 import com.qmth.teachcloud.common.util.ResultUtil;
-import com.qmth.teachcloud.common.util.ServletUtil;
 import io.swagger.annotations.*;
 import org.springframework.validation.BindingResult;
 import org.springframework.validation.annotation.Validated;
@@ -28,7 +22,9 @@ import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import javax.validation.constraints.Max;
 import javax.validation.constraints.Min;
-import java.util.*;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 import java.util.stream.Collectors;
 
 /**
@@ -46,10 +42,6 @@ import java.util.stream.Collectors;
 public class BasicStudentController {
     @Resource
     private BasicStudentService basicStudentService;
-    @Resource
-    private PrintCommonService printCommonService;
-    @Resource
-    private AsyncStudentDataImportService asyncStudentDataImportService;
 
     @ApiOperation(value = "学生管理-查询")
     @RequestMapping(value = "/query", method = RequestMethod.POST)

+ 14 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkPaperServiceImpl.java

@@ -26,11 +26,13 @@ import com.qmth.teachcloud.mark.dto.mark.score.SettingDto;
 import com.qmth.teachcloud.mark.entity.MarkPaper;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
 import com.qmth.teachcloud.mark.entity.ScanPackage;
+import com.qmth.teachcloud.mark.enums.OmrTaskStatus;
 import com.qmth.teachcloud.mark.mapper.MarkPaperMapper;
 import com.qmth.teachcloud.mark.service.*;
 import com.qmth.teachcloud.mark.utils.Calculator;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -53,6 +55,8 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
     @Resource
     private ScanPackageService scanPackageService;
     @Resource
+    private ScanOmrTaskService scanOmrTaskService;
+    @Resource
     private TeachcloudCommonService teachcloudCommonService;
     @Resource
     private BasicRoleDataPermissionService basicRoleDataPermissionService;
@@ -153,14 +157,22 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
                     if (markStudentService.countByExamIdAndPaperNumberAndMarkStatus(examId, paperNumber, SubjectiveStatus.UNMARK) > 0) {
                         throw ExceptionResultEnum.ERROR.exception(courseInfo + "考生未全部评完,无法结束评卷");
                     }
-                    // 识别缺考未做完,不能结束
+                    // 未全部扫描,不能结束
                     if (markStudentService.countUnexistByExamIdAndPaperNumberAndPaperType(examId, paperNumber, markPaper.getPaperType()) > 0) {
                         throw ExceptionResultEnum.ERROR.exception(courseInfo + "未全部扫描完成,无法结束评卷");
                     }
-                    // 识别缺考未完,不能结束
+                    // 识别缺考未确认完,不能结束
                     if (markStudentService.countOmrAbsentStudent(examId, paperNumber, markPaper.getPaperType(), false) > 0) {
                         throw ExceptionResultEnum.ERROR.exception(courseInfo + "识别缺考未全部确认,无法结束评卷");
                     }
+                    // 人工绑定未做完,不能结束
+                    if (markStudentService.getAssignedCount(examId, false, markPaper.getCourseCode(), markPaper.getCoursePaperId(), MarkPaperStatus.FORMAL, null) > 0) {
+                        throw ExceptionResultEnum.ERROR.exception(courseInfo + "人工绑定未全部处理,无法结束评卷");
+                    }
+                    // 客观题检查未做完,不能结束
+                    if (scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, markPaper.getCourseCode(), markPaper.getCoursePaperId(), OmrTaskStatus.WAITING.name(), null) > 0) {
+                        throw ExceptionResultEnum.ERROR.exception(courseInfo + "客观题检查未全部处理,无法结束评卷");
+                    }
                 }
 
                 // 结束评卷时,客观题统分

+ 9 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -209,11 +209,17 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     @Override
     public IPage<StudentScoreDetailDto> pageStudentScore(Long examId, String paperNumber, String college, String majorName,
                                                          String className, String teacher, Integer filter, String status, Boolean breach, Double startScore,
-                                                         Double endScore,Double subjectiveStartScore, Double subjectiveEndScore, Double objectiveStartScore, Double objectiveEndScore,
-            Double subScore, Integer objectiveScoreRateLt, String studentName, String studentCode,
+                                                         Double endScore, Double subjectiveStartScore, Double subjectiveEndScore, Double objectiveStartScore, Double objectiveEndScore,
+                                                         Double subScore, Integer objectiveScoreRateLt, String studentName, String studentCode,
                                                          String orderType, String orderField, Integer pageNumber, Integer pageSize) {
         if (startScore != null && endScore == null) {
-            throw ExceptionResultEnum.ERROR.exception("请输入结束分数值");
+            throw ExceptionResultEnum.ERROR.exception("请输入试卷总分结束分数值");
+        }
+        if (objectiveStartScore != null && objectiveEndScore == null) {
+            throw ExceptionResultEnum.ERROR.exception("请输入客观题总分结束分数值");
+        }
+        if (subjectiveStartScore != null && subjectiveEndScore == null) {
+            throw ExceptionResultEnum.ERROR.exception("请输入主观题总分结束分数值");
         }
         college = SystemConstant.translateSpecificSign(college);
         majorName = SystemConstant.translateSpecificSign(majorName);

+ 8 - 8
teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

@@ -138,13 +138,13 @@
             <choose>
                 <when test="subjectiveStartScore == 0">
                     AND (ms.is_absent = 1 OR ms.is_breach = 1
-                             OR (ifnull(ms.subjective_score, 0) &gt;= #{subjectiveStartScore}
-                             AND ifnull(ms.subjective_score, 0) &lt;= #{subjectiveEndScore}))
+                             OR ((ifnull(ms.subjective_score, 0) &gt;= #{subjectiveStartScore}
+                             AND ifnull(ms.subjective_score, 0) &lt;= #{subjectiveEndScore})))
                 </when>
                 <otherwise>
                     AND (ms.is_absent = 0 AND ms.is_breach = 0
-                             OR (ifnull(ms.subjective_score, 0) &gt;= #{subjectiveStartScore}
-                            AND ifnull(ms.subjective_score, 0) &lt;= #{subjectiveEndScore}))
+                             AND ((ifnull(ms.subjective_score, 0) &gt;= #{subjectiveStartScore}
+                            AND ifnull(ms.subjective_score, 0) &lt;= #{subjectiveEndScore})))
                 </otherwise>
             </choose>
         </if>
@@ -152,13 +152,13 @@
             <choose>
                 <when test="objectiveStartScore == 0">
                     AND (ms.is_absent = 1 OR ms.is_breach = 1
-                        OR (ifnull(ms.objective_score, 0) &gt;= #{objectiveStartScore}
-                        AND ifnull(ms.objective_score, 0) &lt;= #{objectiveEndScore}))
+                        OR ((ifnull(ms.objective_score, 0) &gt;= #{objectiveStartScore}
+                        AND ifnull(ms.objective_score, 0) &lt;= #{objectiveEndScore})))
                 </when>
                 <otherwise>
                     AND (ms.is_absent = 0 AND ms.is_breach = 0
-                        OR (ifnull(ms.subjective_score, 0) &gt;= #{objectiveStartScore}
-                        AND ifnull(ms.subjective_score, 0) &lt;= #{objectiveEndScore}))
+                        AND ((ifnull(ms.objective_score, 0) &gt;= #{objectiveStartScore}
+                        AND ifnull(ms.objective_score, 0) &lt;= #{objectiveEndScore})))
                 </otherwise>
             </choose>
         </if>