Explorar el Código

事故告警弹窗接口事故列表倒序排序

tags/v1.2.0^2
chengwang hace 1 año
padre
commit
b88da91107
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. +4
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/AccidentNoticeService.java

+ 4
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/AccidentNoticeService.java Ver fichero

@@ -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);
}

Cargando…
Cancelar
Guardar