You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
932 B
Java
29 lines
932 B
Java
package shuju;
|
|
|
|
import com.engine.jucailinkq.common.util.DateUtil;
|
|
import com.google.common.collect.Lists;
|
|
|
|
import java.time.ZoneOffset;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class Test {
|
|
public static void main(String[] args) {
|
|
List<Map<String, Object>> dataList = Lists.newArrayList();
|
|
dataList.add(new HashMap(){{
|
|
put("pbrq","2024-04-26");
|
|
put("pbsj","05:55");
|
|
}});
|
|
dataList.add(new HashMap(){{
|
|
put("pbrq","2024-04-26");
|
|
put("pbsj","08:55");
|
|
}});
|
|
dataList.add(new HashMap(){{
|
|
put("pbrq","2024-04-26");
|
|
put("pbsj","06:55");
|
|
}});
|
|
dataList = dataList.stream().sorted(Comparator.comparing(f-> DateUtil.getTime(f.get("pbrq")+" "+f.get("pbsj")).toInstant(ZoneOffset.of("+8")).toEpochMilli())).collect(Collectors.toList());
|
|
System.out.println(dataList);
|
|
}
|
|
}
|