|
@@ -1,6 +1,5 @@
|
|
|
package edu.nju.service;
|
|
|
|
|
|
-import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIGlobalBinding;
|
|
|
import edu.nju.dao.BugDao;
|
|
|
import edu.nju.dao.BugScoreDao;
|
|
|
import edu.nju.dao.ReportDao;
|
|
@@ -15,6 +14,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Comparator;
|
|
|
import java.util.List;
|
|
|
import edu.nju.util.HTTP;
|
|
|
|
|
@@ -60,8 +60,8 @@ public class ExportService {
|
|
|
exportBugDTO.setTitle(bug.getTitle());
|
|
|
exportBugDTO.setDescription(bug.getDescription());
|
|
|
if(bugScore!=null) {
|
|
|
- exportBugDTO.setScore(String.valueOf(bugScore.getScore()));
|
|
|
- totalScore += bugScore.getScore();
|
|
|
+ exportBugDTO.setScore(String.valueOf(bugScore.getGrade()));
|
|
|
+ totalScore += bugScore.getGrade();
|
|
|
}else{
|
|
|
exportBugDTO.setScore("0");
|
|
|
}
|
|
@@ -88,6 +88,16 @@ public class ExportService {
|
|
|
exportReportDTO.setTotalScore(String.valueOf(totalScore));
|
|
|
exportReportDTOList.add(exportReportDTO);
|
|
|
}
|
|
|
+
|
|
|
+ totalScoreSort(exportReportDTOList);
|
|
|
return exportReportDTOList;
|
|
|
}
|
|
|
+
|
|
|
+ public void totalScoreSort(List<ExportReportDTO> list ){
|
|
|
+ list.sort(new Comparator<ExportReportDTO>() {
|
|
|
+ public int compare(ExportReportDTO report1, ExportReportDTO report2) {
|
|
|
+ return (Integer.parseInt(report2.getTotalScore()) - Integer.parseInt(report1.getTotalScore()));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|