袁野 1 month ago
parent 81646ec569
commit 5adf7c3718
  1. 11
      service/src/main/java/com/hfkj/service/partner/Impl/PartnerServiceImpl.java

@ -421,7 +421,18 @@ public class PartnerServiceImpl implements PartnerService {
Map<String, Object> params = new HashMap<>();
params.put("startTime", startTime);
params.put("endTime", endTime);
params.put("type", 1);
List<BsPartnerUserRecord> userRecords = bsPartnerUserRecordService.queryAllList(params);
Map<Integer, List<BsPartnerUserRecord>> collect = userRecords.stream().collect(Collectors.groupingBy(BsPartnerUserRecord::getLevel));
List<JSONObject> countRecords = collect.keySet().stream().map(key -> {
JSONObject goodObject = new JSONObject(true);
goodObject.put("level",key);
List<BsPartnerUserRecord> pres = collect.get(key);
goodObject.put("dividendCount", pres.size());
goodObject.put("dividendGoldCoin", pres.stream().map(BsPartnerUserRecord::getGoldCoin).reduce(BigDecimal.ZERO, BigDecimal::add));
return goodObject;
}).collect(Collectors.toList());
return null;
}

Loading…
Cancel
Save