From ef7fe36a42bc11577a357fb1859a48d56d5d5d79 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 11 Dec 2025 15:08:21 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=93=E5=8F=B7=E5=AE=A1=E6=A0=B8=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/UserBeautifulNumberApplyCmdExe.java | 2 +- .../UserBeautifulNumberApplyServiceImpl.java | 10 +----- .../UserBeautifulNumberClientServiceImpl.java | 33 +++++++++++++++++++ 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/UserBeautifulNumberApplyCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/UserBeautifulNumberApplyCmdExe.java index db2712b9..bb09b7ba 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/UserBeautifulNumberApplyCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/UserBeautifulNumberApplyCmdExe.java @@ -52,7 +52,7 @@ public class UserBeautifulNumberApplyCmdExe { Boolean.TRUE.equals(hasPendingApply) ); - // (4) 用户在当前财富等级已经申请过ID(申请失败)- 通过数据库判断 + // (4) 用户在当前财富等级已经申请过ID(申请成功)- 通过数据库判断 Boolean hasAppliedFailed = userBeautifulNumberApplyService.hasAppliedAtLevelWithFailure(userId, wealthLevel); ResponseAssert.isFalse( UserSpecialErrorCode.ALREADY_APPLIED_AT_LEVEL, diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/UserBeautifulNumberApplyServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/UserBeautifulNumberApplyServiceImpl.java index 1a595057..25ba3adc 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/UserBeautifulNumberApplyServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/UserBeautifulNumberApplyServiceImpl.java @@ -50,9 +50,6 @@ public class UserBeautifulNumberApplyServiceImpl extends @Override public void handleApply(Long id, Integer state) { - - ResponseAssert.isTrue(CommonErrorCode.TYPE_IS_NOT_IN_SCOPE, checkState(state)); - UserBeautifulNumberApply apply = query().eq(UserBeautifulNumberApply::getId, id).getOne(); ResponseAssert.notNull(CommonErrorCode.DATA_ERROR, apply); @@ -62,17 +59,12 @@ public class UserBeautifulNumberApplyServiceImpl extends } - - private boolean checkState(Integer state) { - return Objects.equals(state, 1) || Objects.equals(state, 2); - } - @Override public Boolean hasAppliedAtLevelWithFailure(Long userId, Integer wealthLevel) { return Optional.ofNullable(query() .eq(UserBeautifulNumberApply::getApplyUser, userId) .eq(UserBeautifulNumberApply::getWealthLevel, wealthLevel) - .eq(UserBeautifulNumberApply::getState, 2) + .eq(UserBeautifulNumberApply::getState, 1) .list()).map(CollectionUtil::isNotEmpty).orElse(Boolean.FALSE); } diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserBeautifulNumberClientServiceImpl.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserBeautifulNumberClientServiceImpl.java index 69ca69f6..16a6a05b 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserBeautifulNumberClientServiceImpl.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserBeautifulNumberClientServiceImpl.java @@ -1,6 +1,11 @@ package com.red.circle.other.app.inner.service.user.user.impl; +import com.red.circle.framework.core.asserts.ResponseAssert; +import com.red.circle.framework.core.response.CommonErrorCode; import com.red.circle.framework.dto.PageResult; +import com.red.circle.other.infra.database.mongo.entity.user.profile.UserSpecialId; +import com.red.circle.other.infra.database.mongo.service.user.profile.UserSpecialIdService; +import com.red.circle.other.infra.database.rds.entity.user.user.UserBeautifulNumberApply; import com.red.circle.other.infra.database.rds.service.user.user.UserBeautifulNumberApplyService; import com.red.circle.other.infra.database.rds.service.user.user.UserBeautifulNumberService; import com.red.circle.other.app.inner.convertor.user.UserProfileInnerConvertor; @@ -10,9 +15,12 @@ import com.red.circle.other.inner.model.cmd.user.UserBeautifulNumberCmd; import com.red.circle.other.inner.model.dto.user.BeautifulNumberDTO; import com.red.circle.other.inner.model.dto.user.UserBeautifulNumberApplyDTO; import com.red.circle.other.app.inner.service.user.user.UserBeautifulNumberClientService; +import com.red.circle.tool.core.date.TimestampUtils; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.util.Objects; + /** *
* 用户申请靓号记录 服务类.
@@ -29,6 +37,7 @@ public class UserBeautifulNumberClientServiceImpl implements
private final UserProfileInnerConvertor userProfileInnerConvertor;
private final UserBeautifulNumberService userBeautifulNumberService;
private final UserBeautifulNumberApplyService userBeautifulNumberApplyService;
+ private final UserSpecialIdService userSpecialIdService;
@Override
public PageResult