| | |
| | | chargingUsersByDay.computeIfAbsent(agg.getStatDay(), key -> new HashSet<>()).add(agg.getAppUserId()); |
| | | } |
| | | Map<LocalDate, Long> newUsersByDay = new LinkedHashMap<>(); |
| | | if (range != null && range[0] != null && range[1] != null) { |
| | | List<FranchiseeNewUserStat> newUserStats = chargingOrderMapper.franchiseeNewUserStats(range[0], range[1]); |
| | | if (newUserStats != null) { |
| | | for (FranchiseeNewUserStat stat : newUserStats) { |
| | | if (stat != null && stat.getStatDay() != null && stat.getUserCount() != null) { |
| | | newUsersByDay.put(stat.getStatDay(), stat.getUserCount()); |
| | | if (siteIds != null && !siteIds.isEmpty() && range != null && range[0] != null && range[1] != null) { |
| | | List<FranchiseeUserFirstCharge> firstCharges = chargingOrderMapper.franchiseeUserFirstChargedDays(siteIds, range[0], range[1]); |
| | | if (firstCharges != null) { |
| | | for (FranchiseeUserFirstCharge fc : firstCharges) { |
| | | if (fc != null && fc.getAppUserId() != null && fc.getFirstChargedDay() != null) { |
| | | newUsersByDay.merge(fc.getFirstChargedDay(), 1L, Long::sum); |
| | | } |
| | | } |
| | | } |