|
@@ -2,9 +2,6 @@ package cn.com.qmth.stmms.admin.report;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.Comparator;
|
|
|
import java.util.List;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -58,30 +55,6 @@ public class ReportSubjectQuestionController extends BaseExamController {
|
|
|
query.setPageSize(Integer.MAX_VALUE);
|
|
|
if (StringUtils.isNotBlank(query.getSubjectCode()) && query.getObjective() != null) {
|
|
|
List<ReportSubjectQuestion> questions = reportSubjectQuestionService.findByQuery(query);
|
|
|
- questions = new ArrayList<>(questions);
|
|
|
- Collections.sort(questions, new Comparator<ReportSubjectQuestion>() {
|
|
|
-
|
|
|
- @Override
|
|
|
- public int compare(ReportSubjectQuestion o1, ReportSubjectQuestion o2) {
|
|
|
- int i = o1.getMainNumber() - o2.getMainNumber();
|
|
|
- if (i == 0) {
|
|
|
- if (o1.getSubNumber().contains("-")) {
|
|
|
- String[] o1s = o1.getSubNumber().split("-");
|
|
|
- String[] o2s = o2.getSubNumber().split("-");
|
|
|
- int j = Integer.parseUnsignedInt(o1s[0]) - Integer.parseUnsignedInt(o2s[0]);
|
|
|
- if (j == 0) {
|
|
|
- return Integer.parseUnsignedInt(o1s[1]) - Integer.parseUnsignedInt(o2s[1]);
|
|
|
- } else {
|
|
|
- return j;
|
|
|
- }
|
|
|
- } else {
|
|
|
- return Integer.parseUnsignedInt(o1.getSubNumber())
|
|
|
- - Integer.parseUnsignedInt(o2.getSubNumber());
|
|
|
- }
|
|
|
- }
|
|
|
- return i;
|
|
|
- }
|
|
|
- });
|
|
|
model.addAttribute("list", questions);
|
|
|
model.addAttribute("typeList", questionService.getPaperType(examId, query.getSubjectCode()));
|
|
|
}
|
|
@@ -99,29 +72,6 @@ public class ReportSubjectQuestionController extends BaseExamController {
|
|
|
query.setPageNumber(1);
|
|
|
query.setPageSize(Integer.MAX_VALUE);
|
|
|
List<ReportSubjectQuestion> list = reportSubjectQuestionService.findByQuery(query);
|
|
|
- Collections.sort(list, new Comparator<ReportSubjectQuestion>() {
|
|
|
-
|
|
|
- @Override
|
|
|
- public int compare(ReportSubjectQuestion o1, ReportSubjectQuestion o2) {
|
|
|
- int i = o1.getMainNumber() - o2.getMainNumber();
|
|
|
- if (i == 0) {
|
|
|
- if (o1.getSubNumber().contains("-")) {
|
|
|
- String[] o1s = o1.getSubNumber().split("-");
|
|
|
- String[] o2s = o2.getSubNumber().split("-");
|
|
|
- int j = Integer.parseUnsignedInt(o1s[0]) - Integer.parseUnsignedInt(o2s[0]);
|
|
|
- if (j == 0) {
|
|
|
- return Integer.parseUnsignedInt(o1s[1]) - Integer.parseUnsignedInt(o2s[1]);
|
|
|
- } else {
|
|
|
- return j;
|
|
|
- }
|
|
|
- } else {
|
|
|
- return Integer.parseUnsignedInt(o1.getSubNumber())
|
|
|
- - Integer.parseUnsignedInt(o2.getSubNumber());
|
|
|
- }
|
|
|
- }
|
|
|
- return i;
|
|
|
- }
|
|
|
- });
|
|
|
for (ReportSubjectQuestion r : list) {
|
|
|
r.setAvgScore(new BigDecimal(r.getAvgScore()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
|
r.setStdev(new BigDecimal(r.getStdev()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|