@@ -18,7 +18,9 @@ import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.util.ArrayList; | |||
import java.util.Comparator; | |||
import java.util.List; | |||
import java.util.stream.Collectors; | |||
/** | |||
* @Author ChengWang | |||
@@ -76,6 +78,8 @@ public class AccidentNoticeService { | |||
} | |||
} | |||
} | |||
//对应list集合排序 | |||
list = list.stream().sorted(Comparator.comparing(Accident::getCreateTime).reversed()).collect(Collectors.toList()); | |||
return JsonResult.success(list); | |||
} |