|
|
|
@ -417,23 +417,12 @@ public class PartnerServiceImpl implements PartnerService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<JSONObject> dividendData(Long startTime, Long endTime) throws Exception { |
|
|
|
|
public JSONObject dividendData(Long startTime, Long endTime) throws Exception { |
|
|
|
|
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 countRecords; |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 竞选成功返利
|
|
|
|
|