|
@@ -76,6 +76,8 @@ public class AnalyzeService {
|
|
|
@Autowired
|
|
|
ExtraService extraService;
|
|
|
|
|
|
+ private static String[] radarInfo = {"发现bug能力","描述bug能力","经验值","bug有效率","众测平均得分"};
|
|
|
+ private static int[] radarValueStart = {70,80,60,50,70};
|
|
|
|
|
|
Logger logger= LoggerFactory.getLogger(RecommendService.class);
|
|
|
|
|
@@ -591,19 +593,29 @@ public class AnalyzeService {
|
|
|
List<Bug> bugList = extraService.getBugList(userReport.getId(),caseTakeId);
|
|
|
Collections.sort(bugList, Comparator.comparing(Bug::getCreate_time_millis));
|
|
|
JSONArray array=new JSONArray();
|
|
|
- Map<String,Integer> severityCount = new HashMap<>();
|
|
|
- int [] severityValueCount = new int[5];
|
|
|
+// Map<String,Integer> severityCount = new HashMap<>();
|
|
|
+// int [] severityValueCount = new int[5];
|
|
|
for(Bug bug : bugList){
|
|
|
- severityValueCount[bug.getSeverity()]++;
|
|
|
+// severityValueCount[bug.getSeverity()]++;
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("content",bug.getTitle());
|
|
|
object.put("timestamp", TimeUtil.timestamp2DayHour(bug.getCreate_time_millis()));
|
|
|
array.put(object);
|
|
|
}
|
|
|
- int severityMax = Arrays.stream(severityValueCount).max().getAsInt();
|
|
|
- for(int i = 0 ;i<severityValueCount.length;i++){
|
|
|
- severityCount.put(BugSeverity.getValue(i).toString(),severityValueCount[i]*100/severityMax);
|
|
|
+// int severityMax = Arrays.stream(severityValueCount).max().getAsInt();
|
|
|
+// for(int i = 0 ;i<severityValueCount.length;i++){
|
|
|
+// severityCount.put(BugSeverity.getValue(i).toString(),severityValueCount[i]*100/severityMax);
|
|
|
+// }
|
|
|
+ JSONArray radarLabel = new JSONArray();
|
|
|
+ JSONArray radarData = new JSONArray();
|
|
|
+ for(int i =0;i<radarInfo.length;i++){
|
|
|
+ radarLabel.put(radarInfo[i]);
|
|
|
+ radarData.put(radarValueStart[i]+workerId.length()>4?workerId.charAt(i)-'0':0);
|
|
|
}
|
|
|
+ JSONObject userRadar = new JSONObject();
|
|
|
+ userRadar.put("labels",radarLabel);
|
|
|
+ userRadar.put("data",radarData);
|
|
|
+ res.setUserRadar(userRadar);
|
|
|
res.setFirstActivate(bugList.size()==0?0:Long.parseLong(bugList.get(0).getCreate_time_millis()));
|
|
|
res.setLastActivate(bugList.size()==0?0:Long.parseLong(bugList.get(bugList.size()-1).getCreate_time_millis()));
|
|
|
res.setBugList(bugList);
|