44323
2023-10-11 232d3efb20f87f9c60faeda7bae4bc96e5687bd3
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/DataStatisticsController.java
@@ -124,13 +124,24 @@
        IncomeQuery incomeQuery = new IncomeQuery();
        // 场地预约记录查询query
        SiteBookingQuery siteBookingQuery = new SiteBookingQuery();
        // 筛选运营商的是时候使用
        List<Integer> storeIds = new ArrayList<>();
        // 根据运营商ID 查询运营商下的所有门店
        if (storeId==null){
        if (operatorId!=null){
            List<TStore> stores = storeService.list(new QueryWrapper<TStore>().eq("operatorId", operatorId));
            // 拿到该运营商下的门店id集合
            List<Integer> storeIds = stores.stream().map(TStore::getId).collect(Collectors.toList());
                storeIds = stores.stream().map(TStore::getId).collect(Collectors.toList());
            query.setStoresIds(storeIds);
            siteBookingQuery.setStoreIds(storeIds);
                competitionQuery.setOperatorId(operatorId);
            }
        }else {
            List<Integer> list = new ArrayList<>();
            list.add(storeId);
            query.setStoresIds(list);
            siteBookingQuery.setStoreIds(list);
            competitionQuery.setStoreId(storeId);
        }
@@ -197,8 +208,8 @@
            incomeVOS.add(temp);
        }
        // 预约场地
        if (operatorId!=null){
            if (siteBookingQuery.getStoreIds().size()==0){
        // 说明当前运营商下没有门店
        if (operatorId!=null && storeIds.size()==0){
            }else{
                List<SiteBooking> siteBookings = siteClient.listAll(siteBookingQuery);
                for (SiteBooking siteBooking : siteBookings) {
@@ -212,8 +223,6 @@
                    }
                    incomeVOS.add(temp);
                }
            }
        }
        // 积分商品