|
|
@@ -829,6 +829,48 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
|
|
|
return lists;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<StatisticsBean> getFSUp5Person(StatisticsBean obj) {
|
|
|
+ obj.setQueryType(2);
|
|
|
+ List<StatisticsBean> t_mthList = getPersonalScoreInfo(obj);
|
|
|
+ Map<Integer,StatisticsBean> t_map = new HashMap<>();
|
|
|
+ for(int i=0;i<t_mthList.size();i++){
|
|
|
+ t_mthList.get(i).setRanking(i);
|
|
|
+ t_map.put(t_mthList.get(i).getUser().getId(), t_mthList.get(i));
|
|
|
+ }
|
|
|
+ // 查询上一个月
|
|
|
+ obj.setMth(obj.getPrev_mth());
|
|
|
+ List<StatisticsBean> prev_mthList = getPersonalScoreInfo(obj);
|
|
|
+ for(int i=0;i<prev_mthList.size();i++){
|
|
|
+ Integer uid = prev_mthList.get(i).getUser().getId();
|
|
|
+ if(t_map.containsKey(uid)){
|
|
|
+ t_map.get(uid).setRanking_change(i - t_map.get(uid).getRanking());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 这边按照名词变化进行排名
|
|
|
+ t_mthList.sort(new Comparator<StatisticsBean>() {
|
|
|
+ @Override
|
|
|
+ public int compare(StatisticsBean o1, StatisticsBean o2) {
|
|
|
+ if(o1.getRanking_change() > o2.getRanking_change()){
|
|
|
+ return -1;
|
|
|
+ }else if(o1.getRanking_change() < o2.getRanking_change()){
|
|
|
+ return 1;
|
|
|
+ }else{
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if(obj.getOrder_type() ==0){
|
|
|
+ // 正序
|
|
|
+ return t_mthList.subList(0, 5);
|
|
|
+ }else if(obj.getOrder_type() ==1){
|
|
|
+ // 反序
|
|
|
+ return t_mthList.subList(t_mthList.size()-5, t_mthList.size());
|
|
|
+ }
|
|
|
+ return t_mthList;
|
|
|
+ }
|
|
|
|
|
|
}
|