|
@@ -242,18 +242,12 @@ public class ScoreReportThread implements Runnable {
|
|
|
query.setPageNumber(1);
|
|
|
query.setPageSize(Integer.MAX_VALUE);
|
|
|
List<ReportSubjectGroup> list = reportSubjectGroupService.findByQuery(query);
|
|
|
- if (list.isEmpty()) {
|
|
|
- return;
|
|
|
- }
|
|
|
for (ReportSubjectGroup r : list) {
|
|
|
r.setAvgScore(new BigDecimal(r.getAvgScore()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
|
r.setScoreRate(new BigDecimal(r.getScoreRate()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
|
r.setStdev(new BigDecimal(r.getStdev()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
|
r.setCoefficient(new BigDecimal(r.getCoefficient()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
|
}
|
|
|
- if (list.isEmpty()) {
|
|
|
- return;
|
|
|
- }
|
|
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
|
|
new ExportExcel(name, ReportSubjectGroup.class).setDataList(list).write(os);
|
|
|
os.flush();
|
|
@@ -278,9 +272,6 @@ public class ScoreReportThread implements Runnable {
|
|
|
r.setScoreRate(new BigDecimal(r.getScoreRate()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
|
r.setFullScoreRate(new BigDecimal(r.getFullScoreRate()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
|
}
|
|
|
- if (list.isEmpty()) {
|
|
|
- return;
|
|
|
- }
|
|
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
|
|
new ExportExcel(name, ReportSubjectQuestion.class).setDataList(list).write(os);
|
|
|
os.flush();
|
|
@@ -305,9 +296,6 @@ public class ScoreReportThread implements Runnable {
|
|
|
r.setRelativeAvgScore(new BigDecimal(r.getRelativeAvgScore()).setScale(2, RoundingMode.HALF_UP)
|
|
|
.doubleValue());
|
|
|
}
|
|
|
- if (list.isEmpty()) {
|
|
|
- return;
|
|
|
- }
|
|
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
|
|
new ExportExcel(name, ReportSubjectTeacher.class).setDataList(list).write(os);
|
|
|
os.flush();
|
|
@@ -330,9 +318,6 @@ public class ScoreReportThread implements Runnable {
|
|
|
r.setExcellentRate(new BigDecimal(r.getExcellentRate()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
|
r.setPassRate(new BigDecimal(r.getPassRate()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
|
}
|
|
|
- if (list.isEmpty()) {
|
|
|
- return;
|
|
|
- }
|
|
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
|
|
new ExportExcel(name, ReportSubjectClass.class).setDataList(list).write(os);
|
|
|
os.flush();
|
|
@@ -355,9 +340,6 @@ public class ScoreReportThread implements Runnable {
|
|
|
r.setExcellentRate(new BigDecimal(r.getExcellentRate()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
|
r.setPassRate(new BigDecimal(r.getPassRate()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
|
}
|
|
|
- if (list.isEmpty()) {
|
|
|
- return;
|
|
|
- }
|
|
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
|
|
new ExportExcel(name, ReportSubjectCollege.class).setDataList(list).write(os);
|
|
|
os.flush();
|
|
@@ -371,16 +353,16 @@ public class ScoreReportThread implements Runnable {
|
|
|
Exception {
|
|
|
List<ReportSubjectRangeDTO> list = new ArrayList<ReportSubjectRangeDTO>();
|
|
|
ReportSubject subject = reportSubjectService.findOne(examId, subjectCode);
|
|
|
- JSONArray array = getScoreRange(subject.getScoreRange(), subject.getTotalScore(), subject.getRealityCount(), 10);
|
|
|
- for (int i = 0; i < array.size(); i++) {
|
|
|
- JSONObject jsonObject = array.getJSONObject(i);
|
|
|
- String score = jsonObject.getInt("score") + "-";
|
|
|
- Integer rangeCount = jsonObject.getInt("rangeCount");
|
|
|
- Double rangeRate = jsonObject.getDouble("rangeRate");
|
|
|
- list.add(new ReportSubjectRangeDTO(score, rangeCount, rangeRate));
|
|
|
- }
|
|
|
- if (list.isEmpty()) {
|
|
|
- return;
|
|
|
+ if (subject != null) {
|
|
|
+ JSONArray array = getScoreRange(subject.getScoreRange(), subject.getTotalScore(),
|
|
|
+ subject.getRealityCount(), 10);
|
|
|
+ for (int i = 0; i < array.size(); i++) {
|
|
|
+ JSONObject jsonObject = array.getJSONObject(i);
|
|
|
+ String score = jsonObject.getInt("score") + "-";
|
|
|
+ Integer rangeCount = jsonObject.getInt("rangeCount");
|
|
|
+ Double rangeRate = jsonObject.getDouble("rangeRate");
|
|
|
+ list.add(new ReportSubjectRangeDTO(score, rangeCount, rangeRate));
|
|
|
+ }
|
|
|
}
|
|
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
|
|
new ExportExcel(name, ReportSubjectRangeDTO.class).setDataList(list).write(os);
|