zhizhi wu 4 years ago
parent
commit
44bcf4b4af
  1. 13
      wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java

13
wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java

@ -229,7 +229,18 @@ public class RecordService implements IRecordService{
}
if (types.length > 1) {
log.info("重新排序");
Collections.sort(records, (o1, o2) -> (int) (o1.getTime() - o2.getTime()));
Collections.sort(records, (o1, o2) ->{
if (o1 == null || o1.getTime() == null) {
if (o2 == null || o2.getTime() == null) {
return 0;
}
return -1;
}
if (o2 == null || o2.getTime() == null) {
return -1;
}
return (int) (o1.getTime() - o2.getTime());
} );
}
return records;
}

Loading…
Cancel
Save