From aabd9cbaac5d9d6b3ff04c9552f5e3ec1ea30a4b Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Mon, 13 Oct 2025 19:30:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=80=E5=87=BA=E5=9B=A2?= =?UTF-8?q?=E9=98=9F=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../red/circle/other/inner/asserts/team/TeamErrorCode.java | 5 +++++ .../other/app/command/team/TeamUserApplyQuitExe.java | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/team/TeamErrorCode.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/team/TeamErrorCode.java index d1d0ab7a..15ce8757 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/team/TeamErrorCode.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/team/TeamErrorCode.java @@ -218,6 +218,11 @@ public enum TeamErrorCode implements IResponseErrorCode { */ ADMIN_PERMISSION_INSUFFICIENT(6050, "Administrator permission insufficient"), + /** + * 退出日期无效 + */ + QUIT_DATE_INVALID(6051, "The host can only leave the current agent on the 1st and 16th of each month"), + ; private final Integer code; diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/TeamUserApplyQuitExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/TeamUserApplyQuitExe.java index 5b5f2a19..23642789 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/TeamUserApplyQuitExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/TeamUserApplyQuitExe.java @@ -24,6 +24,7 @@ import com.red.circle.other.inner.enums.team.TeamAppProcessReason; import com.red.circle.other.inner.enums.team.TeamApplicationProcessStatus; import com.red.circle.other.inner.enums.team.TeamApplicationType; import com.red.circle.tool.core.date.TimestampUtils; +import com.red.circle.tool.core.date.ZonedDateTimeAsiaRiyadhUtils; import com.red.circle.tool.core.sequence.IdWorkerUtils; import com.red.circle.wallet.inner.endpoint.wallet.WalletGoldClient; import com.red.circle.wallet.inner.error.WalletErrorCode; @@ -31,6 +32,7 @@ import com.red.circle.wallet.inner.model.cmd.GoldReceiptCmd; import com.red.circle.wallet.inner.model.dto.WalletReceiptResDTO; import com.red.circle.wallet.inner.model.enums.GoldOrigin; import java.math.BigDecimal; +import java.time.LocalDate; import java.util.Objects; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -56,6 +58,11 @@ public class TeamUserApplyQuitExe { public String execute(TeamUserApplyCmd cmd) { + // 校验退出日期:只有每月1号和16号可以退出 + LocalDate now = ZonedDateTimeAsiaRiyadhUtils.now().toLocalDate(); + int dayOfMonth = now.getDayOfMonth(); + ResponseAssert.isTrue(TeamErrorCode.QUIT_DATE_INVALID, dayOfMonth == 1 || dayOfMonth == 16); + UserProfileDTO userProfile = userProfileAppConvertor.toUserProfileDTO( userProfileGateway.getByUserId(cmd.getReqUserId())); ResponseAssert.notNull(CommonErrorCode.NOT_FOUND_RECORD_INFO, userProfile);