admin页面bd接口字段修改
This commit is contained in:
parent
7c0f44f8a5
commit
f096da9e8d
@ -38,6 +38,7 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -164,26 +165,22 @@ public class BdTeamSummaryQryExe {
|
||||
private BdTeamSummaryCO.TeamSummaryItem queryBdSummary(Long bdUserId, Integer currentBillBelong) {
|
||||
BdTeamSummaryCO.TeamSummaryItem item = new BdTeamSummaryCO.TeamSummaryItem();
|
||||
|
||||
// 查询该用户下的所有 Agency 团队
|
||||
List<BusinessDevelopmentTeam> bdTeamList = businessDevelopmentTeamService.listByUserId(bdUserId);
|
||||
|
||||
if (CollectionUtils.isEmpty(bdTeamList)) {
|
||||
item.setCount(0);
|
||||
item.setTotalIncome(BigDecimal.ZERO);
|
||||
return item;
|
||||
}
|
||||
|
||||
List<BusinessDevelopmentBaseInfo> bdInfos = businessDevelopmentBaseInfoService.listBdByLeadUserId(bdUserId);
|
||||
|
||||
bdInfos = filterBdLeader(bdUserId, bdInfos);
|
||||
|
||||
item.setCount(bdInfos.size());
|
||||
List<Long> list = bdInfos.stream()
|
||||
.filter(e -> !e.getUserId().equals(bdUserId))
|
||||
.map(BusinessDevelopmentBaseInfo::getUserId).toList();
|
||||
|
||||
List<Long> list = bdInfos.stream().map(BusinessDevelopmentBaseInfo::getUserId).toList();
|
||||
bdTeamList = bdTeamList.stream().filter(e -> list.contains(e.getUserId())).collect(Collectors.toList());
|
||||
|
||||
// 计算总收入
|
||||
BigDecimal totalIncome = calculateBdTotalIncome(bdTeamList, currentBillBelong);
|
||||
BigDecimal totalIncome = list.stream().map(bUserId -> {
|
||||
// 查询该用户的bd下的所有 Agency 团队
|
||||
List<BusinessDevelopmentTeam> bdTeamList = businessDevelopmentTeamService.listByUserId(bUserId);
|
||||
if (CollectionUtils.isNotEmpty(bdTeamList)) {
|
||||
// 计算总收入
|
||||
return calculateBdTotalIncome(bdTeamList, currentBillBelong);
|
||||
}
|
||||
return BigDecimal.ZERO;
|
||||
}).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
item.setTotalIncome(totalIncome);
|
||||
|
||||
return item;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user