总览修改
This commit is contained in:
parent
3303cba20c
commit
74d34c8351
@ -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.entity.team.BusinessDevelopmentTeam;
|
||||||
import com.red.circle.other.infra.database.rds.service.team.BusinessDevelopmentTeamService;
|
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.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.other.inner.model.dto.user.UserProfileDTO;
|
||||||
import com.red.circle.tool.core.collection.CollectionUtils;
|
import com.red.circle.tool.core.collection.CollectionUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -44,8 +45,6 @@ import java.util.stream.Collectors;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class BdTeamMemberDetailQryExe {
|
public class BdTeamMemberDetailQryExe {
|
||||||
|
|
||||||
private static final ZoneId RIYADH_ZONE = ZoneId.of("Asia/Riyadh");
|
|
||||||
|
|
||||||
private final TeamBillCycleService teamBillCycleService;
|
private final TeamBillCycleService teamBillCycleService;
|
||||||
private final TeamMemberTargetService teamMemberTargetService;
|
private final TeamMemberTargetService teamMemberTargetService;
|
||||||
private final TeamPolicyManagerService teamPolicyManagerService;
|
private final TeamPolicyManagerService teamPolicyManagerService;
|
||||||
@ -232,9 +231,7 @@ public class BdTeamMemberDetailQryExe {
|
|||||||
incomeDetail.setSettlementPeriod(dates[0] + "-" + dates[1]);
|
incomeDetail.setSettlementPeriod(dates[0] + "-" + dates[1]);
|
||||||
|
|
||||||
// 判断状态
|
// 判断状态
|
||||||
LocalDateTime now = LocalDateTime.now(RIYADH_ZONE);
|
incomeDetail.setStatus(TeamBillCycleStatus.SETTLED == teamBillCycle.getStatus() ? "Completed" : "In Progress");
|
||||||
LocalDateTime endTime = TeamBillCycleUtils.getBillBelongEndTime(teamBillCycle.getBillBelong());
|
|
||||||
incomeDetail.setStatus(now.isAfter(endTime) ? "Completed" : "In Progress");
|
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(teamMemberTargets)) {
|
if (CollectionUtils.isEmpty(teamMemberTargets)) {
|
||||||
incomeDetail.setMemberCount(0);
|
incomeDetail.setMemberCount(0);
|
||||||
@ -301,9 +298,10 @@ public class BdTeamMemberDetailQryExe {
|
|||||||
incomeDetail.setSettlementPeriod(dates[0] + "-" + dates[1]);
|
incomeDetail.setSettlementPeriod(dates[0] + "-" + dates[1]);
|
||||||
|
|
||||||
// 判断状态
|
// 判断状态
|
||||||
LocalDateTime now = LocalDateTime.now(RIYADH_ZONE);
|
if (!billsInPeriod.isEmpty()) {
|
||||||
LocalDateTime endTime = TeamBillCycleUtils.getBillBelongEndTime(billBelong);
|
incomeDetail.setStatus(TeamBillCycleStatus.SETTLED == billsInPeriod.get(0).getStatus() ? "Completed" : "In Progress");
|
||||||
incomeDetail.setStatus(now.isAfter(endTime) ? "Completed" : "In Progress");
|
}
|
||||||
|
|
||||||
|
|
||||||
// 设置Agency数量
|
// 设置Agency数量
|
||||||
incomeDetail.setMemberCount(billsInPeriod.size());
|
incomeDetail.setMemberCount(billsInPeriod.size());
|
||||||
|
|||||||
@ -178,7 +178,16 @@ public class BdTeamQryExe {
|
|||||||
return Collections.emptyList();
|
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()
|
Set<Long> bdUserIdSet = bdList.stream()
|
||||||
.map(BusinessDevelopmentBaseInfo::getUserId)
|
.map(BusinessDevelopmentBaseInfo::getUserId)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
@ -304,6 +313,7 @@ public class BdTeamQryExe {
|
|||||||
member.setUserId(userProfile.getId().toString());
|
member.setUserId(userProfile.getId().toString());
|
||||||
member.setUserName(userProfile.getUserNickname());
|
member.setUserName(userProfile.getUserNickname());
|
||||||
member.setAvatar(userProfile.getUserAvatar());
|
member.setAvatar(userProfile.getUserAvatar());
|
||||||
|
member.setAccount(userProfile.getAccount());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置 Host 数量(团队成员数量)
|
// 设置 Host 数量(团队成员数量)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user