瀏覽代碼

优化生产报告无学生时知识点

tags/正式3.9.0
王宁 1 年之前
父節點
當前提交
cb8f60f25c

+ 0
- 116
gateway/src/main/java/com/xhkjedu/gateway/interceptors/DecryptRequestBodyAdvice.java 查看文件

@@ -1,116 +0,0 @@
1
-//package com.xhkjedu.gateway.interceptors;
2
-//
3
-//import com.xhkjedu.gateway.utils.AES;
4
-//import lombok.extern.slf4j.Slf4j;
5
-//import org.springframework.core.MethodParameter;
6
-//import org.springframework.http.HttpHeaders;
7
-//import org.springframework.http.HttpInputMessage;
8
-//import org.springframework.http.converter.HttpMessageConverter;
9
-//import org.springframework.util.CollectionUtils;
10
-//import org.springframework.util.StreamUtils;
11
-//import org.springframework.web.bind.annotation.ControllerAdvice;
12
-//import org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice;
13
-//
14
-//import javax.crypto.BadPaddingException;
15
-//import javax.crypto.IllegalBlockSizeException;
16
-//import javax.crypto.NoSuchPaddingException;
17
-//import java.io.ByteArrayInputStream;
18
-//import java.io.IOException;
19
-//import java.io.InputStream;
20
-//import java.io.UnsupportedEncodingException;
21
-//import java.lang.reflect.Type;
22
-//import java.security.InvalidKeyException;
23
-//import java.security.NoSuchAlgorithmException;
24
-//import java.util.List;
25
-//
26
-///**
27
-// * @ClassName DecryptRequestBodyAdvice
28
-// * Description TODO AES解密  (在网关中不可用)
29
-// * Author WN
30
-// * Date 2021/5/12 11:34
31
-// **/
32
-//@Slf4j
33
-//@ControllerAdvice
34
-//public class DecryptRequestBodyAdvice implements RequestBodyAdvice {
35
-//
36
-//    private static String AES_KEY = "XINGHUOLIAOYUAN7";
37
-//
38
-//    /** 此处如果返回false , 则不执行当前Advice的业务 */
39
-//    @Override
40
-//    public boolean supports(MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) {
41
-////       log.info("----support----");
42
-//        return true;
43
-//    }
44
-//
45
-//    /**
46
-//     * @title 读取参数前执行
47
-//     * @description 在此做些编码 / 解密 / 封装参数为对象的操作
48
-//     **/
49
-//    @Override
50
-//    public HttpInputMessage beforeBodyRead(HttpInputMessage httpInputMessage, MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) throws IOException {
51
-////        log.info("----beforeBodyRead----");
52
-//
53
-//        //AES解密,false不需要解密
54
-//        List<String> decrypts = httpInputMessage.getHeaders().get("st");
55
-//        String decrypt = isListNotEmpty(decrypts)?decrypts.get(0):"false";
56
-//        if (!decrypt.equals("true")) {
57
-//            return httpInputMessage;
58
-//        }
59
-//        // 读取加密的请求体
60
-//        byte[] body = StreamUtils.copyToByteArray(httpInputMessage.getBody());
61
-//        String str = new String(body,"utf-8");
62
-//
63
-//        try {
64
-//            // 使用AES解密
65
-//            body = AES.decryptForByte(str, AES_KEY);
66
-//        } catch (InvalidKeyException | NoSuchAlgorithmException | NoSuchPaddingException | IllegalBlockSizeException |
67
-//                BadPaddingException | UnsupportedEncodingException e) {
68
-//            e.printStackTrace();
69
-//            throw new RuntimeException(e);
70
-//        } catch (Exception e){
71
-//            e.printStackTrace();
72
-//            throw new RuntimeException(e);
73
-//        }
74
-//
75
-//        // 使用解密后的数据,构造新的读取流
76
-//        InputStream rawInputStream = new ByteArrayInputStream(body);
77
-//        return new HttpInputMessage() {
78
-//            @Override
79
-//            public HttpHeaders getHeaders() {
80
-//                return httpInputMessage.getHeaders();
81
-//            }
82
-//
83
-//            @Override
84
-//            public InputStream getBody() throws IOException {
85
-//                return rawInputStream;
86
-//            }
87
-//        };
88
-//    }
89
-//
90
-//    /**
91
-//     * @title 读取参数后执行
92
-//     * @author Xingbz
93
-//     */
94
-//    @Override
95
-//    public Object afterBodyRead(Object o, HttpInputMessage httpInputMessage, MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) {
96
-////        log.info("afterBodyRead:----");
97
-//        return o;
98
-//    }
99
-//
100
-//    /**
101
-//     * @title 无请求时的处理
102
-//     */
103
-//    @Override
104
-//    public Object handleEmptyBody(Object o, HttpInputMessage httpInputMessage, MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) {
105
-////        log.info("handleEmptyBody:----");
106
-//        return o;
107
-//    }
108
-//
109
-//    private static boolean isListNotEmpty(List list) {
110
-//        if (CollectionUtils.isEmpty(list)){
111
-//            return false;
112
-//        } else {
113
-//            return true;
114
-//        }
115
-//    }
116
-//}

+ 119
- 106
sstudy/src/main/java/com/xhkjedu/sstudy/service/paperreport/PaperReportService.java 查看文件

@@ -398,7 +398,7 @@ public class PaperReportService {
398 398
             // 获取原来作业本身试题分析
399 399
             TPaperAnalyze paperAnalyze = paperAnalyzeMapper.getAnalyzeByPaperid(paper.getPaperid());
400 400
             setPaperQuestionForQues(stuQschoolMap, stuSchoolMap, rclassQuesList, paper);//试题分析
401
-            setPaperQuestionPoint(stuQlist, rclassPointList, paperAnalyze);// 知识点分析
401
+            setPaperQuestionPoint(stuQlist,stuList, rclassPointList, paperAnalyze);// 知识点分析
402 402
             setPaperQuestionStuForQues(stuQlist, rstuList, paper);// 学生得分
403 403
         }
404 404
         if (N_Utils.isListNotEmpty(rclassList)) paperRclassMapper.insertList(rclassList);
@@ -618,7 +618,7 @@ public class PaperReportService {
618 618
         }
619 619
     }
620 620
 
621
-    // 班级作业试题情况-题库作业试题分析(未提交学生参与计算、未作答班级生产报告)
621
+    // 班级作业试题情况-题库作业试题分析
622 622
     private void setPaperQuestionForQues(Map<Integer, List<PaperRStuQuestionVo>> stuQschoolMap, Map<Integer, List<PaperRStuVo>> stuSchoolMap, List<PaperRclassQuestion> rclassQuesList,
623 623
                                           TPaper paper) {
624 624
         List<PaperRQuestionVo> quesList = paperStudentQuestionMapper.listAllQuesByPaperid(paper.getPaperid());// 获取试卷中所有试题
@@ -852,119 +852,132 @@ public class PaperReportService {
852 852
     }
853 853
 
854 854
     // 班级作业试题情况-题库作业知识点分析
855
-    private void setPaperQuestionPoint(List<PaperRStuQuestionVo> stuQschoolList, List<PaperRclassPoint> rclassPointList, TPaperAnalyze paperAnalyze) {
856
-        // 原试卷知识点分析
857
-        String pointjson = paperAnalyze.getPointjson();
858
-        List<Map> pointlist = JSON.parseArray(pointjson, Map.class);
859
-
860
-        // 试题对应知识点关系
861
-        String quespointjson = paperAnalyze.getQuespointjson();
862
-        List<QuestionPointVo> quepointlist = JSON.parseArray(quespointjson, QuestionPointVo.class);
863
-
864
-        List<PaperPointStuScoreVo> gradestulist = new ArrayList<>();// 每个知识点每个学生的得分
865
-        for (int i = 0; i < quepointlist.size(); i++) {
866
-            QuestionPointVo qpoint = quepointlist.get(i);
867
-            List<Map> points = qpoint.getPointids();
868
-            if (N_Utils.isListNotEmpty(points)) {
869
-                if (qpoint.getQlevel() == 1 || !N_Utils.isEmptyInteger(qpoint.getPtqid())) {
870
-                    // 说明本题为单题,获取该题下所有学生的得分情况
871
-                    List<PaperRStuQuestionVo> stuqueslist = stuQschoolList.stream().filter(s -> s.getPtqid().equals(qpoint.getPtqid())).collect(Collectors.toList());
872
-                    for (PaperRStuQuestionVo sq : stuqueslist) {
873
-                        setEPaperQuestionPointsForStuQues(gradestulist, sq, points, qpoint.getPtqid().toString());
874
-                    }
875
-                } else {
876
-                    // 说明该题为复合题,获取所有子题
877
-                    List<Integer> eptqids = qpoint.getPtqids();
878
-                    String eptqidsStr = eptqids.stream().map(String::valueOf).collect(Collectors.joining(","));
879
-                    List<PaperRStuQuestionVo> stuqueslist = stuQschoolList.stream().filter(s -> eptqids.contains(s.getPtqid())).collect(Collectors.toList());
880
-                    // 根据每个学生分组获取每个学生该题分值:因一份作业可能发给多个班级的同一个学生,所有需要按学校班级分组后再按学生算
881
-                    Map<Integer,List<PaperRStuQuestionVo>> schoolQueMap = stuqueslist.stream().collect(Collectors.groupingBy(PaperRStuQuestionVo::getSchoolid));
882
-                    for(Map.Entry<Integer,List<PaperRStuQuestionVo>> schoolQueEntry : schoolQueMap.entrySet()){
883
-                        List<PaperRStuQuestionVo> classQueList = schoolQueEntry.getValue();
884
-                        Map<Integer,List<PaperRStuQuestionVo>> classQueMap = classQueList.stream().collect(Collectors.groupingBy(PaperRStuQuestionVo::getClassid));
885
-                        for(Map.Entry<Integer,List<PaperRStuQuestionVo>> sclassQueEntry : classQueMap.entrySet()){
886
-                            List<PaperRStuQuestionVo> stuQueList = sclassQueEntry.getValue();
887
-
888
-                            Map<Integer, List<PaperRStuQuestionVo>> stuquesmap = stuQueList.stream().collect(Collectors.groupingBy(PaperRStuQuestionVo::getStudentid));
889
-                            for (Map.Entry<Integer, List<PaperRStuQuestionVo>> entry : stuquesmap.entrySet()) {
890
-                                List<PaperRStuQuestionVo> stuques = entry.getValue();
891
-                                Double stuscore = stuques.stream().mapToDouble(PaperRStuQuestionVo::getStuscore).sum();
892
-                                stuscore = N_Utils.formatDouble(stuscore, 1);
893
-                                PaperRStuQuestionVo sqfirst = stuques.get(0);
894
-                                PaperRStuQuestionVo sq = new PaperRStuQuestionVo();
895
-                                sq.setStudentid(entry.getKey());
896
-                                sq.setClassid(sqfirst.getClassid());
897
-                                sq.setStuscore(stuscore);
898
-                                sq.setPaperid(sqfirst.getPaperid());
899
-                                sq.setSchoolid(sqfirst.getSchoolid());
900
-                                setEPaperQuestionPointsForStuQues(gradestulist, sq, points, eptqidsStr);
855
+    private void setPaperQuestionPoint(List<PaperRStuQuestionVo> stuQschoolList,List<PaperRStuVo> stuList, List<PaperRclassPoint> rclassPointList, TPaperAnalyze paperAnalyze) {
856
+
857
+        //获取学校提交作业学生数量,无学生提交时不生成试题得分率
858
+        List<PaperRStuVo> commitStuList = stuList.stream().filter(s -> s.getPsstate() > 0).collect(Collectors.toList());
859
+
860
+        if(N_Utils.isListNotEmpty(commitStuList)){
861
+            // 原试卷知识点分析
862
+            String pointjson = paperAnalyze.getPointjson();
863
+            List<Map> pointlist = JSON.parseArray(pointjson, Map.class);
864
+
865
+            // 试题对应知识点关系
866
+            String quespointjson = paperAnalyze.getQuespointjson();
867
+            List<QuestionPointVo> quepointlist = JSON.parseArray(quespointjson, QuestionPointVo.class);
868
+
869
+            List<PaperPointStuScoreVo> gradestulist = new ArrayList<>();// 每个知识点每个学生的得分
870
+            for (int i = 0; i < quepointlist.size(); i++) {
871
+                QuestionPointVo qpoint = quepointlist.get(i);
872
+                List<Map> points = qpoint.getPointids();
873
+                if (N_Utils.isListNotEmpty(points)) {
874
+                    if (qpoint.getQlevel() == 1 || !N_Utils.isEmptyInteger(qpoint.getPtqid())) {
875
+                        // 说明本题为单题,获取该题下所有学生的得分情况
876
+                        List<PaperRStuQuestionVo> stuqueslist = stuQschoolList.stream().filter(s -> s.getPtqid().equals(qpoint.getPtqid())).collect(Collectors.toList());
877
+                        for (PaperRStuQuestionVo sq : stuqueslist) {
878
+                            setEPaperQuestionPointsForStuQues(gradestulist, sq, points, qpoint.getPtqid().toString());
879
+                        }
880
+                    } else {
881
+                        // 说明该题为复合题,获取所有子题
882
+                        List<Integer> eptqids = qpoint.getPtqids();
883
+                        String eptqidsStr = eptqids.stream().map(String::valueOf).collect(Collectors.joining(","));
884
+                        List<PaperRStuQuestionVo> stuqueslist = stuQschoolList.stream().filter(s -> eptqids.contains(s.getPtqid())).collect(Collectors.toList());
885
+                        // 根据每个学生分组获取每个学生该题分值:因一份作业可能发给多个班级的同一个学生,所有需要按学校班级分组后再按学生算
886
+                        Map<Integer,List<PaperRStuQuestionVo>> schoolQueMap = stuqueslist.stream().collect(Collectors.groupingBy(PaperRStuQuestionVo::getSchoolid));
887
+                        for(Map.Entry<Integer,List<PaperRStuQuestionVo>> schoolQueEntry : schoolQueMap.entrySet()){
888
+                            List<PaperRStuQuestionVo> classQueList = schoolQueEntry.getValue();
889
+                            Map<Integer,List<PaperRStuQuestionVo>> classQueMap = classQueList.stream().collect(Collectors.groupingBy(PaperRStuQuestionVo::getClassid));
890
+                            for(Map.Entry<Integer,List<PaperRStuQuestionVo>> sclassQueEntry : classQueMap.entrySet()){
891
+                                List<PaperRStuQuestionVo> stuQueList = sclassQueEntry.getValue();
892
+
893
+                                Map<Integer, List<PaperRStuQuestionVo>> stuquesmap = stuQueList.stream().collect(Collectors.groupingBy(PaperRStuQuestionVo::getStudentid));
894
+                                for (Map.Entry<Integer, List<PaperRStuQuestionVo>> entry : stuquesmap.entrySet()) {
895
+                                    List<PaperRStuQuestionVo> stuques = entry.getValue();
896
+                                    Double stuscore = stuques.stream().mapToDouble(PaperRStuQuestionVo::getStuscore).sum();
897
+                                    stuscore = N_Utils.formatDouble(stuscore, 1);
898
+                                    PaperRStuQuestionVo sqfirst = stuques.get(0);
899
+                                    PaperRStuQuestionVo sq = new PaperRStuQuestionVo();
900
+                                    sq.setStudentid(entry.getKey());
901
+                                    sq.setClassid(sqfirst.getClassid());
902
+                                    sq.setStuscore(stuscore);
903
+                                    sq.setPaperid(sqfirst.getPaperid());
904
+                                    sq.setSchoolid(sqfirst.getSchoolid());
905
+                                    setEPaperQuestionPointsForStuQues(gradestulist, sq, points, eptqidsStr);
906
+                                }
901 907
                             }
902 908
                         }
903 909
                     }
904 910
                 }
905 911
             }
906
-        }
907
-
908
-        // 根据试卷知识点分析进行生成班级、学校知识点分析
909
-        for (Map map : pointlist) {
910
-            String pointid = map.get("pointid").toString();
911
-            String pointname = map.get("pointname").toString();
912
-            Double pointscore = Double.parseDouble(map.get("score").toString());
913
-            // Double pointrate = Double.parseDouble(map.get("srate").toString());
914
-            List<Map> qorders = (List<Map>) map.get("ques");
915
-            List<Integer> orders = qorders.stream().map(s -> Integer.parseInt(s.get("order").toString())).collect(Collectors.toList());
916
-            String orderstr = orders.stream().map(String::valueOf).collect(Collectors.joining(","));//试题
917
-            // 单个知识点学生得分情况:一个知识对应一个或多个试题,
918
-            List<PaperPointStuScoreVo> gradepointstulist = gradestulist.stream().filter(s -> s.getPointid().equals(pointid)).collect(Collectors.toList());
919
-
920
-            List<PaperPointStuScoreVo> pointstuscorelist = new ArrayList<>(); // 知识点下多个试题,处理成单个学生总分值情况
921
-            Map<Integer, List<PaperPointStuScoreVo>> pointstuscoremap = gradepointstulist.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getStudentid));
922
-            for (Map.Entry<Integer, List<PaperPointStuScoreVo>> entry : pointstuscoremap.entrySet()) {
923
-                List<PaperPointStuScoreVo> stuscorelist = entry.getValue();
924
-                Double stuscore = stuscorelist.stream().mapToDouble(PaperPointStuScoreVo::getStuscore).sum();
925
-                stuscore = N_Utils.formatDouble(stuscore, 1);
926
-
927
-                PaperPointStuScoreVo sscorevofirst = stuscorelist.get(0);
928
-                PaperPointStuScoreVo sscorevo = new PaperPointStuScoreVo();
929
-                sscorevo.setStudentid(sscorevofirst.getStudentid());
930
-                sscorevo.setClassid(sscorevofirst.getClassid());
931
-                sscorevo.setStuscore(stuscore);
932
-                sscorevo.setSchoolid(sscorevofirst.getSchoolid());
933
-                pointstuscorelist.add(sscorevo);
934
-            }
935 912
 
936
-            Map<Integer, List<PaperPointStuScoreVo>> schoolStuMap = pointstuscorelist.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getSchoolid));
937
-            for (Map.Entry<Integer, List<PaperPointStuScoreVo>> schoolentry : schoolStuMap.entrySet()) {
938
-                List<PaperPointStuScoreVo> schoolStuList = schoolentry.getValue();
939
-                double schoolScore = pointscore * schoolStuList.size();
940
-                double schoolStuScore = schoolStuList.stream().mapToDouble(PaperPointStuScoreVo::getStuscore).sum();
941
-                double schoolScorerate = N_Utils.getDoubleDivideAndMulitiply(schoolStuScore, schoolScore);
942
-                double schoolLostrate = N_Utils.getDoubleReduce(100.0, schoolScorerate);
943
-
944
-                // 学校下班级内学生试题
945
-                Map<Integer, List<PaperPointStuScoreVo>> classStuMap = schoolStuList.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getClassid));
946
-                for (Map.Entry<Integer, List<PaperPointStuScoreVo>> classMap : classStuMap.entrySet()) {
947
-                    List<PaperPointStuScoreVo> classStuList = classMap.getValue();
948
-                    PaperPointStuScoreVo pstuqVo = classStuList.get(0);
949
-                    double classScore = pointscore * classStuList.size();
950
-                    double classStuScore = classStuList.stream().mapToDouble(PaperPointStuScoreVo::getStuscore).sum();
951
-                    double classScorerate = N_Utils.getDoubleDivideAndMulitiply(classStuScore, classScore);
952
-                    double classLostrate = N_Utils.getDoubleReduce(100.0, classScorerate);
913
+            //把提交学生进行分组
914
+            Map<Integer,List<PaperRStuVo>> schoolCommitStuList = commitStuList.stream().collect(Collectors.groupingBy(PaperRStuVo :: getSchoolid));
915
+
916
+            // 根据试卷知识点分析进行生成班级、学校知识点分析
917
+            for (Map map : pointlist) {
918
+                String pointid = map.get("pointid").toString();
919
+                String pointname = map.get("pointname").toString();
920
+                Double pointscore = Double.parseDouble(map.get("score").toString());
921
+                // Double pointrate = Double.parseDouble(map.get("srate").toString());
922
+                List<Map> qorders = (List<Map>) map.get("ques");
923
+                List<Integer> orders = qorders.stream().map(s -> Integer.parseInt(s.get("order").toString())).collect(Collectors.toList());
924
+                String orderstr = orders.stream().map(String::valueOf).collect(Collectors.joining(","));//试题
925
+                // 单个知识点学生得分情况:一个知识对应一个或多个试题,
926
+                List<PaperPointStuScoreVo> gradepointstulist = gradestulist.stream().filter(s -> s.getPointid().equals(pointid)).collect(Collectors.toList());
927
+
928
+                List<PaperPointStuScoreVo> pointstuscorelist = new ArrayList<>(); // 知识点下多个试题,处理成单个学生总分值情况
929
+                Map<Integer, List<PaperPointStuScoreVo>> pointstuscoremap = gradepointstulist.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getStudentid));
930
+                for (Map.Entry<Integer, List<PaperPointStuScoreVo>> entry : pointstuscoremap.entrySet()) {
931
+                    List<PaperPointStuScoreVo> stuscorelist = entry.getValue();
932
+                    Double stuscore = stuscorelist.stream().mapToDouble(PaperPointStuScoreVo::getStuscore).sum();
933
+                    stuscore = N_Utils.formatDouble(stuscore, 1);
934
+
935
+                    PaperPointStuScoreVo sscorevofirst = stuscorelist.get(0);
936
+                    PaperPointStuScoreVo sscorevo = new PaperPointStuScoreVo();
937
+                    sscorevo.setStudentid(sscorevofirst.getStudentid());
938
+                    sscorevo.setClassid(sscorevofirst.getClassid());
939
+                    sscorevo.setStuscore(stuscore);
940
+                    sscorevo.setSchoolid(sscorevofirst.getSchoolid());
941
+                    pointstuscorelist.add(sscorevo);
942
+                }
953 943
 
954
-                    PaperRclassPoint ppoint = new PaperRclassPoint();
955
-                    ppoint.setPaperid(paperAnalyze.getPaperid());
956
-                    ppoint.setClassid(pstuqVo.getClassid());
957
-                    ppoint.setPointid(pointid);
958
-                    ppoint.setPointname(pointname);
959
-                    ppoint.setClassscorerate(classScorerate);
960
-                    ppoint.setClasslostrate(classLostrate);
961
-                    ppoint.setSchoolscorerate(schoolScorerate);
962
-                    ppoint.setSchoollostrate(schoolLostrate);
963
-                    ppoint.setQns(orderstr);
964
-                    rclassPointList.add(ppoint);
944
+                Map<Integer, List<PaperPointStuScoreVo>> schoolStuMap = pointstuscorelist.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getSchoolid));
945
+                for (Map.Entry<Integer, List<PaperPointStuScoreVo>> schoolentry : schoolStuMap.entrySet()) {
946
+                    Integer schoolid = schoolentry.getKey();
947
+                    //当学校有学生提交作业时进行计算知识点
948
+                    if(schoolCommitStuList.containsKey(schoolid)){
949
+                        List<PaperPointStuScoreVo> schoolStuList = schoolentry.getValue();
950
+                        double schoolScore = pointscore * schoolStuList.size();
951
+                        double schoolStuScore = schoolStuList.stream().mapToDouble(PaperPointStuScoreVo::getStuscore).sum();
952
+                        double schoolScorerate = N_Utils.getDoubleDivideAndMulitiply(schoolStuScore, schoolScore);
953
+                        double schoolLostrate = N_Utils.getDoubleReduce(100.0, schoolScorerate);
954
+
955
+                        // 学校下班级内学生试题
956
+                        Map<Integer, List<PaperPointStuScoreVo>> classStuMap = schoolStuList.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getClassid));
957
+                        for (Map.Entry<Integer, List<PaperPointStuScoreVo>> classMap : classStuMap.entrySet()) {
958
+                            List<PaperPointStuScoreVo> classStuList = classMap.getValue();
959
+                            PaperPointStuScoreVo pstuqVo = classStuList.get(0);
960
+                            double classScore = pointscore * classStuList.size();
961
+                            double classStuScore = classStuList.stream().mapToDouble(PaperPointStuScoreVo::getStuscore).sum();
962
+                            double classScorerate = N_Utils.getDoubleDivideAndMulitiply(classStuScore, classScore);
963
+                            double classLostrate = N_Utils.getDoubleReduce(100.0, classScorerate);
964
+
965
+                            PaperRclassPoint ppoint = new PaperRclassPoint();
966
+                            ppoint.setPaperid(paperAnalyze.getPaperid());
967
+                            ppoint.setClassid(pstuqVo.getClassid());
968
+                            ppoint.setPointid(pointid);
969
+                            ppoint.setPointname(pointname);
970
+                            ppoint.setClassscorerate(classScorerate);
971
+                            ppoint.setClasslostrate(classLostrate);
972
+                            ppoint.setSchoolscorerate(schoolScorerate);
973
+                            ppoint.setSchoollostrate(schoolLostrate);
974
+                            ppoint.setQns(orderstr);
975
+                            rclassPointList.add(ppoint);
976
+                        }
977
+                    }
965 978
                 }
966
-            }
967 979
 
980
+            }
968 981
         }
969 982
     }
970 983
 

Loading…
取消
儲存