|
|
@ -29,7 +29,7 @@ import java.util.ArrayList; |
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.function.ToLongFunction; |
|
|
|
import java.util.function.Function; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Created by XiaXiang on 2017/3/27. |
|
|
|
* Created by XiaXiang on 2017/3/27. |
|
|
@ -204,18 +204,16 @@ public class PluginSearchManager implements AlphaFineSearchProvider { |
|
|
|
if (!Collections.isEmpty(jsonObjects)) { |
|
|
|
if (!Collections.isEmpty(jsonObjects)) { |
|
|
|
SimpleDateFormat format = new SimpleDateFormat(TIME_FORMAT); |
|
|
|
SimpleDateFormat format = new SimpleDateFormat(TIME_FORMAT); |
|
|
|
try { |
|
|
|
try { |
|
|
|
jsonObjects.sort(Comparator.comparingLong(new ToLongFunction<Map>() { |
|
|
|
jsonObjects.sort((v1, v2) -> { |
|
|
|
@Override |
|
|
|
|
|
|
|
public long applyAsLong(Map value) { |
|
|
|
|
|
|
|
long time = 0L; |
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
time = format.parse((String) value.get(UPLOAD_TIME)).getTime(); |
|
|
|
long t1 = format.parse((String) v1.get(UPLOAD_TIME)).getTime(); |
|
|
|
|
|
|
|
long t2 = format.parse((String) v2.get(UPLOAD_TIME)).getTime(); |
|
|
|
|
|
|
|
return Long.compare(t2, t1); |
|
|
|
} catch (ParseException e) { |
|
|
|
} catch (ParseException e) { |
|
|
|
FineLoggerFactory.getLogger().error(e, e.getMessage()); |
|
|
|
FineLoggerFactory.getLogger().error(e, e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
return time; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
}); |
|
|
|
}).reversed()); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
FineLoggerFactory.getLogger().error(e, e.getMessage()); |
|
|
|
FineLoggerFactory.getLogger().error(e, e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|