diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamMemberDetailQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamMemberDetailQryExe.java index 95491a71..850f50ec 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamMemberDetailQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamMemberDetailQryExe.java @@ -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()); diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamQryExe.java index 0c99ea74..fd08b21d 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/bd/query/BdTeamQryExe.java @@ -178,7 +178,16 @@ public class BdTeamQryExe { return Collections.emptyList(); } - // 2. 收集所有 BD 的用户ID + Set bdIdSet = bdList.stream().map(BusinessDevelopmentBaseInfo::getUserId) + .filter(e -> !e.equals(bdLeaderUserId)) + .collect(Collectors.toSet()); + List roomBdLeads = roomBdLeadService.listByUserIds(bdIdSet); + + List bdLeaderIdList = roomBdLeads.stream().map(RoomBdLead::getUserId).toList(); + bdList = bdList.stream() + .filter(e -> !bdLeaderIdList.contains(e.getUserId())) + .toList(); + Set 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 数量(团队成员数量)