|
|
@@ -505,7 +505,7 @@ public class CommissionService {
|
|
|
|
|
|
// 批量预取成员汇总(避免 N+1):已完成履约订单总额 + 非cancelled佣金总额,循环内直接取用
|
|
|
List<Long> buyerIds = new ArrayList<>(memberMap.keySet());
|
|
|
- Map<Long, Long> consumptionMap = new HashMap<>();
|
|
|
+ Map<Long, Integer> consumptionMap = new HashMap<>();
|
|
|
Map<Long, Integer> cfEarnedMap = new HashMap<>();
|
|
|
if (!buyerIds.isEmpty()) {
|
|
|
LambdaQueryWrapper<ProductOrder> consumptionWrapper = new LambdaQueryWrapper<ProductOrder>()
|
|
|
@@ -513,7 +513,7 @@ public class CommissionService {
|
|
|
.eq(ProductOrder::getFulfillStatus, "completed");
|
|
|
for (ProductOrder order : productOrderMapper.selectList(consumptionWrapper)) {
|
|
|
if (order.getBuyerId() == null || order.getTotalAmount() == null) continue;
|
|
|
- consumptionMap.merge(order.getBuyerId(), order.getTotalAmount().longValue(), Long::sum);
|
|
|
+ consumptionMap.merge(order.getBuyerId(), order.getTotalAmount(), Integer::sum);
|
|
|
}
|
|
|
|
|
|
LambdaQueryWrapper<CommissionRecord> cfWrapper = new LambdaQueryWrapper<CommissionRecord>()
|
|
|
@@ -555,7 +555,7 @@ public class CommissionService {
|
|
|
.sum();
|
|
|
memberInfo.put("commissionEarned", commissionEarned);
|
|
|
|
|
|
- memberInfo.put("memberConsumption", consumptionMap.getOrDefault(buyerId, 0L));
|
|
|
+ memberInfo.put("memberConsumption", consumptionMap.getOrDefault(buyerId, 0));
|
|
|
memberInfo.put("myCfEarnedFromMember", cfEarnedMap.getOrDefault(buyerId, 0));
|
|
|
}
|
|
|
|