Browse Source

Merge remote-tracking branch 'cloud-schoolapi/ywx'

tags/正式版本
王宁 2 years ago
parent
commit
2abf914313

+ 18
- 6
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java View File

925
         cr.setStunum(stunum);
925
         cr.setStunum(stunum);
926
         cr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
926
         cr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
927
         setStudentName(list2, userMap);
927
         setStudentName(list2, userMap);
928
-        String stujson = list2.stream().map(s -> s.getStudentname()).sorted().collect(Collectors.joining("、"));
928
+        String stujson = stuJson(list2);
929
         cr.setStujson(stujson);
929
         cr.setStujson(stujson);
930
         rclassRankList.add(cr);
930
         rclassRankList.add(cr);
931
     }
931
     }
956
         cr.setStunum(stunum);
956
         cr.setStunum(stunum);
957
         cr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
957
         cr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
958
         setStudentName(list2, userMap);
958
         setStudentName(list2, userMap);
959
-        String stujson = list2.stream().map(s -> s.getStudentname()).sorted().collect(Collectors.joining("、"));
959
+        String stujson = stuJson(list2);
960
         cr.setStujson(stujson);
960
         cr.setStujson(stujson);
961
         rclassRankList.add(cr);
961
         rclassRankList.add(cr);
962
     }
962
     }
991
         cr.setStunum(stunum);
991
         cr.setStunum(stunum);
992
         cr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
992
         cr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
993
         setStudentName(list2, userMap);
993
         setStudentName(list2, userMap);
994
-        String stujson = list2.stream().map(s -> s.getStudentname()).sorted().collect(Collectors.joining("、"));
994
+        String stujson = stuJson(list2);
995
         cr.setStujson(stujson);
995
         cr.setStujson(stujson);
996
         rclassRankList.add(cr);
996
         rclassRankList.add(cr);
997
     }
997
     }
1017
         cr.setStunum(stunum);
1017
         cr.setStunum(stunum);
1018
         cr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
1018
         cr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
1019
         setStudentName(list2, userMap);
1019
         setStudentName(list2, userMap);
1020
-        String stujson = list2.stream().map(s -> s.getStudentname()).sorted().collect(Collectors.joining("、"));
1020
+        String stujson = stuJson(list2);
1021
         cr.setStujson(stujson);
1021
         cr.setStujson(stujson);
1022
         rclassRankList.add(cr);
1022
         rclassRankList.add(cr);
1023
     }
1023
     }
1047
         gr.setStunum(stunum);
1047
         gr.setStunum(stunum);
1048
         gr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
1048
         gr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
1049
         setStudentName(list2, userMap);
1049
         setStudentName(list2, userMap);
1050
-        String stujson = list2.stream().map(s -> s.getStudentname()).sorted().collect(Collectors.joining("、"));
1050
+        String stujson = stuJson(list2);
1051
         gr.setStujson(stujson);
1051
         gr.setStujson(stujson);
1052
         rclassRankList.add(gr);
1052
         rclassRankList.add(gr);
1053
     }
1053
     }
1077
         cr.setStunum(stunum);
1077
         cr.setStunum(stunum);
1078
         cr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
1078
         cr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
1079
         setStudentName(list2, userMap);
1079
         setStudentName(list2, userMap);
1080
-        String stujson = list2.stream().map(s -> s.getStudentname() + "(" + s.getSchoolrank() + "名)").sorted().collect(Collectors.joining("、"));
1080
+        String stujson = stuJson(list2);
1081
         cr.setStujson(stujson);
1081
         cr.setStujson(stujson);
1082
         rclassRankList.add(cr);
1082
         rclassRankList.add(cr);
1083
     }
1083
     }
1084
 
1084
 
1085
+    //学生名单
1086
+    private String stuJson(List<ERstudent> list2) {
1087
+        List<Map> students = new ArrayList<>();
1088
+        for (ERstudent rstudent : list2) {
1089
+            Map s = new HashMap();
1090
+            s.put("studentname", rstudent.getStudentname());
1091
+            s.put("schoolrank", rstudent.getSchoolrank());
1092
+            students.add(s);
1093
+        }
1094
+        return JSON.toJSONString(students);
1095
+    }
1096
+
1085
     //学生姓名处理
1097
     //学生姓名处理
1086
     private void setStudentName(List<ERstudent> list, Map<Integer, String> userMap) {
1098
     private void setStudentName(List<ERstudent> list, Map<Integer, String> userMap) {
1087
         list.forEach(s -> s.setStudentname(userMap.get(s.getStudentid())));
1099
         list.forEach(s -> s.setStudentname(userMap.get(s.getStudentid())));

Loading…
Cancel
Save