fix: keep bill cycle switch while salary paused
This commit is contained in:
parent
e3be12cd8b
commit
3c920ee208
@ -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")
|
||||||
|
|||||||
@ -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();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user