Browse Source

根据姓名搜索学生信息

ywx
雍文秀 8 months ago
parent
commit
a19ad51c67

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

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

Loading…
Cancel
Save