Commit 4de75497 authored by maliang's avatar maliang

权限控制

parent 2a840943
......@@ -246,7 +246,7 @@ public class AdvertiserServiceImpl implements AdvertiserService {
}
}
jsonObject.put("dataTime",resultExposure.get("dataTime"));
jsonObject.put("click",resultClick.get("sum"));
jsonObject.put("click",sortMap(cmap));
jsonObject.put("exposure",resultExposure.get("sum"));
}else {
Map<String, List<String>> click = minutesCodeIdClick.stream().filter(x->x.split(",")[1].equals(advertId)).collect(Collectors.groupingBy(x -> x.split(",")[0]));
......@@ -271,6 +271,18 @@ public class AdvertiserServiceImpl implements AdvertiserService {
return list;
}
public static List<Integer> sortMap(Map map){
Object[] objects = map.keySet().toArray();
Arrays.sort(objects);
List<Integer> sum=new ArrayList<>();
for(Object obj:objects){
String key=obj.toString();
Integer count=0;
sum.add(Integer.valueOf(map.get(key).toString()));
}
return sum;
}
public static JSONObject sumByKey(Map<String, List<String>> map){
Object[] objects = map.keySet().toArray();
Arrays.sort(objects);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment