haogh 1 年之前
父節點
當前提交
5de37b6b0a

+ 3 - 0
src/main/java/com/qmth/exam/reserve/controller/admin/StudentApplyController.java

@@ -107,6 +107,9 @@ public class StudentApplyController extends BaseController {
         if (Role.TEACHING.equals(user.getRole())) {
             teachingId = user.getCategoryId();
         }
+        if(teachingId == null) {
+            throw new StatusException("请选择教学点");
+        }
         List<Map<String, Object>> failRecords = new ArrayList<Map<String, Object>>();
         try {
             failRecords = studentApplyService.importPreExam(user.getId(), teachingId, level, file.getInputStream());

+ 3 - 0
src/main/java/com/qmth/exam/reserve/service/impl/StudentApplyServiceImpl.java

@@ -258,6 +258,9 @@ public class StudentApplyServiceImpl extends ServiceImpl<StudentApplyDao, Studen
             if (categoryId != null && !student.getCategoryId().equals(categoryId)) {
                 msg.append(" 导入的考生所属教学点和系统中的考生教学点不匹配");
             }
+            if (categoryId != null && !categoryId.equals(teachingId)) {
+                msg.append(" 不是本教学点的考生");
+             }
             String agentName1 = trimAndNullIfBlank(line.get(EXCEL_HEADER[4]));
             if (StringUtils.isBlank(agentName1)) {
                 msg.append(" 预约考点1不能为空");