|
@@ -786,40 +786,44 @@ public class AnalyzeService {
|
|
|
}
|
|
|
List<TestCase>testCases=testCaseDao.findByReports(reportIds);
|
|
|
testCaseNum+=testCases.size();
|
|
|
- List<ThumsUp>thumsUps=thumsUpDao.findByReports(reportIds);
|
|
|
+ List<BugMirror>bugMirrors=mdao.findByCase(caseTakeId);
|
|
|
int likeNum=0;
|
|
|
int dislikeNum=0;
|
|
|
- for(ThumsUp thumsUp:thumsUps){
|
|
|
- if(thumsUp.getThums()!=null){
|
|
|
- likeNum+=thumsUp.getThums().size();
|
|
|
+ for(BugMirror bugMirror:bugMirrors){
|
|
|
+ if(bugMirror.getGood()!=null){
|
|
|
+ likeNum+=bugMirror.getGood().size();
|
|
|
}
|
|
|
- if(thumsUp.getDiss()!=null){
|
|
|
- dislikeNum+=thumsUp.getDiss().size();
|
|
|
+ if(bugMirror.getBad()!=null){
|
|
|
+ dislikeNum+=bugMirror.getBad().size();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Map<String,Integer>workerDistribution=new HashMap<>();
|
|
|
List<String>bugIds=new ArrayList<>();
|
|
|
+ Map<String,String>bugWorkerMap=new HashMap<>();
|
|
|
for(Bug bug:bugs){
|
|
|
bugIds.add(bug.getId());
|
|
|
String reportId=bug.getReport_id();
|
|
|
if(reportId!=null) {
|
|
|
String workerId=reportWorkerMap.get(reportId);
|
|
|
if (workerId!=null) {
|
|
|
- int grade=0;
|
|
|
- if (workerDistribution.containsKey(workerId)) {
|
|
|
- workerDistribution.replace(workerId, workerDistribution.get(workerId) + grade);
|
|
|
- } else {
|
|
|
- workerDistribution.put(workerId, grade);
|
|
|
- }
|
|
|
+ bugWorkerMap.put(bug.getId(),workerId);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
Map<Integer,Integer>gradeDistribution=new HashMap<>();
|
|
|
+ Map<String,Integer>workerDistribution=new HashMap<>();
|
|
|
List<BugScore>bugScores=bsdao.findByIds(bugIds);
|
|
|
for(BugScore bugScore:bugScores){
|
|
|
int grade = bugScore.getGrade();
|
|
|
+ String workerId=bugWorkerMap.get(bugScore.getId());
|
|
|
+ if(workerId!=null){
|
|
|
+ if (workerDistribution.containsKey(workerId)) {
|
|
|
+ workerDistribution.replace(workerId, workerDistribution.get(workerId) + grade);
|
|
|
+ } else {
|
|
|
+ workerDistribution.put(workerId, grade);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (gradeDistribution.containsKey(grade)) {
|
|
|
gradeDistribution.replace(grade, gradeDistribution.get(grade) + 1);
|
|
|
} else {
|
|
@@ -873,9 +877,9 @@ public class AnalyzeService {
|
|
|
provinceDistribute.put(province, 1);
|
|
|
}
|
|
|
}
|
|
|
+ WorkerVO workerVO=new WorkerVO(workerId,name,school,grade);
|
|
|
+ workerRank.add(workerVO);
|
|
|
}
|
|
|
- WorkerVO workerVO=new WorkerVO(workerId,name,school,grade);
|
|
|
- workerRank.add(workerVO);
|
|
|
}
|
|
|
JSONArray workerDistribute=new JSONArray();
|
|
|
for(Map.Entry<String, Integer> entry : provinceDistribute.entrySet()){
|