xiatian 8 月之前
父節點
當前提交
f49a144765

+ 6 - 2
src/main/java/cn/com/qmth/scancentral/controller/admin/StudentImportController.java

@@ -2,6 +2,7 @@ package cn.com.qmth.scancentral.controller.admin;
 
 import cn.com.qmth.scancentral.controller.BaseController;
 import cn.com.qmth.scancentral.entity.ExamEntity;
+import cn.com.qmth.scancentral.service.DataCacheService;
 import cn.com.qmth.scancentral.service.ExamService;
 import cn.com.qmth.scancentral.service.StudentImportService;
 import cn.com.qmth.scancentral.service.StudentService;
@@ -46,11 +47,13 @@ public class StudentImportController extends BaseController {
     @Autowired
     private ExamService examService;
 
+    @Autowired
+    private DataCacheService dataCacheService;
+
     @ApiOperation(value = "考生导入")
     @PostMapping("/import")
     public Map<String, Object> studentImport(@RequestParam Long examId,
-                                             @RequestParam(required = false) String subjectCode,
-                                             @RequestParam MultipartFile file) throws Exception {
+            @RequestParam(required = false) String subjectCode, @RequestParam MultipartFile file) throws Exception {
         if (studentImportService.existRunningStudentImportTask()) {
             throw new StatusException("有正在运行的考生导入任务,请稍后再试!");
         }
@@ -106,6 +109,7 @@ public class StudentImportController extends BaseController {
     @PostMapping(value = "/clear")
     public ResultVo studentClean(@RequestParam Long examId, @RequestParam String subjectCode) {
         studentService.studentClean(examId, subjectCode);
+        dataCacheService.loadCache();
         return new ResultVo(System.currentTimeMillis());
     }
 

+ 12 - 0
src/main/java/cn/com/qmth/scancentral/service/impl/SubjectServiceImpl.java

@@ -500,6 +500,12 @@ public class SubjectServiceImpl extends MppServiceImpl<SubjectDao, SubjectEntity
                         if (cm == null) {
                             throw new StatusException("未找到评卷点数据,条码值:" + data.getPaperType());
                         }
+                        if (StringUtils.isBlank(cm.getOddNumber())) {
+                            throw new StatusException("奇数考场评卷点代码不能为空,条码值:" + data.getPaperType());
+                        }
+                        if (StringUtils.isBlank(cm.getEvenNumber())) {
+                            throw new StatusException("偶数考场评卷点代码不能为空,条码值:" + data.getPaperType());
+                        }
                         if (site % 2 == 0) {
                             markingCode = cm.getEvenNumber();
                         } else {
@@ -660,6 +666,12 @@ public class SubjectServiceImpl extends MppServiceImpl<SubjectDao, SubjectEntity
                     if (cm == null) {
                         throw new StatusException("未找到评卷点数据,条码值:" + data.getPaperType());
                     }
+                    if (StringUtils.isBlank(cm.getOddNumber())) {
+                        throw new StatusException("奇数考场评卷点代码不能为空,条码值:" + data.getPaperType());
+                    }
+                    if (StringUtils.isBlank(cm.getEvenNumber())) {
+                        throw new StatusException("偶数考场评卷点代码不能为空,条码值:" + data.getPaperType());
+                    }
                     if (site % 2 == 0) {
                         markingCode = cm.getEvenNumber();
                     } else {

+ 0 - 1
src/main/resources/mapper/StudentMapper.xml

@@ -692,7 +692,6 @@
         <if test="req.packageCode != null and req.packageCode !=''">
             and t.package_code=#{req.packageCode}
         </if>
-        order by t.create_time
     </select>
     <select id="studentExport"
             resultType="cn.com.qmth.scancentral.vo.student.StudentVo">