processBill 调整
This commit is contained in:
parent
d5d28bc6a1
commit
122b048e27
@ -114,7 +114,7 @@ public class TeamBillSettleListener implements MessageListener {
|
||||
return;
|
||||
}
|
||||
|
||||
teamBillCycles.forEach(teamBillCycle -> processBill(teamProfile, teamBillCycle));
|
||||
teamBillCycles.forEach(teamBillCycle -> processBill(teamProfile, teamBillCycle, true));
|
||||
|
||||
} finally {
|
||||
long endTime = LocalDateTimeUtils.nowEpochMilli() - startTime;
|
||||
@ -131,7 +131,7 @@ public class TeamBillSettleListener implements MessageListener {
|
||||
this.process(new TeamBillSettleEvent().setTeamId(teamId));
|
||||
}
|
||||
|
||||
private void processBill(TeamProfile teamProfile, TeamBillCycle teamBillCycle) {
|
||||
public TeamBillSettleResult processBill(TeamProfile teamProfile, TeamBillCycle teamBillCycle, Boolean isPay) {
|
||||
// 获取团队区域政策
|
||||
TeamPolicyManager regionPolicyManager = teamPolicyManagerService.getReleaseByRegionAndType(
|
||||
teamBillCycle.getSysOrigin(),
|
||||
@ -146,7 +146,7 @@ public class TeamBillSettleListener implements MessageListener {
|
||||
.setRemark("[挂起]该区域没有没有发布政策,系统无法处理")
|
||||
.setCreateTime(TimestampUtils.now())
|
||||
);
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
List<TeamMemberTarget> teamMemberTargets = getTeamMemberTargets(teamBillCycle);
|
||||
@ -156,7 +156,7 @@ public class TeamBillSettleListener implements MessageListener {
|
||||
SysRegionConfig regionConfig = sysRegionConfigService.getById(teamProfile.getRegion());
|
||||
if (Objects.isNull(regionConfig)) {
|
||||
log.warn("没有获得团队的区域数据,团队ID:{}", teamProfile.getId());
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
List<TeamBillMemberTarget> teamBillMemberTargets =
|
||||
@ -180,10 +180,15 @@ public class TeamBillSettleListener implements MessageListener {
|
||||
);
|
||||
|
||||
if (CollectionUtils.isEmpty(teamMemberTargets)) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
if (Objects.isNull(regionPolicyManager.getPolicyType()) || Objects.equals(TeamPolicyTypeEnum.MONEY.name(), regionPolicyManager.getPolicyType())) {
|
||||
if (!Boolean.TRUE.equals(isPay)) {
|
||||
return settleResult;
|
||||
}
|
||||
|
||||
if (Objects.isNull(regionPolicyManager.getPolicyType()) ||
|
||||
Objects.equals(TeamPolicyTypeEnum.MONEY.name(), regionPolicyManager.getPolicyType())) {
|
||||
log.warn("美金入账{}", teamProfile);
|
||||
// 成员入账
|
||||
teamMemberCreditedBankBalance(teamProfile
|
||||
@ -196,20 +201,8 @@ public class TeamBillSettleListener implements MessageListener {
|
||||
Objects.toString(teamBillCycle.getId()),
|
||||
settleResult,
|
||||
regionConfig);
|
||||
} else {
|
||||
log.warn("钻石入账{}", teamProfile);
|
||||
// 成员入账
|
||||
teamMemberCreditedSalaryDiamondBalance(teamProfile
|
||||
, teamMemberTargets,
|
||||
teamBillMemberTargets,
|
||||
regionConfig, teamBillCycle.getBillBelong());
|
||||
|
||||
// 团长入账
|
||||
teamOwnCreditedSalaryDiamondBalance(teamProfile,
|
||||
Objects.toString(teamBillCycle.getId()),
|
||||
settleResult,
|
||||
regionConfig, teamBillCycle.getBillBelong());
|
||||
}
|
||||
return settleResult;
|
||||
}
|
||||
|
||||
private List<TeamMemberTarget> getTeamMemberTargets(TeamBillCycle teamBillCycle) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user