| | |
| | | private WithdrawService withdrawService; |
| | | |
| | | @Override |
| | | public List<UserTrendsVO> userTrends(List<String> cityIds) { |
| | | if (null == cityIds || cityIds.isEmpty()) { |
| | | public List<UserTrendsVO> userTrends(List<String> city) { |
| | | if (null == city || city.isEmpty()) { |
| | | return new ArrayList<>(); |
| | | } |
| | | List<UserTrendsVO> userTrendsList = baseMapper.userTrends(cityIds); |
| | | List<UserTrendsVO> userTrendsList = baseMapper.userTrends(city); |
| | | return null == userTrendsList || userTrendsList.isEmpty() ? new ArrayList<>() : userTrendsList; |
| | | } |
| | | |
| | | @Override |
| | | public Object userDataCount(UserDataCountRequest userDataCountRequest) { |
| | | List<String> cityIdList = userDataCountRequest.getCityIdList(); |
| | | List<String> cityList = userDataCountRequest.getCityList(); |
| | | List<User> userList = lambdaQuery().eq(User::getIsDelete, 0).list(); |
| | | // 用户总量 |
| | | Integer userNumber = null == userList ? 0 : userList.size(); |
| | |
| | | if (OrderConstants.QUARTER.equals(userDataCountRequest.getCountType())) { |
| | | // 用户增长数 |
| | | increaseNumber = lambdaQuery().ge(User::getCreateTime, startDateStr).le(User::getCreateTime, endDateStr) |
| | | .in(User::getCityId, cityIdList).eq(User::getIsDelete, 0).count(); |
| | | .in(User::getCity, cityList).eq(User::getIsDelete, 0).count(); |
| | | // 用户总交易额 |
| | | totalMoney = orderService.totalMoneyByQuarter(startDateStr, endDateStr, cityIdList); |
| | | totalMoney = orderService.totalMoneyByQuarter(startDateStr, endDateStr, cityList); |
| | | // 用户提现总额 |
| | | withdrawalTotalMoney = withdrawService.withdrawalTotalMoney(cityIdList); |
| | | withdrawalTotalMoney = withdrawService.withdrawalTotalMoney(cityList); |
| | | } else if (OrderConstants.YEAR.equals(userDataCountRequest.getCountType())) { |
| | | // 用户增长数 |
| | | increaseNumber = baseMapper.increaseNumberByYear(cityIdList); |
| | | increaseNumber = baseMapper.increaseNumberByYear(cityList); |
| | | // 用户总交易额 |
| | | totalMoney = orderService.totalMoneyByYear(cityIdList); |
| | | totalMoney = orderService.totalMoneyByYear(cityList); |
| | | // 用户提现总额 |
| | | withdrawalTotalMoney = withdrawService.withdrawalTotalMoneyByYear(cityIdList); |
| | | withdrawalTotalMoney = withdrawService.withdrawalTotalMoneyByYear(cityList); |
| | | } else if (OrderConstants.MONTH.equals(userDataCountRequest.getCountType())) { |
| | | // 用户增长数 |
| | | increaseNumber = baseMapper.increaseNumberByMonth(cityIdList); |
| | | increaseNumber = baseMapper.increaseNumberByMonth(cityList); |
| | | // 用户总交易额 |
| | | totalMoney = orderService.totalMoneyByMonth(cityIdList); |
| | | totalMoney = orderService.totalMoneyByMonth(cityList); |
| | | // 用户提现总额 |
| | | withdrawalTotalMoney = withdrawService.withdrawalTotalMoneyByMonth(cityIdList); |
| | | withdrawalTotalMoney = withdrawService.withdrawalTotalMoneyByMonth(cityList); |
| | | } else { |
| | | // 数量初始化 |
| | | increaseNumber = 0L; |