| | |
| | | walletStatisticsDetailList.add(walletStatisticsDetail); |
| | | } |
| | | |
| | | List<WalletStatisticsDetail> collect = r.getData().stream().map(this::createWalletStatisticsDetail).collect(Collectors.toList()); |
| | | // 根据门店名称、用户姓名、联系电话进行模糊过滤 |
| | | collect = collect.stream() |
| | | .filter(e -> { |
| | | if (StringUtils.isNotEmpty(balanceChangeRecord.getShopName())) { |
| | | return e.getShopName().contains(balanceChangeRecord.getShopName()); |
| | | } else if (StringUtils.isNotEmpty(balanceChangeRecord.getUserName())) { |
| | | return e.getUserName().contains(balanceChangeRecord.getUserName()); |
| | | } else if (StringUtils.isNotEmpty(balanceChangeRecord.getUserPhone())) { |
| | | return e.getUserPhone().contains(balanceChangeRecord.getUserPhone()); |
| | | } |
| | | // 根据时间进行范围过滤 |
| | | if (balanceChangeRecord.getStartTime() != null && balanceChangeRecord.getEndTime() != null) { |
| | | return e.getCreateTime().isAfter(balanceChangeRecord.getStartTime()) && e.getCreateTime().isBefore(balanceChangeRecord.getEndTime()); |
| | | } |
| | | return false; |
| | | }).collect(Collectors.toList()); |
| | | walletStatisticsDetailList.addAll(collect); |
| | | |
| | | // 按时间排序(倒序) |
| | | walletStatisticsDetailList.sort(Comparator.comparing(WalletStatisticsDetail::getCreateTime).reversed()); |
| | |
| | | walletStatistics.setTotalWithdraw(totalWithdraw); |
| | | walletStatistics.setTotalShopWithdraw(totalShopWithdraw); |
| | | return walletStatistics; |
| | | } |
| | | |
| | | private WalletStatisticsDetail createWalletStatisticsDetail(ShopBalanceStatement item) { |
| | | WalletStatisticsDetail walletStatisticsDetail = new WalletStatisticsDetail(); |
| | | walletStatisticsDetail.setShopName(item.getShopName()); |
| | | walletStatisticsDetail.setUserName(item.getShopManagerName()); |
| | | walletStatisticsDetail.setUserPhone(item.getPhone()); |
| | | walletStatisticsDetail.setChangeType(4); |
| | | walletStatisticsDetail.setCreateTime(item.getCreateTime()); |
| | | walletStatisticsDetail.setChangeAmount(item.getVariableAmount()); |
| | | return walletStatisticsDetail; |
| | | } |
| | | |
| | | } |