xuhy
2024-09-25 842947e6ecf0bdf8fd98049c0e47eb3893a8cbdb
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TDataGeneratorServiceImpl.java
@@ -113,7 +113,10 @@
        List<OrderMealGeneratorCountDTO> orderMealGeneratorCountDTOS = dto.getOrderMealGeneratorCountDTOS();
        List<TOrderMeal> orderMeals = new ArrayList<>();
        for (OrderMealGeneratorCountDTO orderMealGeneratorCountDTO : orderMealGeneratorCountDTOS) {
            TBoard board = boards.stream().filter(e -> e.getId().equals(orderMealGeneratorCountDTO.getBoardId())).findFirst().get();
            TBoard board = boards.stream().filter(e -> e.getId().equals(orderMealGeneratorCountDTO.getBoardId())).findFirst().orElse(null);
            if(Objects.isNull(board)){
                throw new ServiceException("桌台用餐人数配置不存在");
            }
            Integer orderCount = orderMealGeneratorCountDTO.getOrderCount();
            // 查询当前桌的用餐人数
            for (int i = 1; i <= orderCount; i++) {
@@ -526,7 +529,7 @@
//                BigDecimal money = orderSaleGoods.stream().filter(e -> collect.contains(e.getOrderId()))
//                        .reduce(BigDecimal.ZERO, (x, y) -> x.add(y.getGoodsCostPrice().multiply(new BigDecimal(y.getGoodsCount()))), BigDecimal::add);
                if(!CollectionUtils.isEmpty(orderSales)){
                    BigDecimal money = orderSales.stream().map(TOrderSale::getPayMoney).reduce(BigDecimal::add).get();
                    BigDecimal money = orderSales.stream().filter(e -> e.getGeneratorId().equals(tDataGeneratorVO.getId())).map(TOrderSale::getPayMoney).reduce(BigDecimal::add).get();
                    tDataGeneratorVO.setTotalRevenue(money);
                }
            }