diff --git a/zc-business/src/main/java/com/zc/business/controller/VideoController.java b/zc-business/src/main/java/com/zc/business/controller/VideoController.java index c7d6087a..45f6402f 100644 --- a/zc-business/src/main/java/com/zc/business/controller/VideoController.java +++ b/zc-business/src/main/java/com/zc/business/controller/VideoController.java @@ -35,12 +35,9 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; /** @@ -527,7 +524,14 @@ public class VideoController extends BaseController { List centerCameraList = iDcDeviceService.selectNearCamPile(UniversalEnum.TWO.getValue(), startMileage,endMileage); upCameraList.addAll(centerCameraList); List downCameraList = iDcDeviceService.selectNearCamPile(UniversalEnum.THREE.getValue(),startMileage,endMileage); - result.put("upCamera",upCameraList); + // 排序 + List sortedList = upCameraList.stream() + .sorted(Comparator.comparingInt((DcDevice d) -> + "1-2".equals(d.getChildType()) ? 0 : 1) + .thenComparing(DcDevice::getStakeMark, Comparator.reverseOrder())) + .collect(Collectors.toList()); + + result.put("upCamera",sortedList); result.put("downCamera",downCameraList); return AjaxResult.success(result);