新增退出团队校验
This commit is contained in:
parent
258d857026
commit
aabd9cbaac
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user