|
|
@@ -882,6 +882,50 @@ public class WalletService {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 提现分类页签统计
|
|
|
+ *
|
|
|
+ * @param cashPageReq
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Object cashCount2(CashPageReq cashPageReq) {
|
|
|
+ log.info("运营端提现分类页签统计:{}", JSONObject.toJSONString(cashPageReq));
|
|
|
+ List<String> all = walletRelationService.getAll();
|
|
|
+ if (CollectionUtils.isEmpty(all)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ ChannelEnum channelEnum = null;
|
|
|
+ if (StringUtils.isNotBlank(cashPageReq.getChannel())) {
|
|
|
+ channelEnum = ChannelEnum.getByValue(cashPageReq.getChannel());
|
|
|
+ if (Objects.isNull(channelEnum)) {
|
|
|
+ throw new BusinessException("支付通道不存在");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<CashCount> res = new ArrayList<>();
|
|
|
+ List<CashCount> total = new ArrayList<>();
|
|
|
+ for (String uid : all) {
|
|
|
+ R<List<CashCount>> listR = payCenterService.withdrawCategory(uid, channelEnum);
|
|
|
+ if (listR.getStatus()) {
|
|
|
+ List<CashCount> data = listR.getData();
|
|
|
+ if (!CollectionUtils.isEmpty(data)) {
|
|
|
+ total.addAll(data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Map<String, List<CashCount>> collect = total.stream().collect(Collectors.groupingBy(CashCount::getValue, Collectors.toList()));
|
|
|
+ for (Map.Entry<String, List<CashCount>> map : collect.entrySet()) {
|
|
|
+ Map<String, Long> map1 = collect.get(map.getKey()).stream().collect(Collectors.groupingBy(CashCount::getName, Collectors.summingLong(CashCount::getTotal)));
|
|
|
+ for (Map.Entry<String, Long> one : map1.entrySet()) {
|
|
|
+ CashCount cashCount = new CashCount();
|
|
|
+ cashCount.setName(one.getKey());
|
|
|
+ cashCount.setValue(map.getKey());
|
|
|
+ cashCount.setTotal(one.getValue());
|
|
|
+ res.add(cashCount);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 预付记录
|
|
|
*
|