fix: keep bill cycle switch while salary paused

This commit is contained in:
hy001 2026-06-01 10:44:13 +08:00
parent e3be12cd8b
commit 3c920ee208
2 changed files with 26 additions and 23 deletions

View File

@ -134,7 +134,7 @@ public class TestRestController extends BaseController {
@PostMapping("/processTeamMonthBill") @PostMapping("/processTeamMonthBill")
public void processTeamMonthBill() { public void processTeamMonthBill() {
teamBillTask.processTeamBillRetry(); teamBillTask.processTeamMonthBillTest();
} }
@PostMapping("/activity/send/game") @PostMapping("/activity/send/game")

View File

@ -32,6 +32,7 @@ import org.springframework.stereotype.Component;
public class TeamBillTask { public class TeamBillTask {
private static final boolean SALARY_SETTLEMENT_PAUSED = true; private static final boolean SALARY_SETTLEMENT_PAUSED = true;
private static final boolean BILL_CYCLE_SWITCH_PAUSED = false;
private final TeamSalaryMqMessage otherMqMessage; private final TeamSalaryMqMessage otherMqMessage;
private final TeamProfileService teamProfileService; private final TeamProfileService teamProfileService;
@ -58,23 +59,21 @@ public class TeamBillTask {
private void processTeamBill() { private void processTeamBill() {
if (SALARY_SETTLEMENT_PAUSED) { if (BILL_CYCLE_SWITCH_PAUSED) {
log.warn("process_team_bill skipped: salary settlement is temporarily paused"); log.warn("process_team_bill skipped: bill cycle switch is temporarily paused");
return; return;
} }
log.warn("开始执行账单处理:{},{}", ZonedDateTimeUtils.nowAsiaRiyadhToInt(), LocalDateTime.now()); log.warn("开始执行账期切换:{},{}", ZonedDateTimeUtils.nowAsiaRiyadhToInt(), LocalDateTime.now());
// 出单
teamBillCycleService.billStatusPayOut();
// 创建本月账单发出结算信号 // 只创建新月账期上月账单保留原状态后续由后台人工结算
consumeProcessPayOutBill(); consumeProcessPayOutBill();
log.warn("结束账单处理"); log.warn("结束账期切换");
} }
public void processTeamBillRetry() { public void processTeamBillRetry() {
if (SALARY_SETTLEMENT_PAUSED) { if (BILL_CYCLE_SWITCH_PAUSED) {
log.warn("process_team_bill_retry skipped: salary settlement is temporarily paused"); log.warn("process_team_bill_retry skipped: bill cycle switch is temporarily paused");
return; return;
} }
@ -140,8 +139,12 @@ public class TeamBillTask {
teamBillCycleService.createIfAbsent(cmd); teamBillCycleService.createIfAbsent(cmd);
otherMqMessage.teamBillSettle(new TeamBillSettleEvent() if (SALARY_SETTLEMENT_PAUSED) {
.setTeamId(teamProfile.getId())); log.warn("团队账单结算消息暂停发送: teamId={}", teamProfile.getId());
} else {
otherMqMessage.teamBillSettle(new TeamBillSettleEvent()
.setTeamId(teamProfile.getId()));
}
success.incrementAndGet(); success.incrementAndGet();