From 562699fa6d0c279fe0f4f81ce87c336a34a3fb91 Mon Sep 17 00:00:00 2001 From: hjl <1657978663@qq.com> Date: 星期二, 23 七月 2024 14:32:23 +0800 Subject: [PATCH] feat: 数据迁移;netty通信;bug修改 --- ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/service/impl/MasterWorkerServiceImpl.java | 24 +++++++++++++++--------- 1 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/service/impl/MasterWorkerServiceImpl.java b/ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/service/impl/MasterWorkerServiceImpl.java index 1278b27..e01981d 100644 --- a/ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/service/impl/MasterWorkerServiceImpl.java +++ b/ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/service/impl/MasterWorkerServiceImpl.java @@ -59,8 +59,7 @@ Long distance = result.getDatas(); // 回收服务信息 RecoveryServe recoveryServe = recoveryServeService.lambdaQuery() - .eq(RecoveryServe::getId, order.getServeId()) - .eq(RecoveryServe::getIsDelete, 0).one(); + .eq(RecoveryServe::getId, order.getServeId()).one(); // vo类信息封装 OrderListVO orderListVO = new OrderListVO(); orderListVO.setOrderId(order.getId()); @@ -93,8 +92,18 @@ OrderNotHandleVO vo = new OrderNotHandleVO(distance, orderListVO); list.add(vo); } + List<OrderNotHandleVO> newList = new ArrayList<>(); if (item) { - return list.stream().map(OrderNotHandleVO::getOrderList).collect(Collectors.toList()); + // 已置顶订单 + List<OrderNotHandleVO> topSortNotNull = list.stream() + .filter(data -> data.getOrderList().getTopSort() != null).collect(Collectors.toList()); + newList.addAll(topSortNotNull); + // 未置顶订单,根据距离由近到远排序 + List<OrderNotHandleVO> topSortNull = list.stream() + .filter(data -> data.getOrderList().getTopSort() == null).collect(Collectors.toList()); + topSortNull.sort(Comparator.comparing(OrderNotHandleVO::getDistance)); + newList.addAll(topSortNull); + return newList.stream().map(OrderNotHandleVO::getOrderList).collect(Collectors.toList()); } else { // 根据距离排序 list.sort(Comparator.comparing(OrderNotHandleVO::getDistance)); @@ -102,8 +111,7 @@ for (OrderListVO orderListVO : resultList) { Integer serveId = orderListVO.getServeId(); // 回收服务信息 - RecoveryServe recoveryServe = recoveryServeService.lambdaQuery().eq(RecoveryServe::getId, serveId) - .eq(RecoveryServe::getIsDelete, 0).one(); + RecoveryServe recoveryServe = recoveryServeService.lambdaQuery().eq(RecoveryServe::getId, serveId).one(); if (null != recoveryServe) { orderListVO.setServePicture(recoveryServe.getCover()); } @@ -128,8 +136,7 @@ Long distance = result.getDatas(); // 回收服务信息 RecoveryServe recoveryServe = recoveryServeService.lambdaQuery() - .eq(RecoveryServe::getId, order.getServeId()) - .eq(RecoveryServe::getIsDelete, 0).one(); + .eq(RecoveryServe::getId, order.getServeId()).one(); // vo类信息封装 OrderListVO orderListVO = new OrderListVO(); orderListVO.setOrderId(order.getId()); @@ -168,8 +175,7 @@ for (OrderListVO orderListVO : resultList) { Integer serveId = orderListVO.getServeId(); // 回收服务信息 - RecoveryServe recoveryServe = recoveryServeService.lambdaQuery().eq(RecoveryServe::getId, serveId) - .eq(RecoveryServe::getIsDelete, 0).one(); + RecoveryServe recoveryServe = recoveryServeService.lambdaQuery().eq(RecoveryServe::getId, serveId).one(); if (null != recoveryServe) { orderListVO.setServePicture(recoveryServe.getCover()); } -- Gitblit v1.7.1