|
@@ -1,8 +1,25 @@
|
1
|
1
|
package com.xhkjedu.sapi.service.classreport;
|
2
|
2
|
|
3
|
3
|
import com.alibaba.fastjson.JSON;
|
4
|
|
-import com.xhkjedu.sapi.mapper.classreport.*;
|
5
|
|
-import com.xhkjedu.sapi.model.classreport.*;
|
|
4
|
+import com.xhkjedu.sapi.mapper.classreport.ClassReportMapper;
|
|
5
|
+import com.xhkjedu.sapi.mapper.classreport.ReportClassErrorqueMapper;
|
|
6
|
+import com.xhkjedu.sapi.mapper.classreport.ReportClassErrorquefdMapper;
|
|
7
|
+import com.xhkjedu.sapi.mapper.classreport.ReportClassGuideMapper;
|
|
8
|
+import com.xhkjedu.sapi.mapper.classreport.ReportClassLiveMapper;
|
|
9
|
+import com.xhkjedu.sapi.mapper.classreport.ReportClassPaperMapper;
|
|
10
|
+import com.xhkjedu.sapi.mapper.classreport.ReportClassPointMapper;
|
|
11
|
+import com.xhkjedu.sapi.mapper.classreport.ReportClassReciteMapper;
|
|
12
|
+import com.xhkjedu.sapi.mapper.classreport.ReportClassRoomMapper;
|
|
13
|
+import com.xhkjedu.sapi.mapper.classreport.ReportClasstypeMapper;
|
|
14
|
+import com.xhkjedu.sapi.model.classreport.TReportClassErrorque;
|
|
15
|
+import com.xhkjedu.sapi.model.classreport.TReportClassErrorquefd;
|
|
16
|
+import com.xhkjedu.sapi.model.classreport.TReportClassGuide;
|
|
17
|
+import com.xhkjedu.sapi.model.classreport.TReportClassLive;
|
|
18
|
+import com.xhkjedu.sapi.model.classreport.TReportClassPaper;
|
|
19
|
+import com.xhkjedu.sapi.model.classreport.TReportClassPoint;
|
|
20
|
+import com.xhkjedu.sapi.model.classreport.TReportClassRecite;
|
|
21
|
+import com.xhkjedu.sapi.model.classreport.TReportClassRoom;
|
|
22
|
+import com.xhkjedu.sapi.model.classreport.TReportClasstype;
|
6
|
23
|
import com.xhkjedu.sapi.vo.classreport.CGradeSubjectVo;
|
7
|
24
|
import com.xhkjedu.sapi.vo.classreport.ReportClasstypeVo;
|
8
|
25
|
import com.xhkjedu.sapi.vo.classreport.ReportRateVo;
|
|
@@ -13,7 +30,14 @@ import lombok.extern.slf4j.Slf4j;
|
13
|
30
|
import org.springframework.stereotype.Service;
|
14
|
31
|
|
15
|
32
|
import javax.annotation.Resource;
|
16
|
|
-import java.util.*;
|
|
33
|
+import java.util.ArrayList;
|
|
34
|
+import java.util.Comparator;
|
|
35
|
+import java.util.DoubleSummaryStatistics;
|
|
36
|
+import java.util.HashMap;
|
|
37
|
+import java.util.IntSummaryStatistics;
|
|
38
|
+import java.util.LinkedHashMap;
|
|
39
|
+import java.util.List;
|
|
40
|
+import java.util.Map;
|
17
|
41
|
import java.util.stream.Collectors;
|
18
|
42
|
|
19
|
43
|
/**
|
|
@@ -1055,8 +1079,8 @@ public class ClassReportService {
|
1055
|
1079
|
r.setGuidemaxnum(c.getMaxnum());//发布预习最高次数
|
1056
|
1080
|
r.setGuideprerate(c.getNumrate());//发布预习次数同比
|
1057
|
1081
|
r.setGuiderank(c.getRank());//发布预习次数排名
|
1058
|
|
- r.setPrerate(c.getTjprerate());//平均预习率
|
1059
|
|
- r.setGuideavgrate(c.getPjtjrate());//预习率同比
|
|
1082
|
+ r.setPrerate(c.getTjprerate());//预习率同比
|
|
1083
|
+ r.setGuideavgrate(c.getPjtjrate());//平均预习率
|
1060
|
1084
|
list1.add(r);
|
1061
|
1085
|
return list1;
|
1062
|
1086
|
}
|
|
@@ -1203,35 +1227,36 @@ public class ClassReportService {
|
1203
|
1227
|
|
1204
|
1228
|
Double commitrate = 0.0;//提交率
|
1205
|
1229
|
Double checkrate = 0.0;//批改率
|
1206
|
|
- if (module.equals("preview") || module.equals("classroom") || module.equals("paper") || module.equals("recite")) {//预习、课堂、作业、背诵
|
1207
|
|
- int xsnum = list2.stream().mapToInt(ReportClasstypeVo::getXsnum).sum();
|
1208
|
|
- int tjnum = list2.stream().mapToInt(ReportClasstypeVo::getTjnum).sum();
|
1209
|
|
- pjtjrate = N_Utils.formatDouble(list2.stream().mapToDouble(ReportClasstypeVo::getNumrate).summaryStatistics().getAverage(), 2);
|
1210
|
|
- commitrate = N_Utils.getIntegerDivideAndMulitiply(tjnum, xsnum);
|
|
1230
|
+ gslist.add(gs);
|
|
1231
|
+ if (cid.equals(classid)) {
|
|
1232
|
+ if (module.equals("preview") || module.equals("classroom") || module.equals("paper") || module.equals("recite")) {//预习、课堂、作业、背诵
|
|
1233
|
+ int xsnum = list2.stream().mapToInt(ReportClasstypeVo::getXsnum).sum();
|
|
1234
|
+ int tjnum = list2.stream().mapToInt(ReportClasstypeVo::getTjnum).sum();
|
|
1235
|
+ pjtjrate = N_Utils.formatDouble(list2.stream().mapToDouble(ReportClasstypeVo::getNumrate).summaryStatistics().getAverage(), 2);
|
|
1236
|
+ commitrate = N_Utils.getIntegerDivideAndMulitiply(tjnum, xsnum);
|
1211
|
1237
|
|
1212
|
|
- if (module.equals("paper")) {//作业
|
1213
|
|
- int pgnum = list2.stream().mapToInt(ReportClasstypeVo::getPgnum).sum();
|
1214
|
|
- checkrate = N_Utils.getIntegerDivideAndMulitiply(pgnum, tjnum);
|
1215
|
|
- pjpgrate = N_Utils.formatDouble(list2.stream().mapToDouble(ReportClasstypeVo::getPgrate).summaryStatistics().getAverage(), 2);
|
|
1238
|
+ if (module.equals("paper")) {//作业
|
|
1239
|
+ int pgnum = list2.stream().mapToInt(ReportClasstypeVo::getPgnum).sum();
|
|
1240
|
+ checkrate = N_Utils.getIntegerDivideAndMulitiply(pgnum, tjnum);
|
|
1241
|
+ pjpgrate = N_Utils.formatDouble(list2.stream().mapToDouble(ReportClasstypeVo::getPgrate).summaryStatistics().getAverage(), 2);
|
|
1242
|
+ }
|
|
1243
|
+ } else if (module.equals("live")) {//直播
|
|
1244
|
+ pjtjrate = N_Utils.formatDouble(list2.stream().mapToDouble(ReportClasstypeVo::getMinutenum).summaryStatistics().getAverage(), 2);
|
1216
|
1245
|
}
|
1217
|
|
- } else if (module.equals("live")) {//直播
|
1218
|
|
- pjtjrate = N_Utils.formatDouble(list2.stream().mapToDouble(ReportClasstypeVo::getMinutenum).summaryStatistics().getAverage(), 2);
|
1219
|
|
- }
|
1220
|
1246
|
|
1221
|
|
- Double correctrate = 0.0;//正确率
|
1222
|
|
- if (module.equals("paper") || module.equals("recite")) {//作业、背诵
|
1223
|
|
- Double pscore = list2.stream().mapToDouble(ReportClasstypeVo::getPscore).sum();
|
1224
|
|
- Double uscore = list2.stream().mapToDouble(ReportClasstypeVo::getUscore).sum();
|
1225
|
|
- correctrate = N_Utils.getDoubleDivideAndMulitiply(uscore, pscore);
|
1226
|
|
- pjzqrate = N_Utils.formatDouble(list2.stream().mapToDouble(ReportClasstypeVo::getZqrate).summaryStatistics().getAverage(), 2);
|
1227
|
|
- }
|
1228
|
|
- gslist.add(gs);
|
1229
|
|
- if (cid.equals(classid)) {
|
|
1247
|
+ Double correctrate = 0.0;//正确率
|
|
1248
|
+ if (module.equals("paper") || module.equals("recite")) {//作业、背诵
|
|
1249
|
+ Double pscore = list2.stream().mapToDouble(ReportClasstypeVo::getPscore).sum();
|
|
1250
|
+ Double uscore = list2.stream().mapToDouble(ReportClasstypeVo::getUscore).sum();
|
|
1251
|
+ correctrate = N_Utils.getDoubleDivideAndMulitiply(uscore, pscore);
|
|
1252
|
+ pjzqrate = N_Utils.formatDouble(list2.stream().mapToDouble(ReportClasstypeVo::getZqrate).summaryStatistics().getAverage(), 2);
|
|
1253
|
+ }
|
1230
|
1254
|
fbnum = num;
|
1231
|
1255
|
if (module.equals("preview")) {//预习
|
1232
|
1256
|
YearOnYearVo y = years.stream().filter(v -> v.getClassid().equals(type.getClassid()) && v.getSubjectid().equals(type.getSubjectid())).findFirst().orElse(null);
|
1233
|
1257
|
if (y != null) {
|
1234
|
1258
|
prerate = N_Utils.getIntegerDivideAndMulitiply(fbnum - y.getFbnum(), fbnum);
|
|
1259
|
+ tjprerate = N_Utils.formatDouble(commitrate - y.getTjrate(), 2);
|
1235
|
1260
|
}
|
1236
|
1261
|
} else if (module.equals("paper")) {//作业
|
1237
|
1262
|
YearOnYearVo y = years.stream().filter(v -> v.getClassid().equals(type.getClassid()) && v.getSubjectid().equals(type.getSubjectid())).findFirst().orElse(null);
|