From c85748b90c96e3e5a18ae3991fafdc61925d1cfd Mon Sep 17 00:00:00 2001 From: Derran Date: Mon, 28 Apr 2025 17:33:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E6=94=BF=E7=AD=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WithdrawAuditUserCommandController.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/withdrawaudit/user/WithdrawAuditUserCommandController.java b/dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/withdrawaudit/user/WithdrawAuditUserCommandController.java index c2ae26c..e6101ea 100644 --- a/dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/withdrawaudit/user/WithdrawAuditUserCommandController.java +++ b/dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/withdrawaudit/user/WithdrawAuditUserCommandController.java @@ -11,7 +11,14 @@ import com.qniao.dam.api.query.withdrawaudit.user.response.UserPageWithdrawAudit import com.qniao.dam.application.service.withdrawaudit.WithdrawAuditApplicationService; import com.qniao.dam.domain.aggregate.withdrawaudit.entity.WithdrawAudit; import com.qniao.dam.domian.aggregate.walletaccount.constant.IdentityTypeEnum; +import com.qniao.dam.infrastructure.persistent.dao.domain.MatchmakerDao; +import com.qniao.dam.query.matchmaker.MatchmakerQueryService; +import com.qniao.dam.query.mntp.MatchmakerNoviceTaskProgressQueryService; +import com.qniao.das.domian.aggregate.mntp.entity.MatchmakerNoviceTaskProgress; +import com.qniao.dau.domain.aggregate.matchmaker.entity.Matchmaker; +import com.qniao.dau.domian.aggregate.matchmaker.constant.MatchmakerLevelEnum; import com.qniao.dau.infrastructure.constant.RequestHeaderFields; +import com.qniao.framework.exception.BizException; import com.qniao.framework.utils.PageUtil; import com.qniao.framework.utils.ServletUtils; import io.swagger.annotations.Api; @@ -30,6 +37,10 @@ public class WithdrawAuditUserCommandController { @Resource private WithdrawAuditApplicationService withdrawAuditApplicationService; + @Resource + private MatchmakerNoviceTaskProgressQueryService matchmakerNoviceTaskProgressQueryService; + @Resource + private MatchmakerQueryService matchmakerQueryService; @ApiOperation("用户发起提现申请") @PostMapping("apply/wallet-account/withdraw") @@ -44,6 +55,16 @@ public class WithdrawAuditUserCommandController { } else { withdrawAudit.setIdentityType(IdentityTypeEnum.INDIVIDUAL); withdrawAudit.setWalletAccountUserId(userId); + //新手任务完成才可以提现 + Matchmaker matchmaker = matchmakerQueryService.queryByUserId(userId); + MatchmakerLevelEnum matchmakerLevel = matchmakerQueryService.queryLevelByUserId(userId); + if (Objects.nonNull(matchmakerLevel) && MatchmakerLevelEnum.MATCHMAKER_PARTNER.getLevel() >= matchmakerLevel.getLevel()) { + MatchmakerNoviceTaskProgress matchmakerNoviceTaskProgress = matchmakerNoviceTaskProgressQueryService.queryByMatchmakerId(matchmaker.getId()); + if (Objects.nonNull(matchmakerNoviceTaskProgress) && !matchmakerNoviceTaskProgress.getIsFinish()) { + //红娘未完成新手任务不能提现 + throw new BizException("未完成新手任务不能提现"); + } + } } List fieldList = ThirdPartyFieldAssembler.from(dto.getThirdPartyFields()); withdrawAuditApplicationService.applyWithdraw(withdrawAudit, fieldList, appId);