Browse Source

根据姓名搜索学生信息

ywx
雍文秀 8 months ago
parent
commit
a19ad51c67
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      src/main/java/com/xhkjedu/controller/EPaperVerifyController.java

+ 3
- 1
src/main/java/com/xhkjedu/controller/EPaperVerifyController.java View File

@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
12 12
 import org.springframework.web.bind.annotation.RestController;
13 13
 
14 14
 import javax.annotation.Resource;
15
+import java.util.ArrayList;
15 16
 import java.util.List;
16 17
 import java.util.Map;
17 18
 
@@ -32,9 +33,10 @@ public class EPaperVerifyController {
32 33
     public ResultVo listStudentByStudentname(@RequestBody EClassStudent student) {
33 34
         Integer examid = student.getExamid();
34 35
         String studentname = student.getStudentname();
35
-        if(N_Utils.isEmpty(studentname)) return new ResultVo(0, "获取成功!", null);
36
+        if(N_Utils.isEmpty(studentname)) return new ResultVo(0, "获取成功!", new ArrayList<>());
36 37
         N_Utils.validation(new Object[]{examid, "考试id", 1});
37 38
         List<Map> list = ePaperVerifyService.listStudentByStudentname(examid, studentname, student.getClassid());
39
+        if (list == null) list = new ArrayList<>();
38 40
         return new ResultVo(0, "获取成功!", list);
39 41
     }
40 42
 

Loading…
Cancel
Save