Compare commits

..

2 Commits

  1. 4
      bweb/src/main/java/com/hfkj/controller/partner/PartnerController.java
  2. 2
      service/src/main/java/com/hfkj/service/partner/Impl/BsPartnerUserRecordServiceImpl.java
  3. 15
      service/src/main/java/com/hfkj/service/partner/Impl/PartnerServiceImpl.java
  4. 2
      service/src/main/java/com/hfkj/service/partner/PartnerService.java

@ -31,8 +31,8 @@ import java.util.List;
import java.util.Map;
@Controller
@RequestMapping(value = "/partner")
@Api(value = "合伙人")
@RequestMapping(value = "/partnerData")
@Api(value = "合伙人统计")
public class PartnerController {
private static final Logger log = LoggerFactory.getLogger(PartnerController.class);

@ -96,6 +96,6 @@ public class BsPartnerUserRecordServiceImpl implements BsPartnerUserRecordServic
if (MapUtils.getInteger(map, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map, "status"));
}
return Collections.emptyList();
return bsPartnerUserRecordMapper.selectByExample(example);
}
}

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

@ -53,5 +53,5 @@ public interface PartnerService {
* @Author: Sum1Dream
* @Date: 2024/10/18 下午2:25
*/
JSONObject dividendData(Long startTime, Long endTime) throws Exception;
List<JSONObject> dividendData(Long startTime, Long endTime) throws Exception;
}

Loading…
Cancel
Save