| | |
| | | if(objectId>0){ |
| | | operatorId=objectId; |
| | | if(storeId==null){ |
| | | cityManagerId= storeService.list(new QueryWrapper<TStore>().eq("cityManagerId", objectId)).stream().map(TStore::getId).collect(Collectors.toList()); |
| | | cityManagerId= storeService.list(new QueryWrapper<TStore>().eq("cityManagerId", objectId).ne("state", 3)).stream().map(TStore::getId).collect(Collectors.toList()); |
| | | }else { |
| | | cityManagerId.add(storeId); |
| | | } |
| | |
| | | // 根据运营商ID 查询运营商下的所有门店 |
| | | if (storeId==null){ |
| | | if (operatorId!=null){ |
| | | List<TStore> stores = storeService.list(new QueryWrapper<TStore>().eq("operatorId", operatorId)); |
| | | List<TStore> stores = storeService.list(new QueryWrapper<TStore>().eq("operatorId", operatorId).ne("state", 3)); |
| | | // 拿到该运营商下的门店id集合 |
| | | storeIds = stores.stream().map(TStore::getId).collect(Collectors.toList()); |
| | | query.setStoresIds(storeIds); |
| | |
| | | int currentYear = today.getYear(); |
| | | List<IncomeStatisticsVO> yearly = new ArrayList<>(); |
| | | List<Object> years = new ArrayList<>(); |
| | | List<String> yearLabels = new ArrayList<>(); |
| | | for (int year = currentYear - 9; year <= currentYear; year++) { |
| | | final int statisticYear = year; |
| | | yearly.add(sumIncomeStatistics(incomeRecords, record -> getRecordDate(record) |
| | | .getYear() == statisticYear)); |
| | | years.add(year); |
| | | yearLabels.add(String.valueOf(year)); |
| | | } |
| | | |
| | | List<IncomeStatisticsVO> monthly = new ArrayList<>(); |
| | | List<String> monthLabels = new ArrayList<>(); |
| | | for (int month = 1; month <= 12; month++) { |
| | | final int statisticMonth = month; |
| | | monthly.add(sumIncomeStatistics(incomeRecords, record -> { |
| | | LocalDate date = getRecordDate(record); |
| | | return date.getYear() == currentYear && date.getMonthValue() == statisticMonth; |
| | | })); |
| | | monthLabels.add(String.format("%d-%02d", currentYear, month)); |
| | | } |
| | | |
| | | List<IncomeStatisticsVO> weekly = new ArrayList<>(); |
| | | List<String> weekLabels = new ArrayList<>(); |
| | | for (int weekIndex = 3; weekIndex >= 0; weekIndex--) { |
| | | LocalDate startDate = today.minusDays(weekIndex * 7L + 6L); |
| | | LocalDate endDate = today.minusDays(weekIndex * 7L); |
| | |
| | | LocalDate date = getRecordDate(record); |
| | | return !date.isBefore(startDate) && !date.isAfter(endDate); |
| | | })); |
| | | weekLabels.add(startDate.format(DateTimeFormatter.ISO_LOCAL_DATE) |
| | | + " 至 " + endDate.format(DateTimeFormatter.ISO_LOCAL_DATE)); |
| | | } |
| | | |
| | | List<IncomeStatisticsVO> daily = new ArrayList<>(); |
| | | List<String> dayLabels = new ArrayList<>(); |
| | | for (int dayIndex = 6; dayIndex >= 0; dayIndex--) { |
| | | LocalDate statisticDate = today.minusDays(dayIndex); |
| | | daily.add(sumIncomeStatistics(incomeRecords, record -> getRecordDate(record) |
| | | .equals(statisticDate))); |
| | | dayLabels.add(statisticDate.format(DateTimeFormatter.ISO_LOCAL_DATE)); |
| | | } |
| | | |
| | | IncomeStatisticsVO total = sumIncomeStatistics(incomeRecords, record -> true); |
| | |
| | | result.put("weekIncomeStatistics", weekly); |
| | | result.put("dayIncomeStatistics", daily); |
| | | result.put("year", years); |
| | | result.put("yearLabels", yearLabels); |
| | | result.put("monthLabels", monthLabels); |
| | | result.put("weekLabels", weekLabels); |
| | | result.put("dayLabels", dayLabels); |
| | | // 兼容既有图表消费字段,值调整为总营收金额。 |
| | | result.put("yearIncome", yearly.stream().map(IncomeStatisticsVO::getTotalIncomeAmount) |
| | | .collect(Collectors.toList())); |
| | |
| | | //赛事 |
| | | List<Integer> list2 = competitionClient.queryAppUserId(collect1); |
| | | list.addAll(list2); |
| | | // 没有消费用户时,避免 MyBatis-Plus 生成 userId IN () 的非法 SQL。 |
| | | if (list.isEmpty()) { |
| | | list.add(-1); |
| | | } |
| | | //门票 |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | id = resolveOperatorId(id); |
| | | List<TStore> list4 = storeService.list(new QueryWrapper<TStore>().eq("operatorId", id).eq("state", 1)); |
| | | List<Integer> collect1 = list4.stream().map(TStore::getId).collect(Collectors.toList()); |
| | | // 运营商没有门店时,后续查询不能生成 storeId IN ()。 |
| | | if (collect1.isEmpty()) { |
| | | collect1.add(-1); |
| | | } |
| | | //课程 |
| | | List<Integer> list = coursePackagePaymentClient.queryPaymentCoursePackage(collect1); |
| | | //场地 |
| | |
| | | //赛事 |
| | | List<Integer> list2 = competitionClient.queryAppUserId(collect1); |
| | | list.addAll(list2); |
| | | // 下游会员统计同样使用 IN 查询,空用户列表按无匹配记录处理。 |
| | | if (list.isEmpty()) { |
| | | list.add(-1); |
| | | } |
| | | //门票 |
| | | |
| | | HashMap<String, Object> map = appUserClient.stuYys(list); |
| | |
| | | List<Integer> userPt = appUserClient.getUserPt(Arrays.asList(1)); |
| | | HashMap<String, Object> map = competitionClient.actPt(userPt); |
| | | |
| | | List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getOperatorId, 0)); |
| | | List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getOperatorId, 0).ne(TStore::getState, 3)); |
| | | long l1=0; |
| | | for (TStore tStore : list) { |
| | | l1 += getStoreOperatingHours(tStore, new Date()); |
| | |
| | | competionVO.setStoreIds(collect1); |
| | | HashMap<String, Object> map = competitionClient.actYys(competionVO); |
| | | |
| | | List<TStore> lists = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getOperatorId, id)); |
| | | List<TStore> lists = storeService.list(new LambdaQueryWrapper<TStore>() |
| | | .eq(TStore::getOperatorId, id) |
| | | .eq(TStore::getState, 1)); |
| | | long l1=0; |
| | | for (TStore tStore : lists) { |
| | | l1 += getStoreOperatingHours(tStore, new Date()); |
| | |
| | | |
| | | HashMap<String, Object> map = competitionClient.actPt(list); |
| | | |
| | | List<TStore> lists = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getOperatorId, 0)); |
| | | List<TStore> lists = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getOperatorId, 0).ne(TStore::getState, 3)); |
| | | long l1=0; |
| | | for (TStore tStore : lists) { |
| | | l1 += getStoreOperatingHours(tStore, new Date()); |
| | |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | List<TSite> list3 = siteService.list(new LambdaQueryWrapper<TSite>().in(TSite::getId, collect)); |
| | | List<TSite> list3 = siteService.list(new LambdaQueryWrapper<TSite>().in(TSite::getId, collect).ne(TSite::getState, 3)); |
| | | for (SiteBooking siteBooking : list1) { |
| | | for (TSite tSite : list3) { |
| | | if(siteBooking.getSiteId().equals(tSite.getId())){ |
| | |
| | | } |
| | | |
| | | |
| | | List<TSiteType> list2 = siteTypeService.list(); |
| | | List<TSiteType> list2 = siteTypeService.list(new LambdaQueryWrapper<TSiteType>().ne(TSiteType::getState, 3)); |
| | | |
| | | List<Map<String,Object>> mapList = new ArrayList<>(); |
| | | |
| | |
| | | //赛事 |
| | | List<Integer> list2 = competitionClient.queryAppUserId(collect1); |
| | | list.addAll(list2); |
| | | // 没有消费用户时,避免 MyBatis-Plus 生成 appUserId IN () 的非法 SQL。 |
| | | if (list.isEmpty()) { |
| | | list.add(-1); |
| | | } |
| | | //门票 |
| | | |
| | | QueryDataFee queryDataFee = new QueryDataFee(time, list); |
| | |
| | | |
| | | List<Integer> collects = list1.stream().map(SiteBooking::getSiteId).collect(Collectors.toList()); |
| | | if(collects.size()==0){ |
| | | collect.add(-1); |
| | | collects.add(-1); |
| | | } |
| | | List<TSite> list3 = siteService.list(new LambdaQueryWrapper<TSite>().in(TSite::getId, collects)); |
| | | List<TSite> list3 = siteService.list(new LambdaQueryWrapper<TSite>().in(TSite::getId, collects).ne(TSite::getState, 3)); |
| | | for (SiteBooking siteBooking : list1) { |
| | | for (TSite tSite : list3) { |
| | | if(siteBooking.getSiteId().equals(tSite.getId())){ |
| | |
| | | } |
| | | |
| | | |
| | | List<TSiteType> lists2 = siteTypeService.list(); |
| | | List<TSiteType> lists2 = siteTypeService.list(new LambdaQueryWrapper<TSiteType>().ne(TSiteType::getState, 3)); |
| | | |
| | | List<Map<String,Object>> mapList = new ArrayList<>(); |
| | | |
| | |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | List<TSite> list3 = siteService.list(new LambdaQueryWrapper<TSite>().in(TSite::getId, collect)); |
| | | List<TSite> list3 = siteService.list(new LambdaQueryWrapper<TSite>().in(TSite::getId, collect).ne(TSite::getState, 3)); |
| | | for (SiteBooking siteBooking : list1) { |
| | | for (TSite tSite : list3) { |
| | | if(siteBooking.getSiteId().equals(tSite.getId())){ |
| | |
| | | } |
| | | |
| | | |
| | | List<TSiteType> list2 = siteTypeService.list(); |
| | | List<TSiteType> list2 = siteTypeService.list(new LambdaQueryWrapper<TSiteType>().ne(TSiteType::getState, 3)); |
| | | |
| | | List<Map<String,Object>> mapList = new ArrayList<>(); |
| | | |