Browse Source

REPORT-86430 AlphaFine插件中心tab页显示内容有误

release/11.0
Yann 2 years ago
parent
commit
b3e723952d
  1. 20
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java

20
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java

@ -29,6 +29,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Created by XiaXiang on 2017/3/27.
@ -199,18 +200,15 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
*/
List<PluginModel> parseDefaultPluginModel(List<Map> jsonObjects) {
List<PluginModel> pluginModels = new ArrayList<>();
String version = "v" + ProductConstants.MAIN_VERSION;
if (!Collections.isEmpty(jsonObjects)) {
jsonObjects.sort(PluginSearchManager::sortPluginByUploadTime);
int pluginModelsCount = 0;
String version = "v" + ProductConstants.MAIN_VERSION;
for (Map obj : jsonObjects) {
if (pluginModelsCount == DEFAULT_LIST_SIZE) {
break;
}
if (((Integer) obj.get(version)) == 1) {
pluginModels.add(getPluginModel(new JSONObject(obj), false));
pluginModelsCount++;
}
jsonObjects = jsonObjects.stream()
.filter(o -> ((Integer) o.get(version)) == 1)
.sorted(PluginSearchManager::sortPluginByUploadTime)
.collect(Collectors.toList());
int size = Math.min(DEFAULT_LIST_SIZE, jsonObjects.size());
for (int i = 0; i < size; i++) {
pluginModels.add(getPluginModel(new JSONObject(jsonObjects.get(i)), false));
}
}
return pluginModels;

Loading…
Cancel
Save