‘linchangsheng’ vor 1 Woche
Ursprung
Commit
3b2a571f8f

+ 21 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderBaseEsLogic.java

@@ -740,6 +740,27 @@ public class OrderBaseEsLogic {
 
         List<OrderBaseVO> orderBaseVOS1 = BeanUtil.copyToList(orderBaseVOS, OrderBaseVO.class);
 
+
+        List<String> orderBaseIds = orderBaseVOS1
+                .stream()
+                .map(OrderBaseVO::getId)
+                .collect(Collectors.toList());
+
+        List<WorkerOrder> workerOrderList = workerOrderService.lambdaQuery().in(WorkerOrder::getWorkerOrderId, orderBaseIds)
+                .eq(WorkerOrder::getPayStatus, MaterialExamineStatusEnum.PAID.getKey())
+                .select(WorkerOrder::getWorkerOrderId, WorkerOrder::getTotalAmount).list();
+
+        for (OrderBaseVO orderBaseVO : orderBaseVOS1) {
+
+            List<WorkerOrder> workerOrders = workerOrderList.stream()
+                    .filter(item -> item.getWorkerOrderId().equals(orderBaseVO.getId())).collect(Collectors.toList());
+            if (!CollectionUtils.isEmpty(workerOrderList)) {
+                BigDecimal bigDecimal = workerOrders.stream().map(WorkerOrder::getTotalAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
+                orderBaseVO.setWorkerPrice(bigDecimal);
+            }
+
+        }
+
         return orderBaseVOS1;
 
     }