From 122b048e27cd544b79e4eb6e040336f2c7f556f8 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Wed, 26 Nov 2025 18:00:26 +0800 Subject: [PATCH] =?UTF-8?q?processBill=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../listener/team/TeamBillSettleListener.java | 31 +++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/team/TeamBillSettleListener.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/team/TeamBillSettleListener.java index 77d0c241..d34efea8 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/team/TeamBillSettleListener.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/team/TeamBillSettleListener.java @@ -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 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 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 getTeamMemberTargets(TeamBillCycle teamBillCycle) {