Pārlūkot izejas kodu

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

tags/正式版本
王宁 pirms 2 gadiem
vecāks
revīzija
2abf914313

+ 18
- 6
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java Parādīt failu

@@ -925,7 +925,7 @@ public class EReportGenerateService {
925 925
         cr.setStunum(stunum);
926 926
         cr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
927 927
         setStudentName(list2, userMap);
928
-        String stujson = list2.stream().map(s -> s.getStudentname()).sorted().collect(Collectors.joining("、"));
928
+        String stujson = stuJson(list2);
929 929
         cr.setStujson(stujson);
930 930
         rclassRankList.add(cr);
931 931
     }
@@ -956,7 +956,7 @@ public class EReportGenerateService {
956 956
         cr.setStunum(stunum);
957 957
         cr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
958 958
         setStudentName(list2, userMap);
959
-        String stujson = list2.stream().map(s -> s.getStudentname()).sorted().collect(Collectors.joining("、"));
959
+        String stujson = stuJson(list2);
960 960
         cr.setStujson(stujson);
961 961
         rclassRankList.add(cr);
962 962
     }
@@ -991,7 +991,7 @@ public class EReportGenerateService {
991 991
         cr.setStunum(stunum);
992 992
         cr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
993 993
         setStudentName(list2, userMap);
994
-        String stujson = list2.stream().map(s -> s.getStudentname()).sorted().collect(Collectors.joining("、"));
994
+        String stujson = stuJson(list2);
995 995
         cr.setStujson(stujson);
996 996
         rclassRankList.add(cr);
997 997
     }
@@ -1017,7 +1017,7 @@ public class EReportGenerateService {
1017 1017
         cr.setStunum(stunum);
1018 1018
         cr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
1019 1019
         setStudentName(list2, userMap);
1020
-        String stujson = list2.stream().map(s -> s.getStudentname()).sorted().collect(Collectors.joining("、"));
1020
+        String stujson = stuJson(list2);
1021 1021
         cr.setStujson(stujson);
1022 1022
         rclassRankList.add(cr);
1023 1023
     }
@@ -1047,7 +1047,7 @@ public class EReportGenerateService {
1047 1047
         gr.setStunum(stunum);
1048 1048
         gr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
1049 1049
         setStudentName(list2, userMap);
1050
-        String stujson = list2.stream().map(s -> s.getStudentname()).sorted().collect(Collectors.joining("、"));
1050
+        String stujson = stuJson(list2);
1051 1051
         gr.setStujson(stujson);
1052 1052
         rclassRankList.add(gr);
1053 1053
     }
@@ -1077,11 +1077,23 @@ public class EReportGenerateService {
1077 1077
         cr.setStunum(stunum);
1078 1078
         cr.setSturate(N_Utils.getIntegerDivideAndMulitiply(stunum, gstunum));
1079 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 1081
         cr.setStujson(stujson);
1082 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 1098
     private void setStudentName(List<ERstudent> list, Map<Integer, String> userMap) {
1087 1099
         list.forEach(s -> s.setStudentname(userMap.get(s.getStudentid())));

Notiek ielāde…
Atcelt
Saglabāt