diff --git a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/TestRestController.java b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/TestRestController.java index 12d8482f..f8dabab0 100644 --- a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/TestRestController.java +++ b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/TestRestController.java @@ -132,10 +132,10 @@ public class TestRestController extends BaseController { teamSalaryPaymentTask.teamSalaryPaymentTaskTest(); } - @PostMapping("/processTeamMonthBill") - public void processTeamMonthBill() { - teamBillTask.processTeamBillRetry(); - } + @PostMapping("/processTeamMonthBill") + public void processTeamMonthBill() { + teamBillTask.processTeamMonthBillTest(); + } @PostMapping("/activity/send/game") public void activitySendGame(@RequestBody RewardPoolCmd cmd) { diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/TeamBillTask.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/TeamBillTask.java index 21500339..a6be3d10 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/TeamBillTask.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/TeamBillTask.java @@ -32,6 +32,7 @@ import org.springframework.stereotype.Component; public class TeamBillTask { private static final boolean SALARY_SETTLEMENT_PAUSED = true; + private static final boolean BILL_CYCLE_SWITCH_PAUSED = false; private final TeamSalaryMqMessage otherMqMessage; private final TeamProfileService teamProfileService; @@ -58,23 +59,21 @@ public class TeamBillTask { private void processTeamBill() { - if (SALARY_SETTLEMENT_PAUSED) { - log.warn("process_team_bill skipped: salary settlement is temporarily paused"); + if (BILL_CYCLE_SWITCH_PAUSED) { + log.warn("process_team_bill skipped: bill cycle switch is temporarily paused"); return; } - log.warn("开始执行账单处理:{},{}", ZonedDateTimeUtils.nowAsiaRiyadhToInt(), LocalDateTime.now()); - // 出单 - teamBillCycleService.billStatusPayOut(); - - // 创建本月账单,发出结算信号 - consumeProcessPayOutBill(); - log.warn("结束账单处理"); - } - + log.warn("开始执行账期切换:{},{}", ZonedDateTimeUtils.nowAsiaRiyadhToInt(), LocalDateTime.now()); + + // 只创建新月账期,上月账单保留原状态,后续由后台人工结算。 + consumeProcessPayOutBill(); + log.warn("结束账期切换"); + } + public void processTeamBillRetry() { - if (SALARY_SETTLEMENT_PAUSED) { - log.warn("process_team_bill_retry skipped: salary settlement is temporarily paused"); + if (BILL_CYCLE_SWITCH_PAUSED) { + log.warn("process_team_bill_retry skipped: bill cycle switch is temporarily paused"); return; } @@ -138,12 +137,16 @@ public class TeamBillTask { .setOperationTime(TimestampUtils.now()) .setOperationBackUser(teamProfile.getCreateUser()); - teamBillCycleService.createIfAbsent(cmd); - - otherMqMessage.teamBillSettle(new TeamBillSettleEvent() - .setTeamId(teamProfile.getId())); - - success.incrementAndGet(); + teamBillCycleService.createIfAbsent(cmd); + + if (SALARY_SETTLEMENT_PAUSED) { + log.warn("团队账单结算消息暂停发送: teamId={}", teamProfile.getId()); + } else { + otherMqMessage.teamBillSettle(new TeamBillSettleEvent() + .setTeamId(teamProfile.getId())); + } + + success.incrementAndGet(); } catch (Exception e) { fail.incrementAndGet();