总览修改

This commit is contained in:
tianfeng 2025-11-28 10:48:09 +08:00
parent 3303cba20c
commit 74d34c8351
2 changed files with 17 additions and 9 deletions

View File

@ -23,6 +23,7 @@ import com.red.circle.other.infra.database.mongo.service.team.team.TeamProfileSe
import com.red.circle.other.infra.database.rds.entity.team.BusinessDevelopmentTeam;
import com.red.circle.other.infra.database.rds.service.team.BusinessDevelopmentTeamService;
import com.red.circle.other.inner.asserts.team.TeamErrorCode;
import com.red.circle.other.inner.enums.team.TeamBillCycleStatus;
import com.red.circle.other.inner.model.dto.user.UserProfileDTO;
import com.red.circle.tool.core.collection.CollectionUtils;
import lombok.RequiredArgsConstructor;
@ -44,8 +45,6 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
public class BdTeamMemberDetailQryExe {
private static final ZoneId RIYADH_ZONE = ZoneId.of("Asia/Riyadh");
private final TeamBillCycleService teamBillCycleService;
private final TeamMemberTargetService teamMemberTargetService;
private final TeamPolicyManagerService teamPolicyManagerService;
@ -232,9 +231,7 @@ public class BdTeamMemberDetailQryExe {
incomeDetail.setSettlementPeriod(dates[0] + "-" + dates[1]);
// 判断状态
LocalDateTime now = LocalDateTime.now(RIYADH_ZONE);
LocalDateTime endTime = TeamBillCycleUtils.getBillBelongEndTime(teamBillCycle.getBillBelong());
incomeDetail.setStatus(now.isAfter(endTime) ? "Completed" : "In Progress");
incomeDetail.setStatus(TeamBillCycleStatus.SETTLED == teamBillCycle.getStatus() ? "Completed" : "In Progress");
if (CollectionUtils.isEmpty(teamMemberTargets)) {
incomeDetail.setMemberCount(0);
@ -301,9 +298,10 @@ public class BdTeamMemberDetailQryExe {
incomeDetail.setSettlementPeriod(dates[0] + "-" + dates[1]);
// 判断状态
LocalDateTime now = LocalDateTime.now(RIYADH_ZONE);
LocalDateTime endTime = TeamBillCycleUtils.getBillBelongEndTime(billBelong);
incomeDetail.setStatus(now.isAfter(endTime) ? "Completed" : "In Progress");
if (!billsInPeriod.isEmpty()) {
incomeDetail.setStatus(TeamBillCycleStatus.SETTLED == billsInPeriod.get(0).getStatus() ? "Completed" : "In Progress");
}
// 设置Agency数量
incomeDetail.setMemberCount(billsInPeriod.size());

View File

@ -178,7 +178,16 @@ public class BdTeamQryExe {
return Collections.emptyList();
}
// 2. 收集所有 BD 的用户ID
Set<Long> bdIdSet = bdList.stream().map(BusinessDevelopmentBaseInfo::getUserId)
.filter(e -> !e.equals(bdLeaderUserId))
.collect(Collectors.toSet());
List<RoomBdLead> roomBdLeads = roomBdLeadService.listByUserIds(bdIdSet);
List<Long> bdLeaderIdList = roomBdLeads.stream().map(RoomBdLead::getUserId).toList();
bdList = bdList.stream()
.filter(e -> !bdLeaderIdList.contains(e.getUserId()))
.toList();
Set<Long> bdUserIdSet = bdList.stream()
.map(BusinessDevelopmentBaseInfo::getUserId)
.collect(Collectors.toSet());
@ -304,6 +313,7 @@ public class BdTeamQryExe {
member.setUserId(userProfile.getId().toString());
member.setUserName(userProfile.getUserNickname());
member.setAvatar(userProfile.getUserAvatar());
member.setAccount(userProfile.getAccount());
}
// 设置 Host 数量团队成员数量