|
@@ -119,7 +119,7 @@ public class ExamCourseDataReportServiceImpl implements ExamCourseDataReportServ
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public ExamCourseMainTopTen getExamOrgMainTop10(Long projectId, Long examId) {
|
|
|
|
|
|
+ public ExamCourseMainTopTen getExamCourseMainTop10(Long projectId, Long examId) {
|
|
ExamCourseMainTopTen ret = new ExamCourseMainTopTen();
|
|
ExamCourseMainTopTen ret = new ExamCourseMainTopTen();
|
|
List<ExamCourseReportMainBean> list = getExamCourseMainList(projectId, examId);
|
|
List<ExamCourseReportMainBean> list = getExamCourseMainList(projectId, examId);
|
|
if (list != null && list.size() > 0) {
|
|
if (list != null && list.size() > 0) {
|
|
@@ -293,9 +293,17 @@ public class ExamCourseDataReportServiceImpl implements ExamCourseDataReportServ
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
|
|
public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
|
|
- if (o1.getPassParticipantRatio() > o2.getPassParticipantRatio()) {
|
|
|
|
|
|
+ Double d1=o1.getPassParticipantRatio();
|
|
|
|
+ Double d2=o2.getPassParticipantRatio();
|
|
|
|
+ if(d1==null) {
|
|
|
|
+ d1=0d;
|
|
|
|
+ }
|
|
|
|
+ if(d2==null) {
|
|
|
|
+ d2=0d;
|
|
|
|
+ }
|
|
|
|
+ if (d1 > d2) {
|
|
return 1 - ascOrDesc;
|
|
return 1 - ascOrDesc;
|
|
- } else if (o1.getPassParticipantRatio() < o2.getPassParticipantRatio()) {
|
|
|
|
|
|
+ } else if (d1 < d2) {
|
|
return -1 + ascOrDesc;
|
|
return -1 + ascOrDesc;
|
|
} else {
|
|
} else {
|
|
return 0;
|
|
return 0;
|
|
@@ -310,11 +318,11 @@ public class ExamCourseDataReportServiceImpl implements ExamCourseDataReportServ
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private List<PartitionTopTen<ExamCourseReportMainBean>> getPartitionSort(List<ExamCourseReportMainBean> list) {
|
|
|
|
- List<PartitionTopTen<ExamCourseReportMainBean>> ret = new ArrayList<PartitionTopTen<ExamCourseReportMainBean>>();
|
|
|
|
|
|
+ private List<PartitionTopTen<PartitionDataBean>> getPartitionSort(List<ExamCourseReportMainBean> list) {
|
|
|
|
+ List<PartitionTopTen<PartitionDataBean>> ret = new ArrayList<PartitionTopTen<PartitionDataBean>>();
|
|
int size = list.get(0).getPartitionData().size();
|
|
int size = list.get(0).getPartitionData().size();
|
|
for (int i = 0; i < size; i++) {
|
|
for (int i = 0; i < size; i++) {
|
|
- PartitionTopTen<ExamCourseReportMainBean> pt = new PartitionTopTen<ExamCourseReportMainBean>();
|
|
|
|
|
|
+ PartitionTopTen<PartitionDataBean> pt = new PartitionTopTen<PartitionDataBean>();
|
|
pt.setCountAsc(getPartitionCountSort(list, i, asc));
|
|
pt.setCountAsc(getPartitionCountSort(list, i, asc));
|
|
pt.setCountDesc(getPartitionCountSort(list, i, desc));
|
|
pt.setCountDesc(getPartitionCountSort(list, i, desc));
|
|
pt.setSignRatioAsc(getPartitionSignRatioSort(list, i, asc));
|
|
pt.setSignRatioAsc(getPartitionSignRatioSort(list, i, asc));
|
|
@@ -326,7 +334,7 @@ public class ExamCourseDataReportServiceImpl implements ExamCourseDataReportServ
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
- private List<ExamCourseReportMainBean> getPartitionCountSort(List<ExamCourseReportMainBean> list, int index,
|
|
|
|
|
|
+ private List<PartitionDataBean> getPartitionCountSort(List<ExamCourseReportMainBean> list, int index,
|
|
int ascOrDesc) {
|
|
int ascOrDesc) {
|
|
List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
|
|
List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
|
|
Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
|
|
Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
|
|
@@ -346,13 +354,13 @@ public class ExamCourseDataReportServiceImpl implements ExamCourseDataReportServ
|
|
|
|
|
|
});
|
|
});
|
|
if (ret.size() > 10) {
|
|
if (ret.size() > 10) {
|
|
- return ret.subList(0, 10);
|
|
|
|
|
|
+ return of(ret.subList(0, 10),index);
|
|
} else {
|
|
} else {
|
|
- return ret;
|
|
|
|
|
|
+ return of(ret,index);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private List<ExamCourseReportMainBean> getPartitionSignRatioSort(List<ExamCourseReportMainBean> list, int index,
|
|
|
|
|
|
+ private List<PartitionDataBean> getPartitionSignRatioSort(List<ExamCourseReportMainBean> list, int index,
|
|
int ascOrDesc) {
|
|
int ascOrDesc) {
|
|
List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
|
|
List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
|
|
Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
|
|
Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
|
|
@@ -372,13 +380,13 @@ public class ExamCourseDataReportServiceImpl implements ExamCourseDataReportServ
|
|
|
|
|
|
});
|
|
});
|
|
if (ret.size() > 10) {
|
|
if (ret.size() > 10) {
|
|
- return ret.subList(0, 10);
|
|
|
|
|
|
+ return of(ret.subList(0, 10),index);
|
|
} else {
|
|
} else {
|
|
- return ret;
|
|
|
|
|
|
+ return of(ret,index);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private List<ExamCourseReportMainBean> getPartitionParticipantRatioSort(List<ExamCourseReportMainBean> list,
|
|
|
|
|
|
+ private List<PartitionDataBean> getPartitionParticipantRatioSort(List<ExamCourseReportMainBean> list,
|
|
int index, int ascOrDesc) {
|
|
int index, int ascOrDesc) {
|
|
List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
|
|
List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
|
|
Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
|
|
Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
|
|
@@ -387,6 +395,12 @@ public class ExamCourseDataReportServiceImpl implements ExamCourseDataReportServ
|
|
public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
|
|
public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
|
|
Double c1 = o1.getPartitionData().get(index).getParticipantRatio();
|
|
Double c1 = o1.getPartitionData().get(index).getParticipantRatio();
|
|
Double c2 = o2.getPartitionData().get(index).getParticipantRatio();
|
|
Double c2 = o2.getPartitionData().get(index).getParticipantRatio();
|
|
|
|
+ if(c1==null) {
|
|
|
|
+ c1=0d;
|
|
|
|
+ }
|
|
|
|
+ if(c2==null) {
|
|
|
|
+ c2=0d;
|
|
|
|
+ }
|
|
if (c1 > c2) {
|
|
if (c1 > c2) {
|
|
return 1 - ascOrDesc;
|
|
return 1 - ascOrDesc;
|
|
} else if (c1 < c2) {
|
|
} else if (c1 < c2) {
|
|
@@ -398,21 +412,41 @@ public class ExamCourseDataReportServiceImpl implements ExamCourseDataReportServ
|
|
|
|
|
|
});
|
|
});
|
|
if (ret.size() > 10) {
|
|
if (ret.size() > 10) {
|
|
- return ret.subList(0, 10);
|
|
|
|
|
|
+ return of(ret.subList(0, 10),index);
|
|
} else {
|
|
} else {
|
|
- return ret;
|
|
|
|
|
|
+ return of(ret,index);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ private List<PartitionDataBean> of(List<ExamCourseReportMainBean> list, int index) {
|
|
|
|
+ List<PartitionDataBean> ret = new ArrayList<PartitionDataBean>();
|
|
|
|
+ for(ExamCourseReportMainBean b:list) {
|
|
|
|
+ PartitionDataBean pb=new PartitionDataBean();
|
|
|
|
+ pb.setCount(b.getPartitionData().get(index).getCount());
|
|
|
|
+ pb.setParticipantRatio(b.getPartitionData().get(index).getParticipantRatio());
|
|
|
|
+ pb.setSignRatio(b.getPartitionData().get(index).getSignRatio());
|
|
|
|
+ pb.setCourseName(b.getCourseName());
|
|
|
|
+ pb.setExamName(b.getExamName());
|
|
|
|
+ ret.add(pb);
|
|
|
|
+ }
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
private List<ExamCourseReportMainBean> getDifficultyDegreeSort(List<ExamCourseReportMainBean> list, int ascOrDesc) {
|
|
private List<ExamCourseReportMainBean> getDifficultyDegreeSort(List<ExamCourseReportMainBean> list, int ascOrDesc) {
|
|
List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
|
|
List<ExamCourseReportMainBean> ret = new ArrayList<ExamCourseReportMainBean>(list);
|
|
Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
|
|
Collections.sort(ret, new Comparator<ExamCourseReportMainBean>() {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
|
|
public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
|
|
- if (o1.getAvgDifficultyDegree() > o2.getAvgDifficultyDegree()) {
|
|
|
|
|
|
+ Double d1=o1.getAvgDifficultyDegree();
|
|
|
|
+ Double d2=o2.getAvgDifficultyDegree();
|
|
|
|
+ if(d1==null) {
|
|
|
|
+ d1=0d;
|
|
|
|
+ }
|
|
|
|
+ if(d2==null) {
|
|
|
|
+ d2=0d;
|
|
|
|
+ }
|
|
|
|
+ if (d1 > d2) {
|
|
return 1 - ascOrDesc;
|
|
return 1 - ascOrDesc;
|
|
- } else if (o1.getAvgDifficultyDegree() < o2.getAvgDifficultyDegree()) {
|
|
|
|
|
|
+ } else if (d1 < d2) {
|
|
return -1 + ascOrDesc;
|
|
return -1 + ascOrDesc;
|
|
} else {
|
|
} else {
|
|
return 0;
|
|
return 0;
|
|
@@ -432,9 +466,17 @@ public class ExamCourseDataReportServiceImpl implements ExamCourseDataReportServ
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
|
|
public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
|
|
- if (o1.getStd() > o2.getStd()) {
|
|
|
|
|
|
+ Double d1=o1.getStd();
|
|
|
|
+ Double d2=o2.getStd();
|
|
|
|
+ if(d1==null) {
|
|
|
|
+ d1=0d;
|
|
|
|
+ }
|
|
|
|
+ if(d2==null) {
|
|
|
|
+ d2=0d;
|
|
|
|
+ }
|
|
|
|
+ if (d1 > d2) {
|
|
return 1 - ascOrDesc;
|
|
return 1 - ascOrDesc;
|
|
- } else if (o1.getStd() < o2.getStd()) {
|
|
|
|
|
|
+ } else if (d1 < d2) {
|
|
return -1 + ascOrDesc;
|
|
return -1 + ascOrDesc;
|
|
} else {
|
|
} else {
|
|
return 0;
|
|
return 0;
|
|
@@ -454,9 +496,17 @@ public class ExamCourseDataReportServiceImpl implements ExamCourseDataReportServ
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
|
|
public int compare(ExamCourseReportMainBean o1, ExamCourseReportMainBean o2) {
|
|
- if (o1.getCdi() > o2.getCdi()) {
|
|
|
|
|
|
+ Double d1=o1.getCdi();
|
|
|
|
+ Double d2=o2.getCdi();
|
|
|
|
+ if(d1==null) {
|
|
|
|
+ d1=0d;
|
|
|
|
+ }
|
|
|
|
+ if(d2==null) {
|
|
|
|
+ d2=0d;
|
|
|
|
+ }
|
|
|
|
+ if (d1 > d2) {
|
|
return 1 - ascOrDesc;
|
|
return 1 - ascOrDesc;
|
|
- } else if (o1.getCdi() < o2.getCdi()) {
|
|
|
|
|
|
+ } else if (d1 < d2) {
|
|
return -1 + ascOrDesc;
|
|
return -1 + ascOrDesc;
|
|
} else {
|
|
} else {
|
|
return 0;
|
|
return 0;
|