|
@@ -14,6 +14,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.Collections;
|
|
|
|
+import java.util.Comparator;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@@ -157,7 +159,12 @@ public class EtlKuaishouAudienceAccountDailyServiceImpl extends ServiceImpl<EtlK
|
|
private void completeData(List<JSONObject> list, List<String> typeList) {
|
|
private void completeData(List<JSONObject> list, List<String> typeList) {
|
|
List<String> newDayList = new ArrayList<>();
|
|
List<String> newDayList = new ArrayList<>();
|
|
for (JSONObject data : list) {
|
|
for (JSONObject data : list) {
|
|
- newDayList.add(data.getString("type"));
|
|
|
|
|
|
+ if (!newDayList.contains(data.getString("type"))) {
|
|
|
|
+ newDayList.add(data.getString("type"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!newDayList.contains("全部")) {
|
|
|
|
+ typeList.remove("全部");
|
|
}
|
|
}
|
|
for (String type : typeList) {
|
|
for (String type : typeList) {
|
|
if (!newDayList.contains(type)) {
|
|
if (!newDayList.contains(type)) {
|
|
@@ -167,6 +174,22 @@ public class EtlKuaishouAudienceAccountDailyServiceImpl extends ServiceImpl<EtlK
|
|
list.add(obj);
|
|
list.add(obj);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ userRechargeListSort(list);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private static void userRechargeListSort(List<JSONObject> list) {
|
|
|
|
+ Collections.sort(list, new Comparator<JSONObject>() {
|
|
|
|
+ @Override
|
|
|
|
+ public int compare(JSONObject o1, JSONObject o2) {
|
|
|
|
+ try {
|
|
|
|
+ String st1 = o1.getString("type");
|
|
|
|
+ String st2 = o2.getString("type");
|
|
|
|
+ return st1.compareTo(st2);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|